From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id CBF535584 for ; Mon, 14 Mar 2016 15:43:40 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 14 Mar 2016 07:43:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,335,1455004800"; d="scan'208";a="763833757" Received: from dpdk06.sh.intel.com ([10.239.128.225]) by orsmga003.jf.intel.com with ESMTP; 14 Mar 2016 07:43:38 -0700 From: Jianfeng Tan To: dev@dpdk.org Cc: helin.zhang@intel.com, konstantin.ananyev@intel.com, adrien.mazarguil@6wind.com, Jianfeng Tan Date: Mon, 14 Mar 2016 15:42:50 +0800 Message-Id: <1457941376-15852-6-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1457941376-15852-1-git-send-email-jianfeng.tan@intel.com> References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1457941376-15852-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-dev] [PATCH v8 05/11] fm10k: add dev_supported_ptypes_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: Mon, 14 Mar 2016 14:43:41 -0000 Signed-off-by: Jianfeng Tan Acked-by: Konstantin Ananyev Acked-by: Adrien Mazarguil --- drivers/net/fm10k/fm10k_ethdev.c | 50 ++++++++++++++++++++++++++++++++++++++ drivers/net/fm10k/fm10k_rxtx.c | 3 +++ drivers/net/fm10k/fm10k_rxtx_vec.c | 3 +++ 3 files changed, 56 insertions(+) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 4b07a8b..b510487 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1412,6 +1412,55 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev, }; } +#ifdef RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE +static const uint32_t * +fm10k_dev_supported_ptypes_get(struct rte_eth_dev *dev) +{ + if (dev->rx_pkt_burst == fm10k_recv_pkts || + dev->rx_pkt_burst == fm10k_recv_scattered_pkts) { + static uint32_t ptypes[] = { + /* refers to rx_desc_to_ol_flags() */ + RTE_PTYPE_L2_ETHER, + RTE_PTYPE_L3_IPV4, + RTE_PTYPE_L3_IPV4_EXT, + RTE_PTYPE_L3_IPV6, + RTE_PTYPE_L3_IPV6_EXT, + RTE_PTYPE_L4_TCP, + RTE_PTYPE_L4_UDP, + RTE_PTYPE_UNKNOWN + }; + + return ptypes; + } else if (dev->rx_pkt_burst == fm10k_recv_pkts_vec || + dev->rx_pkt_burst == fm10k_recv_scattered_pkts_vec) { + static uint32_t ptypes_vec[] = { + /* refers to fm10k_desc_to_pktype_v() */ + RTE_PTYPE_L3_IPV4, + RTE_PTYPE_L3_IPV4_EXT, + RTE_PTYPE_L3_IPV6, + RTE_PTYPE_L3_IPV6_EXT, + RTE_PTYPE_L4_TCP, + RTE_PTYPE_L4_UDP, + RTE_PTYPE_TUNNEL_GENEVE, + RTE_PTYPE_TUNNEL_NVGRE, + RTE_PTYPE_TUNNEL_VXLAN, + RTE_PTYPE_TUNNEL_GRE, + RTE_PTYPE_UNKNOWN + }; + + return ptypes_vec; + } + + return NULL; +} +#else +static const uint32_t * +fm10k_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) +{ + return NULL; +} +#endif + static int fm10k_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { @@ -2578,6 +2627,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_supported_ptypes_get = fm10k_dev_supported_ptypes_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 66db5b6..81ed4e7 100644 --- a/drivers/net/fm10k/fm10k_rxtx.c +++ b/drivers/net/fm10k/fm10k_rxtx.c @@ -65,6 +65,9 @@ static inline void dump_rxd(union fm10k_rx_desc *rxd) } #endif +/* @note: When this function is changed, make corresponding change to + * fm10k_dev_supported_ptypes_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 1c78725..f8efe8f 100644 --- a/drivers/net/fm10k/fm10k_rxtx_vec.c +++ b/drivers/net/fm10k/fm10k_rxtx_vec.c @@ -149,6 +149,9 @@ 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_supported_ptypes_get(). + */ static inline void fm10k_desc_to_pktype_v(__m128i descs[4], struct rte_mbuf **rx_pkts) { -- 2.1.4