summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMats Liljegren <mats.liljegren@enea.com>2014-01-24 14:24:14 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-01-27 16:38:51 +0100
commited2c69c3ef73da10c85f4118dfb3ce1505d8dff7 (patch)
tree04231bd791eb9818c4d35bb1d80aff4855601d7e /lib
parent8d2a095e097160a39f8a71002fd1dae63dae73dc (diff)
downloaddpdk-ed2c69c3ef73da10c85f4118dfb3ce1505d8dff7.zip
dpdk-ed2c69c3ef73da10c85f4118dfb3ce1505d8dff7.tar.gz
dpdk-ed2c69c3ef73da10c85f4118dfb3ce1505d8dff7.tar.xz
ethdev: introduce if_index in device info
This field is intended for pcap to describe the name of the interface as known to Linux. It is an interface index, but can be translated into an interface name using if_indextoname() function. When using pcap, interrupt affinity becomes important, and this field gives the application a chance to ensure that interrupt affinity is set to the lcore handling the device. Signed-off-by: Mats Liljegren <mats.liljegren@enea.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_ether/rte_ethdev.c1
-rw-r--r--lib/librte_ether/rte_ethdev.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 859ec92..09cc4c7 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1037,6 +1037,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)
/* Default device offload capabilities to zero */
dev_info->rx_offload_capa = 0;
dev_info->tx_offload_capa = 0;
+ dev_info->if_index = 0;
FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
(*dev->dev_ops->dev_infos_get)(dev, dev_info);
dev_info->pci_dev = dev->pci_dev;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 302d378..dd88da2 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -787,6 +787,8 @@ struct rte_eth_conf {
struct rte_eth_dev_info {
struct rte_pci_device *pci_dev; /**< Device PCI 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. */
uint32_t min_rx_bufsize; /**< Minimum size of RX buffer. */
uint32_t max_rx_pktlen; /**< Maximum configurable length of RX pkt. */
uint16_t max_rx_queues; /**< Maximum number of RX queues. */