DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/ice/base: fix DCF switch rule
@ 2020-04-23 13:07 Qi Zhang
  2020-04-29  7:44 ` Yang, Qiming
  2020-04-29  7:45 ` Ye Xiaolong
  0 siblings, 2 replies; 3+ messages in thread
From: Qi Zhang @ 2020-04-23 13:07 UTC (permalink / raw)
  To: qiming.yang; +Cc: dev, xiaolong.ye, Qi Zhang

1. ln_en bit should not be turned on, since we only support Rx VEB.
2. lan_en bit need to be turn on for a DCF switch rule, otherwise
   any Tx packet that hit on a rule will be dropped.

Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
v2:
- fix a bug

 drivers/net/ice/base/ice_switch.c   | 11 ++++++++++-
 drivers/net/ice/ice_switch_filter.c |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index fd2cf101a..0970ffdd0 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -1938,6 +1938,13 @@ static void ice_fill_sw_info(struct ice_hw *hw, struct ice_fltr_info *fi)
 {
 	fi->lb_en = false;
 	fi->lan_en = false;
+
+	if ((fi->flag & ICE_FLTR_RX) &&
+	    (fi->fltr_act == ICE_FWD_TO_VSI ||
+	     fi->fltr_act == ICE_FWD_TO_VSI_LIST) &&
+	    fi->lkup_type == ICE_SW_LKUP_LAST)
+		fi->lan_en = true;
+
 	if ((fi->flag & ICE_FLTR_TX) &&
 	    (fi->fltr_act == ICE_FWD_TO_VSI ||
 	     fi->fltr_act == ICE_FWD_TO_VSI_LIST ||
@@ -6453,6 +6460,7 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw,
 			return status;
 
 		ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM);
+		tmp_fltr.flag = m_entry->rule_info.sw_act.flag;
 		tmp_fltr.fltr_rule_id = cur_fltr->fltr_rule_id;
 		tmp_fltr.fltr_act = ICE_FWD_TO_VSI_LIST;
 		tmp_fltr.fwd_id.vsi_list_id = vsi_list_id;
@@ -6615,7 +6623,7 @@ 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_LB_ENABLE | ICE_SINGLE_ACT_LAN_ENABLE;
+	act |= ICE_SINGLE_ACT_LAN_ENABLE;
 	switch (rinfo->sw_act.fltr_act) {
 	case ICE_FWD_TO_VSI:
 		act |= (rinfo->sw_act.fwd_id.hw_vsi_id <<
@@ -6780,6 +6788,7 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
 			return status;
 
 		ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM);
+		tmp_fltr.flag = fm_list->rule_info.sw_act.flag;
 		tmp_fltr.fltr_rule_id = fm_list->rule_info.fltr_rule_id;
 		fm_list->rule_info.sw_act.fltr_act = ICE_FWD_TO_VSI;
 		tmp_fltr.fltr_act = ICE_FWD_TO_VSI;
diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 55a5618a7..8b007b7eb 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -1129,6 +1129,7 @@ ice_switch_parse_dcf_action(const struct rte_flow_action *actions,
 	}
 
 	rule_info->sw_act.src = rule_info->sw_act.vsi_handle;
+	rule_info->sw_act.flag = ICE_FLTR_RX;
 	rule_info->rx = 1;
 	rule_info->priority = 5;
 
-- 
2.13.6


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ice/base: fix DCF switch rule
  2020-04-23 13:07 [dpdk-dev] [PATCH v2] net/ice/base: fix DCF switch rule Qi Zhang
@ 2020-04-29  7:44 ` Yang, Qiming
  2020-04-29  7:45 ` Ye Xiaolong
  1 sibling, 0 replies; 3+ messages in thread
From: Yang, Qiming @ 2020-04-29  7:44 UTC (permalink / raw)
  To: Zhang, Qi Z; +Cc: dev, Ye, Xiaolong

> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Thursday, April 23, 2020 21:07
> To: Yang, Qiming <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: [PATCH v2] net/ice/base: fix DCF switch rule
> 
> 1. ln_en bit should not be turned on, since we only support Rx VEB.
> 2. lan_en bit need to be turn on for a DCF switch rule, otherwise
>    any Tx packet that hit on a rule will be dropped.
> 
> Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch
> recipe")
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
> v2:
> - fix a bug
> 
>  drivers/net/ice/base/ice_switch.c   | 11 ++++++++++-
>  drivers/net/ice/ice_switch_filter.c |  1 +
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ice/base/ice_switch.c
> b/drivers/net/ice/base/ice_switch.c
> index fd2cf101a..0970ffdd0 100644
> --- a/drivers/net/ice/base/ice_switch.c
> +++ b/drivers/net/ice/base/ice_switch.c
> @@ -1938,6 +1938,13 @@ static void ice_fill_sw_info(struct ice_hw *hw,
> struct ice_fltr_info *fi)  {
>  	fi->lb_en = false;
>  	fi->lan_en = false;
> +
> +	if ((fi->flag & ICE_FLTR_RX) &&
> +	    (fi->fltr_act == ICE_FWD_TO_VSI ||
> +	     fi->fltr_act == ICE_FWD_TO_VSI_LIST) &&
> +	    fi->lkup_type == ICE_SW_LKUP_LAST)
> +		fi->lan_en = true;
> +
>  	if ((fi->flag & ICE_FLTR_TX) &&
>  	    (fi->fltr_act == ICE_FWD_TO_VSI ||
>  	     fi->fltr_act == ICE_FWD_TO_VSI_LIST || @@ -6453,6 +6460,7 @@
> ice_adv_add_update_vsi_list(struct ice_hw *hw,
>  			return status;
> 
>  		ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr),
> ICE_NONDMA_MEM);
> +		tmp_fltr.flag = m_entry->rule_info.sw_act.flag;
>  		tmp_fltr.fltr_rule_id = cur_fltr->fltr_rule_id;
>  		tmp_fltr.fltr_act = ICE_FWD_TO_VSI_LIST;
>  		tmp_fltr.fwd_id.vsi_list_id = vsi_list_id; @@ -6615,7 +6623,7
> @@ 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_LB_ENABLE |
> ICE_SINGLE_ACT_LAN_ENABLE;
> +	act |= ICE_SINGLE_ACT_LAN_ENABLE;
>  	switch (rinfo->sw_act.fltr_act) {
>  	case ICE_FWD_TO_VSI:
>  		act |= (rinfo->sw_act.fwd_id.hw_vsi_id << @@ -6780,6
> +6788,7 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16
> vsi_handle,
>  			return status;
> 
>  		ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr),
> ICE_NONDMA_MEM);
> +		tmp_fltr.flag = fm_list->rule_info.sw_act.flag;
>  		tmp_fltr.fltr_rule_id = fm_list->rule_info.fltr_rule_id;
>  		fm_list->rule_info.sw_act.fltr_act = ICE_FWD_TO_VSI;
>  		tmp_fltr.fltr_act = ICE_FWD_TO_VSI;
> diff --git a/drivers/net/ice/ice_switch_filter.c
> b/drivers/net/ice/ice_switch_filter.c
> index 55a5618a7..8b007b7eb 100644
> --- a/drivers/net/ice/ice_switch_filter.c
> +++ b/drivers/net/ice/ice_switch_filter.c
> @@ -1129,6 +1129,7 @@ ice_switch_parse_dcf_action(const struct
> rte_flow_action *actions,
>  	}
> 
>  	rule_info->sw_act.src = rule_info->sw_act.vsi_handle;
> +	rule_info->sw_act.flag = ICE_FLTR_RX;
>  	rule_info->rx = 1;
>  	rule_info->priority = 5;
> 
> --
> 2.13.6

Acked-by: Qiming Yang <qiming.yang@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ice/base: fix DCF switch rule
  2020-04-23 13:07 [dpdk-dev] [PATCH v2] net/ice/base: fix DCF switch rule Qi Zhang
  2020-04-29  7:44 ` Yang, Qiming
@ 2020-04-29  7:45 ` Ye Xiaolong
  1 sibling, 0 replies; 3+ messages in thread
From: Ye Xiaolong @ 2020-04-29  7:45 UTC (permalink / raw)
  To: Qi Zhang; +Cc: qiming.yang, dev

On 04/23, Qi Zhang wrote:
>1. ln_en bit should not be turned on, since we only support Rx VEB.
>2. lan_en bit need to be turn on for a DCF switch rule, otherwise
>   any Tx packet that hit on a rule will be dropped.
>
>Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")

Cc: stable@dpdk.org

>
>Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>---
>v2:
>- fix a bug
>
> drivers/net/ice/base/ice_switch.c   | 11 ++++++++++-
> drivers/net/ice/ice_switch_filter.c |  1 +
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
>index fd2cf101a..0970ffdd0 100644
>--- a/drivers/net/ice/base/ice_switch.c
>+++ b/drivers/net/ice/base/ice_switch.c
>@@ -1938,6 +1938,13 @@ static void ice_fill_sw_info(struct ice_hw *hw, struct ice_fltr_info *fi)
> {
> 	fi->lb_en = false;
> 	fi->lan_en = false;
>+
>+	if ((fi->flag & ICE_FLTR_RX) &&
>+	    (fi->fltr_act == ICE_FWD_TO_VSI ||
>+	     fi->fltr_act == ICE_FWD_TO_VSI_LIST) &&
>+	    fi->lkup_type == ICE_SW_LKUP_LAST)
>+		fi->lan_en = true;
>+
> 	if ((fi->flag & ICE_FLTR_TX) &&
> 	    (fi->fltr_act == ICE_FWD_TO_VSI ||
> 	     fi->fltr_act == ICE_FWD_TO_VSI_LIST ||
>@@ -6453,6 +6460,7 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw,
> 			return status;
> 
> 		ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM);
>+		tmp_fltr.flag = m_entry->rule_info.sw_act.flag;
> 		tmp_fltr.fltr_rule_id = cur_fltr->fltr_rule_id;
> 		tmp_fltr.fltr_act = ICE_FWD_TO_VSI_LIST;
> 		tmp_fltr.fwd_id.vsi_list_id = vsi_list_id;
>@@ -6615,7 +6623,7 @@ 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_LB_ENABLE | ICE_SINGLE_ACT_LAN_ENABLE;
>+	act |= ICE_SINGLE_ACT_LAN_ENABLE;
> 	switch (rinfo->sw_act.fltr_act) {
> 	case ICE_FWD_TO_VSI:
> 		act |= (rinfo->sw_act.fwd_id.hw_vsi_id <<
>@@ -6780,6 +6788,7 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
> 			return status;
> 
> 		ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM);
>+		tmp_fltr.flag = fm_list->rule_info.sw_act.flag;
> 		tmp_fltr.fltr_rule_id = fm_list->rule_info.fltr_rule_id;
> 		fm_list->rule_info.sw_act.fltr_act = ICE_FWD_TO_VSI;
> 		tmp_fltr.fltr_act = ICE_FWD_TO_VSI;
>diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
>index 55a5618a7..8b007b7eb 100644
>--- a/drivers/net/ice/ice_switch_filter.c
>+++ b/drivers/net/ice/ice_switch_filter.c
>@@ -1129,6 +1129,7 @@ ice_switch_parse_dcf_action(const struct rte_flow_action *actions,
> 	}
> 
> 	rule_info->sw_act.src = rule_info->sw_act.vsi_handle;
>+	rule_info->sw_act.flag = ICE_FLTR_RX;
> 	rule_info->rx = 1;
> 	rule_info->priority = 5;
> 
>-- 
>2.13.6
>

Applied to dpdk-next-net-intel with qiming's ack, Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-29  7:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 13:07 [dpdk-dev] [PATCH v2] net/ice/base: fix DCF switch rule Qi Zhang
2020-04-29  7:44 ` Yang, Qiming
2020-04-29  7:45 ` Ye Xiaolong

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).