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 4CEE3A0547; Thu, 9 Sep 2021 08:54:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98EB7410F5; Thu, 9 Sep 2021 08:54:08 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 0B980410DA for ; Thu, 9 Sep 2021 08:54:06 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="220755793" X-IronPort-AV: E=Sophos;i="5.85,279,1624345200"; d="scan'208";a="220755793" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2021 23:54:06 -0700 X-IronPort-AV: E=Sophos;i="5.85,279,1624345200"; d="scan'208";a="525255460" 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:54:04 -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:53:56 +0800 Message-Id: <20210909065356.22388-2-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20210909065356.22388-1-alvinx.zhang@intel.com> References: <20210909065356.22388-1-alvinx.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/2] net/iavf: 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/iavf/iavf_hash.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index 2b03dad..6a77378 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -342,23 +342,30 @@ struct virtchnl_proto_hdrs ipv4_ecpri_tmplt = { /* IPv4 outer */ #define IAVF_RSS_TYPE_OUTER_IPV4 (ETH_RSS_ETH | ETH_RSS_IPV4 | \ - ETH_RSS_FRAG_IPV4) + ETH_RSS_FRAG_IPV4 | \ + ETH_RSS_IPV4_CHKSUM) #define IAVF_RSS_TYPE_OUTER_IPV4_UDP (IAVF_RSS_TYPE_OUTER_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_UDP) + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_L4_CHKSUM) #define IAVF_RSS_TYPE_OUTER_IPV4_TCP (IAVF_RSS_TYPE_OUTER_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_TCP) + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_L4_CHKSUM) #define IAVF_RSS_TYPE_OUTER_IPV4_SCTP (IAVF_RSS_TYPE_OUTER_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_SCTP) + ETH_RSS_NONFRAG_IPV4_SCTP | \ + ETH_RSS_L4_CHKSUM) /* IPv6 outer */ #define IAVF_RSS_TYPE_OUTER_IPV6 (ETH_RSS_ETH | ETH_RSS_IPV6) #define IAVF_RSS_TYPE_OUTER_IPV6_FRAG (IAVF_RSS_TYPE_OUTER_IPV6 | \ ETH_RSS_FRAG_IPV6) #define IAVF_RSS_TYPE_OUTER_IPV6_UDP (IAVF_RSS_TYPE_OUTER_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_UDP) + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_L4_CHKSUM) #define IAVF_RSS_TYPE_OUTER_IPV6_TCP (IAVF_RSS_TYPE_OUTER_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_TCP) + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_L4_CHKSUM) #define IAVF_RSS_TYPE_OUTER_IPV6_SCTP (IAVF_RSS_TYPE_OUTER_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_SCTP) + ETH_RSS_NONFRAG_IPV6_SCTP | \ + ETH_RSS_L4_CHKSUM) /* VLAN IPV4 */ #define IAVF_RSS_TYPE_VLAN_IPV4 (IAVF_RSS_TYPE_OUTER_IPV4 | \ ETH_RSS_S_VLAN | ETH_RSS_C_VLAN) @@ -832,6 +839,10 @@ struct virtchnl_proto_hdrs ipv4_ecpri_tmplt = { } else { hdr->field_selector = 0; } + + if (rss_type & ETH_RSS_IPV4_CHKSUM) + REFINE_PROTO_FLD(ADD, IPV4_CHKSUM); + break; case VIRTCHNL_PROTO_HDR_IPV4_FRAG: if (rss_type & @@ -844,6 +855,10 @@ struct virtchnl_proto_hdrs ipv4_ecpri_tmplt = { } else { hdr->field_selector = 0; } + + if (rss_type & ETH_RSS_IPV4_CHKSUM) + REFINE_PROTO_FLD(ADD, IPV4_CHKSUM); + break; case VIRTCHNL_PROTO_HDR_IPV6: if (rss_type & @@ -895,6 +910,9 @@ struct virtchnl_proto_hdrs ipv4_ecpri_tmplt = { } else { hdr->field_selector = 0; } + + if (rss_type & ETH_RSS_L4_CHKSUM) + REFINE_PROTO_FLD(ADD, UDP_CHKSUM); break; case VIRTCHNL_PROTO_HDR_TCP: if (rss_type & @@ -911,6 +929,9 @@ struct virtchnl_proto_hdrs ipv4_ecpri_tmplt = { } else { hdr->field_selector = 0; } + + if (rss_type & ETH_RSS_L4_CHKSUM) + REFINE_PROTO_FLD(ADD, TCP_CHKSUM); break; case VIRTCHNL_PROTO_HDR_SCTP: if (rss_type & @@ -927,6 +948,9 @@ struct virtchnl_proto_hdrs ipv4_ecpri_tmplt = { } else { hdr->field_selector = 0; } + + if (rss_type & ETH_RSS_L4_CHKSUM) + REFINE_PROTO_FLD(ADD, SCTP_CHKSUM); break; case VIRTCHNL_PROTO_HDR_S_VLAN: if (!(rss_type & ETH_RSS_S_VLAN)) -- 1.8.3.1