DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Charles (Chas) Williams" <ciwillia@brocade.com>
To: <dev@dpdk.org>
Cc: <linville@tuxdriver.com>,
	"Charles (Chas) Williams" <ciwillia@brocade.com>
Subject: [dpdk-dev] [PATCH 1/4] net/af_packet: add iface name to internals
Date: Tue, 3 Jan 2017 15:26:08 -0500	[thread overview]
Message-ID: <1483475171-20387-1-git-send-email-ciwillia@brocade.com> (raw)

This will be used by later changes to determine the underlying linux
interface.

Signed-off-by: Chas Williams <ciwillia@brocade.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index a1e13ff..5541fd7 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -99,6 +99,7 @@ struct pmd_internals {
 	unsigned nb_queues;
 
 	int if_index;
+	char *if_name;
 	struct ether_addr eth_addr;
 
 	struct tpacket_req req;
@@ -533,6 +534,7 @@ rte_pmd_init_internals(const char *name,
 		        name);
 		goto error_early;
 	}
+	(*internals)->if_name = strdup(pair->value);
 	(*internals)->if_index = ifr.ifr_ifindex;
 
 	if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) == -1) {
@@ -724,6 +726,7 @@ rte_pmd_init_internals(const char *name,
 			((*internals)->rx_queue[q].sockfd != qsockfd))
 			close((*internals)->rx_queue[q].sockfd);
 	}
+	rte_free((*internals)->if_name);
 	rte_free(*internals);
 error_early:
 	rte_free(data);
@@ -892,6 +895,7 @@ rte_pmd_af_packet_remove(const char *name)
 		rte_free(internals->rx_queue[q].rd);
 		rte_free(internals->tx_queue[q].rd);
 	}
+	rte_free(internals->if_name);
 
 	rte_free(eth_dev->data->dev_private);
 	rte_free(eth_dev->data);
-- 
2.1.4

             reply	other threads:[~2017-01-03 20:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 20:26 Charles (Chas) Williams [this message]
2017-01-03 20:26 ` [dpdk-dev] [PATCH 2/4] net/af_packet: add support to change mtu Charles (Chas) Williams
2017-01-03 20:26 ` [dpdk-dev] [PATCH 3/4] net/af_packet: promisicuous support Charles (Chas) Williams
2017-01-03 20:26 ` [dpdk-dev] [PATCH 4/4] net/af_packet: add 802.1Q (VLAN) support Charles (Chas) Williams

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=1483475171-20387-1-git-send-email-ciwillia@brocade.com \
    --to=ciwillia@brocade.com \
    --cc=dev@dpdk.org \
    --cc=linville@tuxdriver.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).