* [dpdk-dev] Misuses of dev_info->if_index in embedded drivers.
@ 2020-08-24 15:07 Stephen Hemminger
2020-08-24 15:18 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2020-08-24 15:07 UTC (permalink / raw)
To: Hemant Agrawal, Sachin Saxena; +Cc: dev, Gagandeep Singh, Akhil Goyal
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] Misuses of dev_info->if_index in embedded drivers.
2020-08-24 15:07 [dpdk-dev] Misuses of dev_info->if_index in embedded drivers Stephen Hemminger
@ 2020-08-24 15:18 ` Ferruh Yigit
2020-08-24 15:33 ` Hemant Agrawal
0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2020-08-24 15:18 UTC (permalink / raw)
To: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Cc: dev, Gagandeep Singh, Akhil Goyal
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'.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] Misuses of dev_info->if_index in embedded drivers.
2020-08-24 15:18 ` Ferruh Yigit
@ 2020-08-24 15:33 ` Hemant Agrawal
0 siblings, 0 replies; 3+ messages in thread
From: Hemant Agrawal @ 2020-08-24 15:33 UTC (permalink / raw)
To: Ferruh Yigit, Stephen Hemminger, Sachin Saxena
Cc: dev, Gagandeep Singh, Akhil Goyal
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Monday, August 24, 2020 8:49 PM
> To: Stephen Hemminger <stephen@networkplumber.org>; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>
> Cc: dev@dpdk.org; Gagandeep Singh <G.Singh@nxp.com>; Akhil Goyal
> <akhil.goyal@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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-24 15:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 15:07 [dpdk-dev] Misuses of dev_info->if_index in embedded drivers Stephen Hemminger
2020-08-24 15:18 ` Ferruh Yigit
2020-08-24 15:33 ` Hemant Agrawal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).