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 F26D44404F; Wed, 12 Jun 2024 17:04:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDC3F40ECF; Wed, 12 Jun 2024 17:03:32 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 1D72D40E2E for ; Wed, 12 Jun 2024 17:03:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204609; x=1749740609; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YBiDq08ycUsa9qv7SOkpOaxAhumXyBzlIJu0h9GPPdk=; b=gf9zZsAmogmBcG3Pnz+iC7sZu1s9ndwUz6YcO06LyhGFiBRRpdcE/e7Q /5PAQ0buD1w/vx6IQiTgWYU1Hy9F3GgGu3YWHz3wpL7T418eWmHF+jYxp 8N0Qc+oP+FPxlPS25QxVch+SCFk1AT/WXeWGivZnxPoSAQjvb/4vp995n 6h0aBVdDhlKVM4uDeO0ReYJDFq2eVh1NIxdQJsQCg3vbYunDnISRmDu2K hXQl9s6e52abQS59svjyInu0kOIzIubP/xJFW8R3XDNUtPUoeP0nFd48L zhwaqm5uAslKf53uNIVlU017buZCYFOKcasWehFncWbRPXpO2KDr3mgx2 w==; X-CSE-ConnectionGUID: cnUhTxQuT0KrakpPJ1dGOg== X-CSE-MsgGUID: HYpuBzJuT5GPcM25A1wTdg== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459103" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459103" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:03:27 -0700 X-CSE-ConnectionGUID: ghyVUz6dQtS0UT4KjHPnXA== X-CSE-MsgGUID: jicWd7WfTR6a69cLuSe+MQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39924844" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:03:26 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Zhirun Yan Subject: [PATCH v2 007/148] net/ice/base: add ability to set markid via switch filter Date: Wed, 12 Jun 2024 16:00:01 +0100 Message-ID: <2a25505ba10e07514f8179436ffddb2ef08cf9ed.1718204528.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> 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: Ian Stokes 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 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; -- 2.43.0