From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 052E0EE29 for ; Mon, 16 Apr 2018 15:14:40 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2018 06:14:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,459,1517904000"; d="scan'208";a="33739881" Received: from dwdohert-ws.ir.intel.com ([163.33.210.60]) by orsmga007.jf.intel.com with ESMTP; 16 Apr 2018 06:14:39 -0700 From: Declan Doherty To: dev@dpdk.org Cc: Adrien Mazarguil , Ferruh Yigit , Thomas Monjalon , Shahaf Shuler , Declan Doherty Date: Mon, 16 Apr 2018 14:06:00 +0100 Message-Id: <20180416130605.6509-5-declan.doherty@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180416130605.6509-1-declan.doherty@intel.com> References: <20180328135433.20203-1-declan.doherty@intel.com> <20180416130605.6509-1-declan.doherty@intel.com> Subject: [dpdk-dev] [PATCH v7 4/9] ethdev: Add port representor device flag X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 13:14:41 -0000 Add new device flag to specify that an ethdev port is a port representor. Extend rte_eth_dev_info structure to expose device flags to the user which enables applications to discover if a port is a representor port. Signed-off-by: Declan Doherty --- lib/librte_ether/rte_ethdev.c | 2 ++ lib/librte_ether/rte_ethdev.h | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index b16d23b9a..1d38d8e75 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2431,6 +2431,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->driver_name = dev->device->driver->name; dev_info->nb_rx_queues = dev->data->nb_rx_queues; dev_info->nb_tx_queues = dev->data->nb_tx_queues; + + dev_info->dev_flags = dev->data->dev_flags; } int diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index b5e5fc52a..0a52067d3 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1032,6 +1032,7 @@ struct rte_eth_dev_info { 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 dev_flags; /**< Device flags */ 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. */ @@ -1268,11 +1269,13 @@ struct rte_eth_dev_owner { }; /** Device supports link state interrupt */ -#define RTE_ETH_DEV_INTR_LSC 0x0002 +#define RTE_ETH_DEV_INTR_LSC 0x0002 /** Device is a bonded slave */ -#define RTE_ETH_DEV_BONDED_SLAVE 0x0004 +#define RTE_ETH_DEV_BONDED_SLAVE 0x0004 /** Device supports device removal interrupt */ -#define RTE_ETH_DEV_INTR_RMV 0x0008 +#define RTE_ETH_DEV_INTR_RMV 0x0008 +/** Device is port representor */ +#define RTE_ETH_DEV_REPRESENTOR 0x0010 /** * @warning -- 2.14.3