All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: 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: [dpdk-dev] Misuses of dev_info->if_index in embedded drivers.
Date: Mon, 24 Aug 2020 08:07:33 -0700	[thread overview]
Message-ID: <20200824080733.064b4748@hermes.lan> (raw)

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.

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 15:07 Stephen Hemminger [this message]
2020-08-24 15:18 ` [dpdk-dev] Misuses of dev_info->if_index in embedded drivers Ferruh Yigit
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=20200824080733.064b4748@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=sachin.saxena@nxp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.