[v1] net/ice/base: backport FDIR support to 20.11

Message ID 20220825074314.16169-1-stevex.yang@intel.com (mailing list archive)
State Not Applicable, archived
Delegated to: Qi Zhang
Headers
Series [v1] net/ice/base: backport FDIR support to 20.11 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues
ci/iol-testing warning apply patch failure

Commit Message

Steve Yang Aug. 25, 2022, 7:43 a.m. UTC
  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 <stevex.yang@intel.com>
---
 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(-)
  

Patch

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,