DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: dev@dpdk.org
Cc: Andy Moreton <amoreton@xilinx.com>, Ivan Malov <ivan.malov@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH] net/sfc: fix mark support in EF100 native Rx datapath
Date: Wed, 28 Apr 2021 17:17:02 +0300	[thread overview]
Message-ID: <20210428141702.2172676-1-andrew.rybchenko@oktetlabs.ru> (raw)

Decouple user mark from user flag. Usage of mark does not require to
use flag as well. Flag is not actually supported yet.

Fixes: 1aacc3d388d3 ("net/sfc: support user mark and flag Rx for EF100")
Cc: stabledpdk.org

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
---
 drivers/net/sfc/sfc_ef100_rx.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/net/sfc/sfc_ef100_rx.c b/drivers/net/sfc/sfc_ef100_rx.c
index 07b37ff47f..8cde24c585 100644
--- a/drivers/net/sfc/sfc_ef100_rx.c
+++ b/drivers/net/sfc/sfc_ef100_rx.c
@@ -46,6 +46,9 @@
 	((_ndesc) - 1 /* head must not step on tail */ - \
 	 1 /* Rx error */ - 1 /* flush */)
 
+/** Invalid user mark value when the mark should be treated as unset */
+#define SFC_EF100_USER_MARK_INVALID	0
+
 struct sfc_ef100_rx_sw_desc {
 	struct rte_mbuf			*mbuf;
 };
@@ -365,7 +368,6 @@ static const efx_rx_prefix_layout_t sfc_ef100_rx_prefix_layout = {
 
 		SFC_EF100_RX_PREFIX_FIELD(LENGTH, B_FALSE),
 		SFC_EF100_RX_PREFIX_FIELD(RSS_HASH_VALID, B_FALSE),
-		SFC_EF100_RX_PREFIX_FIELD(USER_FLAG, B_FALSE),
 		SFC_EF100_RX_PREFIX_FIELD(CLASS, B_FALSE),
 		SFC_EF100_RX_PREFIX_FIELD(RSS_HASH, B_FALSE),
 		SFC_EF100_RX_PREFIX_FIELD(USER_MARK, B_FALSE),
@@ -404,12 +406,16 @@ sfc_ef100_rx_prefix_to_offloads(const struct sfc_ef100_rxq *rxq,
 					      ESF_GZ_RX_PREFIX_RSS_HASH);
 	}
 
-	if ((rxq->flags & SFC_EF100_RXQ_USER_MARK) &&
-	    EFX_TEST_OWORD_BIT(rx_prefix[0], ESF_GZ_RX_PREFIX_USER_FLAG_LBN)) {
-		ol_flags |= PKT_RX_FDIR_ID;
+	if (rxq->flags & SFC_EF100_RXQ_USER_MARK) {
+		uint32_t user_mark;
+
 		/* EFX_OWORD_FIELD converts little-endian to CPU */
-		m->hash.fdir.hi = EFX_OWORD_FIELD(rx_prefix[0],
-						  ESF_GZ_RX_PREFIX_USER_MARK);
+		user_mark = EFX_OWORD_FIELD(rx_prefix[0],
+					    ESF_GZ_RX_PREFIX_USER_MARK);
+		if (user_mark != SFC_EF100_USER_MARK_INVALID) {
+			ol_flags |= PKT_RX_FDIR_ID;
+			m->hash.fdir.hi = user_mark;
+		}
 	}
 
 	m->ol_flags = ol_flags;
@@ -794,8 +800,7 @@ sfc_ef100_rx_qstart(struct sfc_dp_rxq *dp_rxq, unsigned int evq_read_ptr,
 		rxq->flags &= ~SFC_EF100_RXQ_RSS_HASH;
 
 	if ((unsup_rx_prefix_fields &
-	     ((1U << EFX_RX_PREFIX_FIELD_USER_FLAG) |
-	      (1U << EFX_RX_PREFIX_FIELD_USER_MARK))) == 0)
+	     (1U << EFX_RX_PREFIX_FIELD_USER_MARK)) == 0)
 		rxq->flags |= SFC_EF100_RXQ_USER_MARK;
 	else
 		rxq->flags &= ~SFC_EF100_RXQ_USER_MARK;
-- 
2.30.2


             reply	other threads:[~2021-04-28 14:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 14:17 Andrew Rybchenko [this message]
2021-04-30 16:07 ` 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=20210428141702.2172676-1-andrew.rybchenko@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=amoreton@xilinx.com \
    --cc=dev@dpdk.org \
    --cc=ivan.malov@oktetlabs.ru \
    /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).