DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: dev@dpdk.org
Cc: Francesco Santoro <francesco.santoro@6wind.com>
Subject: [dpdk-dev] [PATCH 2/3] mlx4: fill if_index field in dev_info structure
Date: Mon,  5 Oct 2015 19:50:07 +0200	[thread overview]
Message-ID: <1444067408-29329-2-git-send-email-adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <1444067408-29329-1-git-send-email-adrien.mazarguil@6wind.com>

From: Francesco Santoro <francesco.santoro@6wind.com>

Allows applications to retrieve the name of the related netdevice.

Signed-off-by: Francesco Santoro <francesco.santoro@6wind.com>
---
 drivers/net/mlx4/mlx4.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index e1ca577..9614471 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -3819,6 +3819,7 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 {
 	struct priv *priv = dev->data->dev_private;
 	unsigned int max;
+	char ifname[IF_NAMESIZE];
 
 	priv_lock(priv);
 	/* FIXME: we should ask the device for these values. */
@@ -3848,6 +3849,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 		  DEV_TX_OFFLOAD_UDP_CKSUM |
 		  DEV_TX_OFFLOAD_TCP_CKSUM) :
 		 0);
+	if (priv_get_ifname(priv, &ifname) == 0)
+		info->if_index = if_nametoindex(ifname);
 	priv_unlock(priv);
 }
 
-- 
2.1.0

  reply	other threads:[~2015-10-05 17:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 17:50 [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function Adrien Mazarguil
2015-10-05 17:50 ` Adrien Mazarguil [this message]
2015-10-05 17:50 ` [dpdk-dev] [PATCH 3/3] mlx4: do not expose broadcast address in MAC list Adrien Mazarguil
2015-10-20 19:59 ` [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function Thomas Monjalon

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=1444067408-29329-2-git-send-email-adrien.mazarguil@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=francesco.santoro@6wind.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 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).