On Thu, 11 Aug 2022 06:31:31 +0000
Chaoyong He <chaoyong...@corigine.com> wrote:

> > -----Original Message-----
> > From: Stephen Hemminger <step...@networkplumber.org>
> > Sent: Thursday, August 11, 2022 12:25 PM
> > To: Chaoyong He <chaoyong...@corigine.com>
> > Cc: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>; Niklas
> > Soderlund <niklas.soderl...@corigine.com>; dev@dpdk.org
> > Subject: Re: [PATCH v5 07/12] net/nfp: add flower ctrl VNIC related logics
> > 
> > On Thu, 11 Aug 2022 01:26:49 +0000
> > Chaoyong He <chaoyong...@corigine.com> wrote:
> >   
> > > > > The 'port_id' is the 'Device [external] port identifier', which
> > > > > related with the 'rte_ethdev_devices[]' I think.
> > > > > Here the ethdev we created is not exposed to the user and is not
> > > > > in the  
> > > > 'rte_ethdev_devices[]'  
> > > > > array, so it can't be invoked by the user at all.
> > > > > And we invoke this ethdev through a pointer in the `struct
> > > > > nfp_net_hw`, so I think there should no conflict with other ones
> > > > > in the  
> > > > system.
> > > >
> > > > DPDK already has a port ownership framework to deal with internal
> > > > ethernet device ports. Why was this not used?  
> > >
> > > Sorry I have no knowledge about this framework before. Any document
> > > link or logic about this framework will be greatly appreciated. Thanks!  
> > 
> > It is part of ethdev https://doc.dpdk.org/api/rte__ethdev_8h.html
> > 
> > See rte_eth_dev_owner_new, rte_eth_dev_owner_set, etc
> > https://doc.dpdk.org/api/rte__ethdev_8h.html#ad6817cc801bf0faa566f52d3
> > 82214457  
> 
> Thank you very much!
> 
> If the app uses the rte_eth_dev_owner_* APIs to check the ownership first, it 
> does can
> protect the internal ethdev ports.
> But right now, the ovs-dpdk seems don't use these APIs at all, and it can use 
> 'port_id' to
> get any ethdev port in rte_ethdev_devices[] array.
> So maybe it's a good idea to keep our original logic and keep an eye on this 
> area, once
> the ovs-dpdk use the rte_eth_dev_owner_* APIs, we'll update the logic here 
> accordingly.
> 
> Thanks again!

Once device is owned by something, then it is no longer show in the FOREACH and 
other
iterators; so ovs-dpdk should be ok.  This mechanism is how bonding, failsafe, 
and netvsc
drivers handle sub devices. Therefore OVS should be smart enough to handle it.

Reply via email to