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 D56C0454EF; Tue, 25 Jun 2024 13:16:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 781BE427CB; Tue, 25 Jun 2024 13:15:35 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 939FE402C4 for ; Tue, 25 Jun 2024 13:15:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314111; x=1750850111; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zfyZv4JJNnCh0/1fdli/T/f11IbfW9BdrGRI6FybcsQ=; b=Xb1Zp3zCHuBhLtW654bwfLvON9MiN+0wkPAtW3KzquxJ4vtSxAojSxcj 8HTmV07JcVOeMx3XYf8NJroyJkIxiDTuY5KdOuzLkt3gC9DesWwn4aBFk Zi8EEQO13CUBKkauP1ve+kPYzxh7IpX6lwr+WZ9GXXeqbfl6h+ZAjQ/0O evTs0N6roj1Mt6NNl33MQZnQ7mSAyuTdzOMRuUYgaWY0E6W2GOR2Ocy6E WzbsK/Mwju2fkfPFujAIQ3TrSJS4lOSMmHIS+eDe2b6ViR1dLpD3W/U0i uoJvpGTHtFb5QNTDrqZc93bcMKlVLRdeAtFKSwJ6oGDoXdzoHIO//cQOX Q==; X-CSE-ConnectionGUID: 3hrid9fVRTOaYY8WxGQ6cQ== X-CSE-MsgGUID: 5pyvMQ1eTvS4avlxNKWCOg== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080071" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080071" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:15:11 -0700 X-CSE-ConnectionGUID: sPNFNPT7QMSFrcO5kDJ/7A== X-CSE-MsgGUID: 13/VIpItSe2xurkzsymTew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43718885" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:15:10 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Zhirun Yan , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 007/129] net/ice/base: add ability to set markid via switch filter Date: Tue, 25 Jun 2024 12:12:12 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Zhirun Yan Support to add large action to set 32 bits markid via switch filter. Signed-off-by: Zhirun Yan Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_switch.c | 22 ++++++++++++---------- drivers/net/ice/base/ice_switch.h | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 489678c85b..bd30ce137a 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; -- 2.43.0