DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: qiming.yang@intel.com
Cc: junfeng.guo@intel.com, dev@dpdk.org,
	Qi Zhang <qi.z.zhang@intel.com>,
	Wojciech Drewek <wojciech.drewek@intel.com>
Subject: [dpdk-dev] [PATCH 04/12] net/ice/base: allow to enable LAN and loopback in switch
Date: Thu, 16 Sep 2021 17:52:56 +0800	[thread overview]
Message-ID: <20210916095304.3058210-5-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20210916095304.3058210-1-qi.z.zhang@intel.com>

Currently shared code API oes not allow to set/unset lb_en
and lan_en flags for advanced rules during their creation.
Because of that we have to use a workaround in switchdev
which is to update rule immediately after its creation.
This change will allow us to set/unset those flags right
away.

Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_switch.c |  7 ++++++-
 drivers/net/ice/base/ice_switch.h | 11 +++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 93cd79e8ef..b945e1499d 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -8750,7 +8750,12 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 	s_rule = (struct ice_aqc_sw_rules_elem *)ice_malloc(hw, rule_buf_sz);
 	if (!s_rule)
 		return ICE_ERR_NO_MEMORY;
-	act |= ICE_SINGLE_ACT_LAN_ENABLE;
+	if (!rinfo->flags_info.act_valid)
+		act |= ICE_SINGLE_ACT_LAN_ENABLE;
+	else
+		act |= rinfo->flags_info.act & (ICE_SINGLE_ACT_LAN_ENABLE |
+						ICE_SINGLE_ACT_LB_ENABLE);
+
 	switch (rinfo->sw_act.fltr_act) {
 	case ICE_FWD_TO_VSI:
 		act |= (rinfo->sw_act.fwd_id.hw_vsi_id <<
diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h
index 980bae5806..a2b3c80107 100644
--- a/drivers/net/ice/base/ice_switch.h
+++ b/drivers/net/ice/base/ice_switch.h
@@ -250,12 +250,23 @@ struct ice_rule_query_data {
 	u16 vsi_handle;
 };
 
+/* This structure allows to pass info about lb_en and lan_en
+ * flags to ice_add_adv_rule. Values in act would be used
+ * only if act_valid was set to true, otherwise dflt
+ * values would be used.
+ */
+struct ice_adv_rule_flags_info {
+	u32 act;
+	u8 act_valid;		/* indicate if flags in act are valid */
+};
+
 struct ice_adv_rule_info {
 	enum ice_sw_tunnel_type tun_type;
 	struct ice_sw_act_ctrl sw_act;
 	u32 priority;
 	u8 rx; /* true means LOOKUP_RX otherwise LOOKUP_TX */
 	u16 fltr_rule_id;
+	struct ice_adv_rule_flags_info flags_info;
 };
 
 /* A collection of one or more four word recipe */
-- 
2.26.2


  parent reply	other threads:[~2021-09-16  9:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16  9:52 [dpdk-dev] [PATCH 00/12] ice base code batch 2 for DPDK 21.11 Qi Zhang
2021-09-16  9:52 ` [dpdk-dev] [PATCH 01/12] net/ice/base: calculate logical PF ID Qi Zhang
2021-09-16  9:52 ` [dpdk-dev] [PATCH 02/12] net/ice/base: include more E810T adapters Qi Zhang
2021-09-16  9:52 ` [dpdk-dev] [PATCH 03/12] net/ice/base: use macro instead of open-coded division Qi Zhang
2021-09-16  9:52 ` Qi Zhang [this message]
2021-09-16  9:52 ` [dpdk-dev] [PATCH 05/12] net/ice/base: change addr param to u16 Qi Zhang
2021-09-16  9:52 ` [dpdk-dev] [PATCH 06/12] net/ice/base: allow tool access to MNG register Qi Zhang
2021-09-16  9:52 ` [dpdk-dev] [PATCH 07/12] net/ice/base: add package segment ID Qi Zhang
2021-09-16  9:53 ` [dpdk-dev] [PATCH 08/12] net/ice/base: add a helper to check for 100M speed support Qi Zhang
2021-09-16  9:53 ` [dpdk-dev] [PATCH 09/12] net/ice/base: add GCO defines and new GCO flex descriptor Qi Zhang
2021-09-16  9:53 ` [dpdk-dev] [PATCH 10/12] net/ice/base: add get/set functions for shared parameters Qi Zhang
2021-09-16  9:53 ` [dpdk-dev] [PATCH 11/12] net/ice/base: implement support for SMA controller Qi Zhang
2021-09-22 12:43   ` Ferruh Yigit
2021-09-22 12:56     ` Machnikowski, Maciej
2021-09-22 13:51       ` Ferruh Yigit
2021-09-16  9:53 ` [dpdk-dev] [PATCH 12/12] net/ice/base: update auto generated hardware register Qi Zhang
2021-09-17  2:14 ` [dpdk-dev] [PATCH 00/12] ice base code batch 2 for DPDK 21.11 Guo, Junfeng
2021-09-17  8:48   ` Zhang, Qi Z
2021-09-22 12:45     ` Ferruh Yigit
2021-09-23  0:21       ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210916095304.3058210-5-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=junfeng.guo@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=wojciech.drewek@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).