From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9A42E9190 for ; Fri, 15 Jan 2016 13:46:27 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 15 Jan 2016 04:46:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,299,1449561600"; d="scan'208";a="891104761" Received: from dpdk06.sh.intel.com ([10.239.128.225]) by orsmga002.jf.intel.com with ESMTP; 15 Jan 2016 04:46:26 -0800 From: Jianfeng Tan To: dev@dpdk.org Date: Fri, 15 Jan 2016 13:45:53 +0800 Message-Id: <1452836759-63540-7-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452836759-63540-1-git-send-email-jianfeng.tan@intel.com> References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1452836759-63540-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-dev] [PATCH v2 06/12] pmd/i40e: add dev_ptype_info_get implementation 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: Fri, 15 Jan 2016 12:46:28 -0000 Signed-off-by: Jianfeng Tan --- drivers/net/i40e/i40e_ethdev.c | 1 + drivers/net/i40e/i40e_ethdev_vf.c | 1 + drivers/net/i40e/i40e_rxtx.c | 46 ++++++++++++++++++++++++++++++++++++++- drivers/net/i40e/i40e_rxtx.h | 1 + 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index bf6220d..1f5251b 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -439,6 +439,7 @@ static const struct eth_dev_ops i40e_eth_dev_ops = { .xstats_reset = i40e_dev_stats_reset, .queue_stats_mapping_set = i40e_dev_queue_stats_mapping_set, .dev_infos_get = i40e_dev_info_get, + .dev_ptype_info_get = i40e_dev_ptype_info_get, .vlan_filter_set = i40e_vlan_filter_set, .vlan_tpid_set = i40e_vlan_tpid_set, .vlan_offload_set = i40e_vlan_offload_set, diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 14d2a50..5d924de 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -196,6 +196,7 @@ static const struct eth_dev_ops i40evf_eth_dev_ops = { .xstats_reset = i40evf_dev_xstats_reset, .dev_close = i40evf_dev_close, .dev_infos_get = i40evf_dev_info_get, + .dev_ptype_info_get = i40e_dev_ptype_info_get, .vlan_filter_set = i40evf_vlan_filter_set, .vlan_offload_set = i40evf_vlan_offload_set, .vlan_pvid_set = i40evf_vlan_pvid_set, diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 39d94ec..15916e2 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -194,7 +194,11 @@ i40e_get_iee15888_flags(struct rte_mbuf *mb, uint64_t qword) } #endif -/* For each value it means, datasheet of hardware can tell more details */ +/* + * For each value it means, datasheet of hardware can tell more details + * + * @note: fix i40e_dev_ptype_info_get() if any change here. + */ static inline uint32_t i40e_rxd_pkt_type_mapping(uint8_t ptype) { @@ -2094,6 +2098,46 @@ i40e_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) } int +i40e_dev_ptype_info_get(struct rte_eth_dev *dev, uint32_t ptypes[]) +{ + int num = 0; + + if (dev->rx_pkt_burst == i40e_recv_pkts || +#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC + dev->rx_pkt_burst == i40e_recv_pkts_bulk_alloc || +#endif + dev->rx_pkt_burst == i40e_recv_scattered_pkts) { + /* refers to i40e_rxd_pkt_type_mapping() */ + ptypes[num++] = RTE_PTYPE_L2_ETHER; + ptypes[num++] = RTE_PTYPE_L2_ETHER_TIMESYNC; + ptypes[num++] = RTE_PTYPE_L2_ETHER_LLDP; + ptypes[num++] = RTE_PTYPE_L2_ETHER_ARP; + ptypes[num++] = RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; + ptypes[num++] = RTE_PTYPE_L3_IPV6_EXT_UNKNOWN; + ptypes[num++] = RTE_PTYPE_L4_FRAG; + ptypes[num++] = RTE_PTYPE_L4_ICMP; + ptypes[num++] = RTE_PTYPE_L4_NONFRAG; + ptypes[num++] = RTE_PTYPE_L4_SCTP; + ptypes[num++] = RTE_PTYPE_L4_TCP; + ptypes[num++] = RTE_PTYPE_L4_UDP; + ptypes[num++] = RTE_PTYPE_TUNNEL_GRENAT; + ptypes[num++] = RTE_PTYPE_TUNNEL_IP; + ptypes[num++] = RTE_PTYPE_INNER_L2_ETHER; + ptypes[num++] = RTE_PTYPE_INNER_L2_ETHER_VLAN; + ptypes[num++] = RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN; + ptypes[num++] = RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN; + ptypes[num++] = RTE_PTYPE_INNER_L4_FRAG; + ptypes[num++] = RTE_PTYPE_INNER_L4_ICMP; + ptypes[num++] = RTE_PTYPE_INNER_L4_NONFRAG; + ptypes[num++] = RTE_PTYPE_INNER_L4_SCTP; + ptypes[num++] = RTE_PTYPE_INNER_L4_TCP; + ptypes[num++] = RTE_PTYPE_INNER_L4_UDP; + } + + return num; +} + +int i40e_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h index 5c2f5c2..5bb34a5 100644 --- a/drivers/net/i40e/i40e_rxtx.h +++ b/drivers/net/i40e/i40e_rxtx.h @@ -200,6 +200,7 @@ int i40e_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id); int i40e_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id); int i40e_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id); int i40e_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); +int i40e_dev_ptype_info_get(struct rte_eth_dev *dev, uint32_t ptypes[]); int i40e_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, -- 2.1.4