[v3] net/ice: faster bit check

Message ID 1550254401-251489-1-git-send-email-paul.m.stillwell.jr@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Qi Zhang
Headers
Series [v3] net/ice: faster bit check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Stillwell Jr, Paul M Feb. 15, 2019, 6:13 p.m. UTC
  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(-)
  

Comments

Qi Zhang Feb. 18, 2019, 12:46 p.m. UTC | #1
> -----Original Message-----
> From: Stillwell Jr, Paul M
> Sent: Saturday, February 16, 2019 2:13 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Brandeburg, Jesse <jesse.brandeburg@intel.com>; Stillwell Jr,
> Paul M <paul.m.stillwell.jr@intel.com>
> Subject: [PATCH v3] net/ice: faster bit check
> 
> 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>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  
Qi Zhang Feb. 28, 2019, 2:04 a.m. UTC | #2
> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Monday, February 18, 2019 8:47 PM
> To: Stillwell Jr, Paul M <paul.m.stillwell.jr@intel.com>
> Cc: dev@dpdk.org; Brandeburg, Jesse <jesse.brandeburg@intel.com>
> Subject: RE: [PATCH v3] net/ice: faster bit check
> 
> 
> 
> > -----Original Message-----
> > From: Stillwell Jr, Paul M
> > Sent: Saturday, February 16, 2019 2:13 AM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org; Brandeburg, Jesse <jesse.brandeburg@intel.com>;
> > Stillwell Jr, Paul M <paul.m.stillwell.jr@intel.com>
> > Subject: [PATCH v3] net/ice: faster bit check
> >
> > 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>
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>

The patch is decided to be dropped based on Jesse and Harry's further investigation on the assembly code that compiler generated.
It is removed from dpdk-next-net-intel.

Regards.
Qi
  

Patch

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 */