> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yi...@intel.com>
> Sent: Thursday, February 3, 2022 12:36 PM
> To: Singh, Jasvinder <jasvinder.si...@intel.com>; Dumitrescu, Cristian
> <cristian.dumitre...@intel.com>
> Cc: Kumara Parameshwaran <kparamesh...@vmware.com>; Kumara
> Parameshwaran <kumaraparames...@gmail.com>; dev@dpdk.org
> Subject: Re: [PATCH v1] drivers/net: use internal API to get eth dev from
> name
> 
> On 2/3/2022 8:24 AM, Kumara Parameshwaran wrote:
> > From: Kumara Parameshwaran<kparamesh...@vmware.com>
> >
> > Make changes in PMDs to use the new function where
> > rte_eth_dev_get_port_by_name is used to get port_id to access
> > rte_eth_devices
> >
> > Signed-off-by: Kumara Parameshwaran<kparamesh...@vmware.com>
> > ---
> > v1
> > * Replace rte_eth_get_get_port_by_name in PMDs with
> rte_eth_dev_get_by_name
> >    where port_id is used to retrieve rte_eth_dev data structure
> 
> Hi Jasvinder, Cristian,
> 
> Can you please investigate using 'rte_eth_dev_get_by_name()' internal API
> instead of 'rte_eth_dev_get_port_by_name()' to eliminate direct access to
> global 'rte_eth_devices' array from softnic driver?
> 
> Thanks,
> Ferruh


Hi Ferruh

I addition to the changes that already made in the patch, there are two more 
places when "'rte_eth_dev_get_port_by_name()" is used to access 
rte_eth_devices[] array. 

1. In dpdk/drivers/net/softnic/rte_eth_softnic_internals.h , wrapper function 
is defined for accessing rte_eth_devices[] using 'rte_eth_dev_get_port_by_name 
(), that could be removed. 
        static inline struct rte_eth_dev * ETHDEV(struct pmd_internals *softnic)

2.  In dpdk/drivers/net/softnic/rte_eth_softnic_flow.c, remove the usage of 
above wrapper function at 2 places, and 'rte_eth_dev_get_by_name() can be used.


Thanks,
Jasvinder

Reply via email to