From: Chas Williams Date: Thu, 5 Jan 2017 13:53:41 +0000 (-0500) Subject: net/af_packet: add interface name to internals X-Git-Tag: spdx-start~4800 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1b93c2aa81b4;p=dpdk.git net/af_packet: add interface name to internals This will be used by later changes to determine the underlying Linux interface. Signed-off-by: Chas Williams Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index ed24d385a3..2b01cb09e0 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; @@ -539,6 +540,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) { @@ -730,6 +732,7 @@ error: ((*internals)->rx_queue[q].sockfd != qsockfd)) close((*internals)->rx_queue[q].sockfd); } + free((*internals)->if_name); rte_free(*internals); error_early: rte_free(data); @@ -898,6 +901,7 @@ rte_pmd_af_packet_remove(const char *name) rte_free(internals->rx_queue[q].rd); rte_free(internals->tx_queue[q].rd); } + free(internals->if_name); rte_free(eth_dev->data->dev_private); rte_free(eth_dev->data);