From patchwork Thu Aug 25 07:43:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 115409 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0244A00C5; Thu, 25 Aug 2022 09:54:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9137B40DFD; Thu, 25 Aug 2022 09:54:06 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 0739840156 for ; Thu, 25 Aug 2022 09:54:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661414045; x=1692950045; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QeaU7nBycbW+uMtpHArtkO2s8vz12YId0uCA3Sm44/U=; b=G+Y7eKISc67DWRmmmf60eqIEAwAi7MRWkcaN22R16OEIVkYGbV/I/Qys NY+OJq/rOgi1krbKZuIMM1U952O2fynVuRbBUAOBVj/XgyqDuAJs2MAdK /zf9TAqXja3zNLWSxqkvxbPvS7BgWzolBKEf2ND6nclb2eEKNsJGJOYdu fvmreP9ix5igBnsCX6O5FBoRK6jf9rg1qhOZFjNZ4MHsdWIQVwICvVnbJ 8P8i4auQ0CQ4PpuRIB4dk3icen2CvbLvFs5vD99lENsb45fAhiPXpSoK9 eRndtLsSMOsOFBFG1c6C0uJKS5tZdbh5+DiomeBQ7oNFy/UBRcUn408aY Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10449"; a="273927714" X-IronPort-AV: E=Sophos;i="5.93,262,1654585200"; d="scan'208";a="273927714" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 00:53:55 -0700 X-IronPort-AV: E=Sophos;i="5.93,262,1654585200"; d="scan'208";a="670869842" Received: from intel-cd-odc-steve.cd.intel.com ([10.240.178.188]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 00:53:54 -0700 From: Steve Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, Steve Yang Subject: [PATCH v1] net/ice/base: backport FDIR support to 20.11 Date: Thu, 25 Aug 2022 07:43:14 +0000 Message-Id: <20220825074314.16169-1-stevex.yang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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 Add new protocol ID IPV6_NETX_PROTO support for FDIR and RSS, and always include proto or next header for l3 only RSS case. The feature depends on the specific ICE DDP packet. Signed-off-by: Steve Yang --- drivers/net/ice/base/ice_flow.c | 6 +++++- drivers/net/ice/base/ice_flow.h | 6 ++++-- drivers/net/ice/base/ice_protocol_type.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index c75f58659c..39acd35093 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -1100,7 +1100,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, break; case ICE_FLOW_FIELD_IDX_IPV6_TTL: case ICE_FLOW_FIELD_IDX_IPV6_PROT: - prot_id = seg == 0 ? ICE_PROT_IPV6_OF_OR_S : ICE_PROT_IPV6_IL; + prot_id = seg == 0 ? ICE_PROT_IPV6_NEXT_PROTO : ICE_PROT_IPV6_IL; /* TTL and PROT share the same extraction seq. entry. * Each is considered a sibling to the other in terms of sharing @@ -1207,6 +1207,10 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, flds[fld].xtrct.idx = params->es_cnt; flds[fld].xtrct.mask = ice_flds_info[fld].mask; + if (prot_id == ICE_PROT_IPV6_NEXT_PROTO) { + flds[fld].xtrct.off = 0; + flds[fld].xtrct.disp = 0; + } /* Adjust the next field-entry index after accommodating the number of * entries this field consumes */ diff --git a/drivers/net/ice/base/ice_flow.h b/drivers/net/ice/base/ice_flow.h index 2a9ae66454..6c8644db1c 100644 --- a/drivers/net/ice/base/ice_flow.h +++ b/drivers/net/ice/base/ice_flow.h @@ -22,10 +22,12 @@ BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_SA)) #define ICE_FLOW_HASH_IPV4 \ (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | \ - BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)) + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) | \ + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)) #define ICE_FLOW_HASH_IPV6 \ (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA) | \ - BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)) + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA) | \ + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PROT)) #define ICE_FLOW_HASH_IPV6_PRE32 \ (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA) | \ BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA)) diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h index 8e0557b212..4935938f76 100644 --- a/drivers/net/ice/base/ice_protocol_type.h +++ b/drivers/net/ice/base/ice_protocol_type.h @@ -138,6 +138,7 @@ enum ice_prot_id { ICE_PROT_IPV4_IL = 33, ICE_PROT_IPV6_OF_OR_S = 40, ICE_PROT_IPV6_IL = 41, + ICE_PROT_IPV6_NEXT_PROTO = 43, ICE_PROT_IPV6_FRAG = 47, ICE_PROT_TCP_IL = 49, ICE_PROT_UDP_OF = 52,