[v2,007/148] net/ice/base: add ability to set markid via switch filter

Message ID 2a25505ba10e07514f8179436ffddb2ef08cf9ed.1718204528.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers
Series Update net/ice base driver to latest upstream snapshot |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Burakov, Anatoly June 12, 2024, 3 p.m. UTC
From: Ian Stokes <ian.stokes@intel.com>

Support to add large action to set 32 bits markid via switch filter.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 22 ++++++++++++----------
 drivers/net/ice/base/ice_switch.h | 24 ++++++++++++------------
 2 files changed, 24 insertions(+), 22 deletions(-)
  

Patch

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 8d32c96fe3..0c13b12faa 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -9333,9 +9333,10 @@  ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 		 struct ice_rule_query_data *added_entry)
 {
 	struct ice_adv_fltr_mgmt_list_entry *m_entry, *adv_fltr = NULL;
-	u16 lg_act_size, lg_act_id = ICE_INVAL_LG_ACT_INDEX;
+	u16 lg_act_sz, lg_act_id = ICE_INVAL_LG_ACT_INDEX;
 	u16 rid = 0, i, pkt_len, rule_buf_sz, vsi_handle;
 	const struct ice_dummy_pkt_offsets *pkt_offsets;
+	struct ice_aqc_sw_rules_elem *lg_rule = NULL;
 	struct ice_aqc_sw_rules_elem *s_rule = NULL;
 	struct ice_aqc_sw_rules_elem *rx_tx;
 	struct LIST_HEAD_TYPE *rule_head;
@@ -9457,7 +9458,7 @@  ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 		       ICE_SINGLE_ACT_Q_REGION_M;
 		break;
 	case ICE_SET_MARK:
-		if (rinfo->sw_act.markid != (rinfo->sw_act.markid & 0xFFFF))
+		if (rinfo->sw_act.markid > 0xFFFF)
 			nb_lg_acts_mark += 1;
 		/* Allocate a hardware table entry to hold large act. */
 		status = ice_alloc_res_lg_act(hw, &lg_act_id, nb_lg_acts_mark);
@@ -9521,18 +9522,19 @@  ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 
 	rx_tx = s_rule;
 	if (rinfo->sw_act.fltr_act == ICE_SET_MARK) {
-		lg_act_size = (u16)ICE_SW_RULE_LG_ACT_SIZE(nb_lg_acts_mark);
-		s_rule = ice_fill_sw_marker_lg_act(hw, rinfo->sw_act.markid,
-						   lg_act_id, rule_buf_sz,
-						   lg_act_size, nb_lg_acts_mark,
-						   s_rule);
-		if (!s_rule)
+		lg_act_sz = (u16)ICE_SW_RULE_LG_ACT_SIZE(nb_lg_acts_mark);
+		lg_rule = ice_fill_sw_marker_lg_act(hw, rinfo->sw_act.markid,
+						    lg_act_id, rule_buf_sz,
+						    lg_act_sz, nb_lg_acts_mark,
+						    s_rule);
+		if (!lg_rule)
 			goto err_ice_add_adv_rule;
 
-		rule_buf_sz += lg_act_size;
+		s_rule = lg_rule;
+		rule_buf_sz += lg_act_sz;
 		num_rules += 1;
 		rx_tx = (struct ice_aqc_sw_rules_elem *)
-			((u8 *)s_rule + lg_act_size);
+			((u8 *)s_rule + lg_act_sz);
 	}
 
 	status = ice_aq_sw_rules(hw, (struct ice_aqc_sw_rules *)s_rule,
diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h
index e3ba837467..0cf86ec965 100644
--- a/drivers/net/ice/base/ice_switch.h
+++ b/drivers/net/ice/base/ice_switch.h
@@ -219,19 +219,19 @@  struct ice_adv_lkup_elem {
 	union ice_prot_hdr m_u;	/* Mask of header values to match */
 };
 
-struct lg_entry_vsi_fwd {
+struct entry_vsi_fwd {
 	u16 vsi_list;
 	u8 list;
 	u8 valid;
 };
 
-struct lg_entry_to_q {
+struct entry_to_q {
 	u16 q_idx;
 	u8 q_region_sz;
 	u8 q_pri;
 };
 
-struct lg_entry_prune {
+struct entry_prune {
 	u16 vsi_list;
 	u8 list;
 	u8 egr;
@@ -239,27 +239,27 @@  struct lg_entry_prune {
 	u8 prune_t;
 };
 
-struct lg_entry_mirror {
+struct entry_mirror {
 	u16 mirror_vsi;
 };
 
-struct lg_entry_generic_act {
+struct entry_generic_act {
 	u16 generic_value;
 	u8 offset;
 	u8 priority;
 };
 
-struct lg_entry_statistics {
+struct entry_statistics {
 	u8 counter_idx;
 };
 
 union lg_act_entry {
-	struct lg_entry_vsi_fwd vsi_fwd;
-	struct lg_entry_to_q to_q;
-	struct lg_entry_prune prune;
-	struct lg_entry_mirror mirror;
-	struct lg_entry_generic_act generic_act;
-	struct lg_entry_statistics statistics;
+	struct entry_vsi_fwd vsi_fwd;
+	struct entry_to_q to_q;
+	struct entry_prune prune;
+	struct entry_mirror mirror;
+	struct entry_generic_act generic_act;
+	struct entry_statistics statistics;
 };
 struct ice_prof_type_entry {
 	u16 prof_id;