lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM4PR11MB6502B815D05CE9A6A39C0968D467A@DM4PR11MB6502.namprd11.prod.outlook.com>
Date: Wed, 28 May 2025 21:35:03 +0000
From: "Hay, Joshua A" <joshua.a.hay@...el.com>
To: Simon Horman <horms@...nel.org>, "Nikolova, Tatyana E"
	<tatyana.e.nikolova@...el.com>
CC: "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
	"jgg@...dia.com" <jgg@...dia.com>, "leon@...nel.org" <leon@...nel.org>,
	"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "kuba@...nel.org"
	<kuba@...nel.org>, "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>
Subject: RE: [iwl-next 2/6] idpf: implement core RDMA auxiliary dev create,
 init, and destroy

> -----Original Message-----
> From: Simon Horman <horms@...nel.org>
> Sent: Wednesday, May 28, 2025 3:41 AM
> To: Nikolova, Tatyana E <tatyana.e.nikolova@...el.com>
> Cc: intel-wired-lan@...ts.osuosl.org; jgg@...dia.com; leon@...nel.org; linux-
> rdma@...r.kernel.org; netdev@...r.kernel.org; kuba@...nel.org; Nguyen,
> Anthony L <anthony.l.nguyen@...el.com>; Hay, Joshua A
> <joshua.a.hay@...el.com>
> Subject: Re: [iwl-next 2/6] idpf: implement core RDMA auxiliary dev create,
> init, and destroy
> 
> On Fri, May 23, 2025 at 12:04:31PM -0500, Tatyana Nikolova wrote:
> > From: Joshua Hay <joshua.a.hay@...el.com>
> >
> > Add the initial idpf_idc.c file with the functions to kick off the IDC
> > initialization, create and initialize a core RDMA auxiliary device, and
> > destroy said device.
> >
> > The RDMA core has a dependency on the vports being created by the
> > control plane before it can be initialized. Therefore, once all the
> > vports are up after a hard reset (either during driver load or a function
> > level reset), the core RDMA device info will be created. It is populated
> > with the function type (as distinguished by the IDC initialization
> > function pointer), the core idc_ops function points (just stubs for
> > now), the reserved RDMA MSIX table, and various other info the core RDMA
> > auxiliary driver will need. It is then plugged on to the bus.
> >
> > During a function level reset or driver unload, the device will be
> > unplugged from the bus and destroyed.
> >
> > Reviewed-by: Madhu Chittim <madhu.chittim@...el.com>
> > Signed-off-by: Joshua Hay <joshua.a.hay@...el.com>
> > Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@...el.com>
> 
> ...
> 
> > diff --git a/drivers/net/ethernet/intel/idpf/idpf_idc.c
> b/drivers/net/ethernet/intel/idpf/idpf_idc.c
> 
> ...
> 
> > +/**
> > + * idpf_idc_init_aux_core_dev - initialize Auxiliary Device(s)
> > + * @adapter: driver private data structure
> > + * @ftype: PF or VF
> > + *
> > + * Return: 0 on success or error code on failure.
> > + */
> > +int idpf_idc_init_aux_core_dev(struct idpf_adapter *adapter,
> > +			       enum iidc_function_type ftype)
> > +{
> > +	struct iidc_rdma_core_dev_info *cdev_info;
> > +	struct iidc_rdma_priv_dev_info *privd;
> > +	int err;
> > +
> > +	adapter->cdev_info = kzalloc(sizeof(*cdev_info), GFP_KERNEL);
> > +	if (!adapter->cdev_info)
> > +		return -ENOMEM;
> > +
> > +	privd = kzalloc(sizeof(*privd), GFP_KERNEL);
> > +	if (!privd) {
> > +		err = -ENOMEM;
> > +		goto err_privd_alloc;
> 
> Hi Joshua, Tatyana, all,
> 
> Jumping to err_privd_alloc will free cdev_info.
> However cdev_info isn't initialised until a few lines
> further down.
> 
> Flagged by Smatch.

Ah, right. Will fix in v2.

Thanks,
Josh

> 
> > +	}
> > +
> > +	cdev_info = adapter->cdev_info;
> > +	cdev_info->iidc_priv = privd;
> > +	cdev_info->pdev = adapter->pdev;
> > +	cdev_info->rdma_protocol = IIDC_RDMA_PROTOCOL_ROCEV2;
> > +	privd->ftype = ftype;
> > +
> > +	idpf_idc_init_msix_data(adapter);
> > +
> > +	err = idpf_plug_core_aux_dev(cdev_info);
> > +	if (err)
> > +		goto err_plug_aux_dev;
> > +
> > +	return 0;
> > +
> > +err_plug_aux_dev:
> > +	kfree(privd);
> > +err_privd_alloc:
> > +	kfree(cdev_info);
> > +	adapter->cdev_info = NULL;
> > +
> > +	return err;
> > +}
> 
> ...


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ