From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx-3.enea.com (sestofw01.enea.se [192.36.1.252]) by dpdk.org (Postfix) with SMTP id 74A10DE0 for ; Thu, 9 Jan 2014 14:42:20 +0100 (CET) Received: from sestofb10.enea.se (172.21.3.145) by smtp.enea.com (172.21.1.208) with Microsoft SMTP Server id 14.3.158.1; Thu, 9 Jan 2014 14:43:32 +0100 Received: by sestofb10.enea.se (Postfix, from userid 2853) id BD15C288979; Thu, 9 Jan 2014 14:43:32 +0100 (CET) From: To: Date: Thu, 9 Jan 2014 14:42:56 +0100 Message-ID: <1389274977-53532-2-git-send-email-liljegren.mats2@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1389274977-53532-1-git-send-email-liljegren.mats2@gmail.com> References: <1389274977-53532-1-git-send-email-liljegren.mats2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: SoftFail (SESTOEX08.enea.se: domain of transitioning liljegren.mats2@gmail.com discourages use of 172.21.3.145 as permitted sender) Cc: Mats Liljegren Subject: [dpdk-dev] [PATCH v3 1/2] ethdev: Introduce if_index field to struct rte_eth_dev_info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2014 13:42:20 -0000 From: Mats Liljegren 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 --- lib/librte_ether/rte_ethdev.c | 1 + lib/librte_ether/rte_ethdev.h | 1 + 2 files changed, 2 insertions(+) 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..b4f839d 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -787,6 +787,7 @@ 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 bounded 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. */ -- 1.7.10.4