DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH 11/12] net/hns3: add supported ptypes list for RXD advanced layout
Date: Tue, 13 Apr 2021 19:50:10 +0800	[thread overview]
Message-ID: <1618314611-47978-12-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1618314611-47978-1-git-send-email-humin29@huawei.com>

From: Chengwen Feng <fengchengwen@huawei.com>

Kunpeng 930 supports RXD advanced layout. If enabled the layout, the
hardware will report packet type by 8-bit PTYPE filed in the Rx
descriptor, and the supported ptypes are different from original
scheme. So this patch adds supported list for RXD advanced layout.

Fixes: fb5e90694022 ("net/hns3: support Rx descriptor advanced layout")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index c524d5a..59fb974 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1991,12 +1991,45 @@ hns3_dev_supported_ptypes_get(struct rte_eth_dev *dev)
 		RTE_PTYPE_TUNNEL_NVGRE,
 		RTE_PTYPE_UNKNOWN
 	};
+	static const uint32_t adv_layout_ptypes[] = {
+		RTE_PTYPE_L2_ETHER,
+		RTE_PTYPE_L2_ETHER_TIMESYNC,
+		RTE_PTYPE_L2_ETHER_LLDP,
+		RTE_PTYPE_L2_ETHER_ARP,
+		RTE_PTYPE_L3_IPV4_EXT_UNKNOWN,
+		RTE_PTYPE_L3_IPV6_EXT_UNKNOWN,
+		RTE_PTYPE_L4_FRAG,
+		RTE_PTYPE_L4_NONFRAG,
+		RTE_PTYPE_L4_UDP,
+		RTE_PTYPE_L4_TCP,
+		RTE_PTYPE_L4_SCTP,
+		RTE_PTYPE_L4_IGMP,
+		RTE_PTYPE_L4_ICMP,
+		RTE_PTYPE_TUNNEL_GRE,
+		RTE_PTYPE_TUNNEL_GRENAT,
+		RTE_PTYPE_INNER_L2_ETHER,
+		RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN,
+		RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN,
+		RTE_PTYPE_INNER_L4_FRAG,
+		RTE_PTYPE_INNER_L4_ICMP,
+		RTE_PTYPE_INNER_L4_NONFRAG,
+		RTE_PTYPE_INNER_L4_UDP,
+		RTE_PTYPE_INNER_L4_TCP,
+		RTE_PTYPE_INNER_L4_SCTP,
+		RTE_PTYPE_INNER_L4_ICMP,
+		RTE_PTYPE_UNKNOWN
+	};
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	if (dev->rx_pkt_burst == hns3_recv_pkts_simple ||
 	    dev->rx_pkt_burst == hns3_recv_scattered_pkts ||
 	    dev->rx_pkt_burst == hns3_recv_pkts_vec ||
-	    dev->rx_pkt_burst == hns3_recv_pkts_vec_sve)
-		return ptypes;
+	    dev->rx_pkt_burst == hns3_recv_pkts_vec_sve) {
+		if (hns3_dev_rxd_adv_layout_supported(hw))
+			return adv_layout_ptypes;
+		else
+			return ptypes;
+	}
 
 	return NULL;
 }
-- 
2.7.4


  parent reply	other threads:[~2021-04-13 11:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 11:49 [dpdk-dev] [PATCH 00/12] Bugfix for hns3 PMD Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 01/12] net/hns3: delete mailbox arq ring Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 02/12] net/hns3: fix possible mismatches response of mailbox Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 03/12] net/hns3: fix VF may report LSC event in secondary process Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 04/12] net/hns3: fix potentially incorrect timing in MBX Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 05/12] net/hns3: fix incorrect use of CMD status enumeration type Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 06/12] net/hns3: fix miss verification of whether NEON supported Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 07/12] net/hns3: fix missing outer L4 UDP flag for VXLAN packet Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 08/12] net/hns3: add reporting TUNNEL GRE packet type Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 09/12] net/hns3: fix PTP caps report Min Hu (Connor)
2021-04-13 11:50 ` [dpdk-dev] [PATCH 10/12] net/hns3: rename Rx burst API Min Hu (Connor)
2021-04-14 17:41   ` Ferruh Yigit
2021-04-15  1:58     ` Min Hu (Connor)
2021-04-15  7:27       ` Ferruh Yigit
2021-04-15  1:51   ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
2021-04-15  8:35   ` [dpdk-dev] [PATCH v3] " Min Hu (Connor)
2021-04-15 13:12     ` Ferruh Yigit
2021-04-13 11:50 ` Min Hu (Connor) [this message]
2021-04-13 11:50 ` [dpdk-dev] [PATCH 12/12] net/hns3: remove VLAN/QINQ ptypes from support list Min Hu (Connor)
2021-04-14 17:47 ` [dpdk-dev] [PATCH 00/12] Bugfix for hns3 PMD Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1618314611-47978-12-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).