From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 06978A0547; Thu, 9 Sep 2021 08:47:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C01C240041; Thu, 9 Sep 2021 08:47:49 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 23FA64003E for ; Thu, 9 Sep 2021 08:47:47 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="207814079" X-IronPort-AV: E=Sophos;i="5.85,279,1624345200"; d="scan'208";a="207814079" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2021 23:47:47 -0700 X-IronPort-AV: E=Sophos;i="5.85,279,1624345200"; d="scan'208";a="525254068" Received: from shwdenpg235.ccr.corp.intel.com ([10.253.106.22]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2021 23:47:45 -0700 From: Alvin Zhang To: qi.z.zhang@intel.com, junfeng.guo@intel.com Cc: dev@dpdk.org, Alvin Zhang Date: Thu, 9 Sep 2021 14:47:33 +0800 Message-Id: <20210909064733.19960-1-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/ice: support IPv4/L4 checksum RSS offload X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add supports for RSS_IPV4_CHKSUM & RSS_L4_CHKSUM RSS offload types in RSS flow. Signed-off-by: Alvin Zhang --- drivers/net/ice/ice_hash.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index 54d14df..3bf8027 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -374,13 +374,17 @@ struct ice_rss_hash_cfg eth_tmplt = { /* IPv4 */ #define ICE_RSS_TYPE_ETH_IPV4 (ETH_RSS_ETH | ETH_RSS_IPV4 | \ - ETH_RSS_FRAG_IPV4) + ETH_RSS_FRAG_IPV4 | \ + ETH_RSS_IPV4_CHKSUM) #define ICE_RSS_TYPE_ETH_IPV4_UDP (ICE_RSS_TYPE_ETH_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_UDP) + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_L4_CHKSUM) #define ICE_RSS_TYPE_ETH_IPV4_TCP (ICE_RSS_TYPE_ETH_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_TCP) + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_L4_CHKSUM) #define ICE_RSS_TYPE_ETH_IPV4_SCTP (ICE_RSS_TYPE_ETH_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_SCTP) + ETH_RSS_NONFRAG_IPV4_SCTP | \ + ETH_RSS_L4_CHKSUM) #define ICE_RSS_TYPE_IPV4 ETH_RSS_IPV4 #define ICE_RSS_TYPE_IPV4_UDP (ETH_RSS_IPV4 | \ ETH_RSS_NONFRAG_IPV4_UDP) @@ -394,11 +398,14 @@ struct ice_rss_hash_cfg eth_tmplt = { #define ICE_RSS_TYPE_ETH_IPV6_FRAG (ETH_RSS_ETH | ETH_RSS_IPV6 | \ ETH_RSS_FRAG_IPV6) #define ICE_RSS_TYPE_ETH_IPV6_UDP (ICE_RSS_TYPE_ETH_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_UDP) + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_L4_CHKSUM) #define ICE_RSS_TYPE_ETH_IPV6_TCP (ICE_RSS_TYPE_ETH_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_TCP) + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_L4_CHKSUM) #define ICE_RSS_TYPE_ETH_IPV6_SCTP (ICE_RSS_TYPE_ETH_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_SCTP) + ETH_RSS_NONFRAG_IPV6_SCTP | \ + ETH_RSS_L4_CHKSUM) #define ICE_RSS_TYPE_IPV6 ETH_RSS_IPV6 #define ICE_RSS_TYPE_IPV6_UDP (ETH_RSS_IPV6 | \ ETH_RSS_NONFRAG_IPV6_UDP) @@ -689,6 +696,9 @@ struct ice_rss_hash_cfg eth_tmplt = { } else { *hash_flds &= ~ICE_FLOW_HASH_IPV4; } + + if (rss_type & ETH_RSS_IPV4_CHKSUM) + *hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM); } if (*addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) { @@ -765,6 +775,9 @@ struct ice_rss_hash_cfg eth_tmplt = { } else { *hash_flds &= ~ICE_FLOW_HASH_UDP_PORT; } + + if (rss_type & ETH_RSS_L4_CHKSUM) + *hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_CHKSUM); } if (*addl_hdrs & ICE_FLOW_SEG_HDR_TCP) { @@ -782,6 +795,9 @@ struct ice_rss_hash_cfg eth_tmplt = { } else { *hash_flds &= ~ICE_FLOW_HASH_TCP_PORT; } + + if (rss_type & ETH_RSS_L4_CHKSUM) + *hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_CHKSUM); } if (*addl_hdrs & ICE_FLOW_SEG_HDR_SCTP) { @@ -799,6 +815,9 @@ struct ice_rss_hash_cfg eth_tmplt = { } else { *hash_flds &= ~ICE_FLOW_HASH_SCTP_PORT; } + + if (rss_type & ETH_RSS_L4_CHKSUM) + *hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_CHKSUM); } if (*addl_hdrs & ICE_FLOW_SEG_HDR_L2TPV3) { -- 1.8.3.1