[dpdk-dev] Misuses of dev_info->if_index in embedded drivers.

Hemant Agrawal hemant.agrawal at nxp.com
Mon Aug 24 17:33:37 CEST 2020


> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit at intel.com>
> Sent: Monday, August 24, 2020 8:49 PM
> To: Stephen Hemminger <stephen at networkplumber.org>; Hemant Agrawal
> <hemant.agrawal at nxp.com>; Sachin Saxena <sachin.saxena at nxp.com>
> Cc: dev at dpdk.org; Gagandeep Singh <G.Singh at nxp.com>; Akhil Goyal
> <akhil.goyal at nxp.com>
> Subject: Re: [dpdk-dev] Misuses of dev_info->if_index in embedded drivers.
> 
> On 8/24/2020 4:07 PM, Stephen Hemminger wrote:
> > The use of if_index in some drivers is wrong.
> > It does not match the user expectation in the documentation.
> >
> > This code:
> > dpaa2/dpaa2_ethdev.c:   dev_info->if_index = priv->hw_id;
> > pfe/pfe_ethdev.c:       dev_info->if_index = internals->id;
> >
> > Does match:
> > struct rte_eth_dev_info {
> > 	struct rte_device *device; /** Generic device information */
> > 	const char *driver_name; /**< Device Driver name. */
> > 	unsigned int if_index; /**< Index to bound host interface, or 0 if
> none.
> > 		Use if_indextoname() to translate into an interface name. */
> >
> > Also, this code is unnecessary.
> >
> 
> 'if_index' is needed only for some PMDs interact with kernel, like af_packet,
> pcap, tap, af_xdp, ...
> 
> Agree that it should not be needed for 'dpaa2' or 'pfe'.
[Hemant] ok. We will check and remove it.


More information about the dev mailing list