DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Sachin Saxena (OSS)" <sachin.saxena@oss.nxp.com>
To: dev@dpdk.org, ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH v1 8/8] net/dpaa: send error packets to application
Date: Fri, 11 Sep 2020 13:29:11 +0530
Message-ID: <20200911075911.3214-9-sachin.saxena@oss.nxp.com> (raw)
In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com>

From: Nipun Gupta <nipun.gupta@nxp.com>

Send error packets to main queue (rx) to make application
enable to receive error packets.

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 10 ++++------
 drivers/net/dpaa/dpaa_rxtx.c   | 17 +++++++++++++----
 drivers/net/dpaa/dpaa_rxtx.h   | 21 +++++++++++++++++++--
 3 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 0c76fa610..d0ac2f987 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1068,7 +1068,8 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 				rxq->fqid, ret);
 		}
 	}
-
+	/* Enable main queue to receive error packets also by default */
+	fman_if_set_err_fqid(fif, rxq->fqid);
 	return 0;
 }
 
@@ -2030,13 +2031,10 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 		fman_intf->mac_addr.addr_bytes[5]);
 
 	if (!fman_intf->is_shared_mac) {
-		/* Disable RX mode */
-#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER
+		/* Configure error packet handling */
 		fman_if_receive_rx_errors(fman_intf,
 			FM_FD_RX_STATUS_ERR_MASK);
-#else
-		fman_if_discard_rx_errors(fman_intf);
-#endif
+		/* Disable RX mode */
 		fman_if_disable_rx(fman_intf);
 		/* Disable promiscuous mode */
 		fman_if_promiscuous_disable(fman_intf);
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 9715f3ce8..7aadf8b08 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -125,6 +125,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr)
 
 	DPAA_DP_LOG(DEBUG, " Parsing mbuf: %p with annotations: %p", m, annot);
 
+	m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD |
+		PKT_RX_L4_CKSUM_GOOD;
+
 	switch (prs) {
 	case DPAA_PKT_TYPE_IPV4:
 		m->packet_type = RTE_PTYPE_L2_ETHER |
@@ -199,6 +202,16 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr)
 		m->packet_type = RTE_PTYPE_L2_ETHER |
 			RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP;
 		break;
+	case DPAA_PKT_TYPE_IPV4_CSUM_ERR:
+	case DPAA_PKT_TYPE_IPV6_CSUM_ERR:
+		m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_BAD;
+		break;
+	case DPAA_PKT_TYPE_IPV4_TCP_CSUM_ERR:
+	case DPAA_PKT_TYPE_IPV6_TCP_CSUM_ERR:
+	case DPAA_PKT_TYPE_IPV4_UDP_CSUM_ERR:
+	case DPAA_PKT_TYPE_IPV6_UDP_CSUM_ERR:
+		m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_L4_CKSUM_BAD;
+		break;
 	case DPAA_PKT_TYPE_NONE:
 		m->packet_type = 0;
 		break;
@@ -213,10 +226,6 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr)
 
 	/* Set the hash values */
 	m->hash.rss = (uint32_t)(annot->hash);
-	/* All packets with Bad checksum are dropped by interface (and
-	 * corresponding notification issued to RX error queues).
-	 */
-	m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD;
 
 	/* Check if Vlan is present */
 	if (prs & DPAA_PARSE_VLAN_MASK)
diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h
index fe8eb6dc7..d9d7e04f5 100644
--- a/drivers/net/dpaa/dpaa_rxtx.h
+++ b/drivers/net/dpaa/dpaa_rxtx.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2017 NXP
+ *   Copyright 2017,2020 NXP
  *
  */
 
@@ -61,7 +61,7 @@
  *		0x8000 - Ethernet type
  *	ShimR & Logical Port ID 0x0000
  */
-#define DPAA_PARSE_MASK			0x00E044ED00800000
+#define DPAA_PARSE_MASK			0x00F044EF00800000
 #define DPAA_PARSE_VLAN_MASK		0x0000000000700000
 
 /* Parsed values (Little Endian) */
@@ -137,6 +137,23 @@
 			(0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_4_6)
 #define DPAA_PKT_TYPE_TUNNEL_6_4_TCP \
 			(0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_6_4)
+
+/* Checksum Errors */
+#define DPAA_PKT_IP_CSUM_ERR		0x0000400200000000
+#define DPAA_PKT_L4_CSUM_ERR		0x0010000000000000
+#define DPAA_PKT_TYPE_IPV4_CSUM_ERR \
+			(DPAA_PKT_IP_CSUM_ERR | DPAA_PKT_TYPE_IPV4)
+#define DPAA_PKT_TYPE_IPV6_CSUM_ERR \
+			(DPAA_PKT_IP_CSUM_ERR | DPAA_PKT_TYPE_IPV6)
+#define DPAA_PKT_TYPE_IPV4_TCP_CSUM_ERR \
+			(DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV4_TCP)
+#define DPAA_PKT_TYPE_IPV6_TCP_CSUM_ERR \
+			(DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV6_TCP)
+#define DPAA_PKT_TYPE_IPV4_UDP_CSUM_ERR \
+			(DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV4_UDP)
+#define DPAA_PKT_TYPE_IPV6_UDP_CSUM_ERR \
+			(DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV6_UDP)
+
 #define DPAA_PKT_L3_LEN_SHIFT	7
 
 /**
-- 
2.28.0


      parent reply	other threads:[~2020-09-11  8:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11  7:59 [dpdk-dev] [PATCH v1 0/8] enhancements and fixes for nxp dpaax platform Sachin Saxena (OSS)
2020-09-11  7:59 ` [dpdk-dev] [PATCH v1 1/8] bus/fslmc: fix atomic queues on nxp lx2 platform Sachin Saxena (OSS)
2020-09-11  7:59 ` [dpdk-dev] [PATCH v1 2/8] bus/fslmc: run secondary debug app without blocklist devices Sachin Saxena (OSS)
2020-09-11  7:59 ` [dpdk-dev] [PATCH v1 3/8] net/dpaa2: fix check for key size Sachin Saxena (OSS)
2020-09-11  7:59 ` [dpdk-dev] [PATCH v1 4/8] bus/dpaa: RX/TX error queues Sachin Saxena (OSS)
2020-09-11  7:59 ` [dpdk-dev] [PATCH v1 5/8] bus/fslmc: fix usage of dpio blocklist flag Sachin Saxena (OSS)
2020-09-11  7:59 ` [dpdk-dev] [PATCH v1 6/8] bus/dpaa: enhance link status support Sachin Saxena (OSS)
2020-09-11  7:59 ` [dpdk-dev] [PATCH v1 7/8] bus/dpaa: send error packets to application Sachin Saxena (OSS)
2020-09-11  7:59 ` Sachin Saxena (OSS) [this message]

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=20200911075911.3214-9-sachin.saxena@oss.nxp.com \
    --to=sachin.saxena@oss.nxp.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git