[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ae763e223c0040259c63c1e745faa095@intel.com>
Date: Fri, 5 Feb 2021 15:23:12 +0000
From: "Saleem, Shiraz" <shiraz.saleem@...el.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: "dledford@...hat.com" <dledford@...hat.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Ertman, David M" <david.m.ertman@...el.com>,
"Nguyen, Anthony L" <anthony.l.nguyen@...el.com>
Subject: RE: [PATCH 04/22] ice: Register auxiliary device to provide RDMA
> Subject: Re: [PATCH 04/22] ice: Register auxiliary device to provide RDMA
>
> > @@ -1254,20 +1282,37 @@ int ice_init_peer_devices(struct ice_pf *pf)
> > * |--> iidc_peer_obj
> > * |--> *ice_peer_drv_int
> > *
> > + * iidc_auxiliary_object (container_of parent for adev)
> > + * |--> auxiliary_device
> > + * |--> *iidc_peer_obj (pointer from internal struct)
> > + *
> > * ice_peer_drv_int (internal only peer_drv struct)
> > */
> > peer_obj_int = kzalloc(sizeof(*peer_obj_int), GFP_KERNEL);
> > - if (!peer_obj_int)
> > + if (!peer_obj_int) {
> > + ida_simple_remove(&ice_peer_ida, id);
> > return -ENOMEM;
> > + }
>
> Why is this allocated memory with a lifetime different from the aux device?
This ice_peer_obj_int is the PCI driver internal only info about the peer_obj (not exposed externally)
like the state machine, per PF. But Dave is re-writing all of this with the feedback about getting rid
of state machine, and this peer_obj_int will likely be culled.
I think what we will end up with is an iidc_peer_obj per PF which is exported to aux driver with lifetime as described below.
/* structure layout needed for container_of's looks like:
* iidc_auxiliary_dev (container_of parent for adev)
* |--> auxiliary_device
* |--> *iidc_peer_obj (pointer from peer_obj struct)
*
* The iidc_auxiliary device has a lifespan as long as it is
* on the bus. Once removed it will be freed and a new
* one allocated if needed to re-add.
*
* The peer_obj is tied to the life of the PF, and will
* exist as long as the PF driver is loaded. It will be
* freed in the remove flow for the PF driver.
*/
Powered by blists - more mailing lists