From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 58F0B1B4C5 for ; Fri, 15 Feb 2019 19:13:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2019 10:13:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,373,1544515200"; d="scan'208";a="122749704" Received: from dpdk-srv1.jf.intel.com ([10.166.17.53]) by fmsmga007.fm.intel.com with ESMTP; 15 Feb 2019 10:13:23 -0800 From: Paul M Stillwell Jr To: qi.z.zhang@intel.com Cc: dev@dpdk.org, Jesse Brandeburg , Paul M Stillwell Jr Date: Fri, 15 Feb 2019 10:13:21 -0800 Message-Id: <1550254401-251489-1-git-send-email-paul.m.stillwell.jr@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH v3] net/ice: faster bit check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2019 18:13:24 -0000 From: Jesse Brandeburg Implement a slightly faster bit check, used for checking descriptors in the hot path. Signed-off-by: Jesse Brandeburg Signed-off-by: Paul M Stillwell Jr --- 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