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 <ciwillia@brocade.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
Chas Williams 2017-01-05 08:53:41 -05:00 committed by Ferruh Yigit
parent d7579634f7
commit 1b93c2aa81

@ -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);