DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
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.
Date: Mon, 24 Aug 2020 16:18:31 +0100	[thread overview]
Message-ID: <3f126048-c0a6-fcac-8819-7e2affdf811a@intel.com> (raw)
In-Reply-To: <20200824080733.064b4748@hermes.lan>

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'.

  reply	other threads:[~2020-08-24 15:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 15:07 Stephen Hemminger
2020-08-24 15:18 ` Ferruh Yigit [this message]
2020-08-24 15:33   ` Hemant Agrawal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f126048-c0a6-fcac-8819-7e2affdf811a@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=sachin.saxena@nxp.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).