DPDK patches and discussions
 help / color / mirror / Atom feed
From: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
To: qi.z.zhang@intel.com
Cc: dev@dpdk.org, Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Subject: [dpdk-dev] [PATCH v3] net/ice: faster bit check
Date: Fri, 15 Feb 2019 10:13:21 -0800	[thread overview]
Message-ID: <1550254401-251489-1-git-send-email-paul.m.stillwell.jr@intel.com> (raw)

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

Implement a slightly faster bit check, used for checking
descriptors in the hot path.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
---
v3: really fix checkpatch issues
v2: fixed checkpatch issues
---
 drivers/net/ice/ice_rxtx.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index c794ee8..c01fdaf 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -955,14 +955,13 @@
 static inline uint64_t
 ice_rxd_status_to_pkt_flags(uint64_t qword)
 {
-	uint64_t flags;
-
+	static const uint64_t bitcheck =
+		(ICE_RX_DESC_FLTSTAT_RSS_HASH << ICE_RX_DESC_STATUS_FLTSTAT_S);
 	/* Check if RSS_HASH */
-	flags = (((qword >> ICE_RX_DESC_STATUS_FLTSTAT_S) &
-		  ICE_RX_DESC_FLTSTAT_RSS_HASH) ==
-		 ICE_RX_DESC_FLTSTAT_RSS_HASH) ? PKT_RX_RSS_HASH : 0;
+	if ((qword & bitcheck) == bitcheck)
+		return PKT_RX_RSS_HASH;
 
-	return flags;
+	return 0;
 }
 
 /* Rx L3/L4 checksum */
-- 
1.8.3.1

             reply	other threads:[~2019-02-15 18:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 18:13 Paul M Stillwell Jr [this message]
2019-02-18 12:46 ` Zhang, Qi Z
2019-02-28  2:04   ` Zhang, Qi Z

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=1550254401-251489-1-git-send-email-paul.m.stillwell.jr@intel.com \
    --to=paul.m.stillwell.jr@intel.com \
    --cc=dev@dpdk.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=qi.z.zhang@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).