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 C55BB9190 for ; Fri, 15 Jan 2016 13:46:26 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 15 Jan 2016 04:46:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,299,1449561600"; d="scan'208";a="891104746" Received: from dpdk06.sh.intel.com ([10.239.128.225]) by orsmga002.jf.intel.com with ESMTP; 15 Jan 2016 04:46:25 -0800 From: Jianfeng Tan To: dev@dpdk.org Date: Fri, 15 Jan 2016 13:45:52 +0800 Message-Id: <1452836759-63540-6-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 05/12] pmd/fm10k: 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:27 -0000 Signed-off-by: Jianfeng Tan --- drivers/net/fm10k/fm10k_ethdev.c | 43 ++++++++++++++++++++++++++++++++++++++ drivers/net/fm10k/fm10k_rxtx.c | 5 +++++ drivers/net/fm10k/fm10k_rxtx_vec.c | 5 +++++ 3 files changed, 53 insertions(+) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index e4aed94..e155cb5 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1335,6 +1335,48 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev, }; } +#ifdef RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE +static int +fm10k_dev_ptype_info_get(struct rte_eth_dev *dev, uint32_t ptypes[]) +{ + int num = 0; + + if (dev->rx_pkt_burst == fm10k_recv_pkts || + dev->rx_pkt_burst == fm10k_recv_scattered_pkts) { + /* refers to rx_desc_to_ol_flags() */ + ptypes[num++] = RTE_PTYPE_L2_ETHER; + ptypes[num++] = RTE_PTYPE_L3_IPV4; + ptypes[num++] = RTE_PTYPE_L3_IPV4_EXT; + ptypes[num++] = RTE_PTYPE_L3_IPV6; + ptypes[num++] = RTE_PTYPE_L3_IPV6_EXT; + ptypes[num++] = RTE_PTYPE_L4_TCP; + ptypes[num++] = RTE_PTYPE_L4_UDP; + } else if (dev->rx_pkt_burst == fm10k_recv_pkts_vec || + dev->rx_pkt_burst == fm10k_recv_scattered_pkts_vec) { + /* refers to fm10k_desc_to_pktype_v() */ + ptypes[num++] = RTE_PTYPE_L3_IPV4; + ptypes[num++] = RTE_PTYPE_L3_IPV4_EXT; + ptypes[num++] = RTE_PTYPE_L3_IPV6; + ptypes[num++] = RTE_PTYPE_L3_IPV6_EXT; + ptypes[num++] = RTE_PTYPE_L4_TCP; + ptypes[num++] = RTE_PTYPE_L4_UDP; + ptypes[num++] = RTE_PTYPE_TUNNEL_GENEVE; + ptypes[num++] = RTE_PTYPE_TUNNEL_NVGRE; + ptypes[num++] = RTE_PTYPE_TUNNEL_VXLAN; + ptypes[num++] = RTE_PTYPE_TUNNEL_GRE; + } + + return num; +} +#else +static int +fm10k_dev_ptype_info_get(struct rte_eth_dev *dev __rte_unused, + uint32_t ptypes[] __rte_unused) +{ + return -ENOTSUP; +} +#endif + static int fm10k_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { @@ -2423,6 +2465,7 @@ static const struct eth_dev_ops fm10k_eth_dev_ops = { .xstats_reset = fm10k_stats_reset, .link_update = fm10k_link_update, .dev_infos_get = fm10k_dev_infos_get, + .dev_ptype_info_get = fm10k_dev_ptype_info_get, .vlan_filter_set = fm10k_vlan_filter_set, .vlan_offload_set = fm10k_vlan_offload_set, .mac_addr_add = fm10k_macaddr_add, diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c index e958865..9b2d6f2 100644 --- a/drivers/net/fm10k/fm10k_rxtx.c +++ b/drivers/net/fm10k/fm10k_rxtx.c @@ -65,6 +65,11 @@ static inline void dump_rxd(union fm10k_rx_desc *rxd) } #endif +/* + * @note + * When this function is changed, make corresponding change to + * fm10k_dev_ptype_info_get() + */ static inline void rx_desc_to_ol_flags(struct rte_mbuf *m, const union fm10k_rx_desc *d) { diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c index 2a57eef..6fc22fc 100644 --- a/drivers/net/fm10k/fm10k_rxtx_vec.c +++ b/drivers/net/fm10k/fm10k_rxtx_vec.c @@ -109,6 +109,11 @@ fm10k_desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts) rx_pkts[3]->ol_flags = vol.e[3]; } +/* + * @note + * When this function is changed, make corresponding change to + * fm10k_dev_ptype_info_get() + */ static inline void fm10k_desc_to_pktype_v(__m128i descs[4], struct rte_mbuf **rx_pkts) { -- 2.1.4