* [PATCH iwl-net] ice: Fix VSI list rule with ICE_SW_LKUP_LAST type
@ 2024-06-05 14:17 Marcin Szycik
2024-06-05 20:35 ` [Intel-wired-lan] " Jacob Keller
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Marcin Szycik @ 2024-06-05 14:17 UTC (permalink / raw)
To: intel-wired-lan
Cc: netdev, Marcin Szycik, Michal Swiatkowski, Przemek Kitszel
Adding/updating VSI list rule, as well as allocating/freeing VSI list
resource are called several times with type ICE_SW_LKUP_LAST, which fails
because ice_update_vsi_list_rule() and ice_aq_alloc_free_vsi_list()
consider it invalid. Allow calling these functions with ICE_SW_LKUP_LAST.
This fixes at least one issue in switchdev mode, where the same rule with
different action cannot be added, e.g.:
tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \
dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF1_PR
tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \
dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF2_PR
Fixes: 0f94570d0cae ("ice: allow adding advanced rules")
Suggested-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
---
drivers/net/ethernet/intel/ice/ice_switch.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 94d6670d0901..1191031b2a43 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -1899,7 +1899,8 @@ ice_aq_alloc_free_vsi_list(struct ice_hw *hw, u16 *vsi_list_id,
lkup_type == ICE_SW_LKUP_ETHERTYPE_MAC ||
lkup_type == ICE_SW_LKUP_PROMISC ||
lkup_type == ICE_SW_LKUP_PROMISC_VLAN ||
- lkup_type == ICE_SW_LKUP_DFLT) {
+ lkup_type == ICE_SW_LKUP_DFLT ||
+ lkup_type == ICE_SW_LKUP_LAST) {
sw_buf->res_type = cpu_to_le16(ICE_AQC_RES_TYPE_VSI_LIST_REP);
} else if (lkup_type == ICE_SW_LKUP_VLAN) {
if (opc == ice_aqc_opc_alloc_res)
@@ -2922,7 +2923,8 @@ ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,
lkup_type == ICE_SW_LKUP_ETHERTYPE_MAC ||
lkup_type == ICE_SW_LKUP_PROMISC ||
lkup_type == ICE_SW_LKUP_PROMISC_VLAN ||
- lkup_type == ICE_SW_LKUP_DFLT)
+ lkup_type == ICE_SW_LKUP_DFLT ||
+ lkup_type == ICE_SW_LKUP_LAST)
rule_type = remove ? ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR :
ICE_AQC_SW_RULES_T_VSI_LIST_SET;
else if (lkup_type == ICE_SW_LKUP_VLAN)
--
2.45.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Intel-wired-lan] [PATCH iwl-net] ice: Fix VSI list rule with ICE_SW_LKUP_LAST type
2024-06-05 14:17 [PATCH iwl-net] ice: Fix VSI list rule with ICE_SW_LKUP_LAST type Marcin Szycik
@ 2024-06-05 20:35 ` Jacob Keller
2024-06-07 11:37 ` Simon Horman
2024-06-18 6:21 ` [Intel-wired-lan] " Buvaneswaran, Sujai
2 siblings, 0 replies; 4+ messages in thread
From: Jacob Keller @ 2024-06-05 20:35 UTC (permalink / raw)
To: Marcin Szycik, intel-wired-lan
Cc: netdev, Przemek Kitszel, Michal Swiatkowski
On 6/5/2024 7:17 AM, Marcin Szycik wrote:
> Adding/updating VSI list rule, as well as allocating/freeing VSI list
> resource are called several times with type ICE_SW_LKUP_LAST, which fails
> because ice_update_vsi_list_rule() and ice_aq_alloc_free_vsi_list()
> consider it invalid. Allow calling these functions with ICE_SW_LKUP_LAST.
>
> This fixes at least one issue in switchdev mode, where the same rule with
> different action cannot be added, e.g.:
>
> tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \
> dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF1_PR
> tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \
> dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF2_PR
>
> Fixes: 0f94570d0cae ("ice: allow adding advanced rules")
> Suggested-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH iwl-net] ice: Fix VSI list rule with ICE_SW_LKUP_LAST type
2024-06-05 14:17 [PATCH iwl-net] ice: Fix VSI list rule with ICE_SW_LKUP_LAST type Marcin Szycik
2024-06-05 20:35 ` [Intel-wired-lan] " Jacob Keller
@ 2024-06-07 11:37 ` Simon Horman
2024-06-18 6:21 ` [Intel-wired-lan] " Buvaneswaran, Sujai
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2024-06-07 11:37 UTC (permalink / raw)
To: Marcin Szycik
Cc: intel-wired-lan, netdev, Michal Swiatkowski, Przemek Kitszel
On Wed, Jun 05, 2024 at 04:17:45PM +0200, Marcin Szycik wrote:
> Adding/updating VSI list rule, as well as allocating/freeing VSI list
> resource are called several times with type ICE_SW_LKUP_LAST, which fails
> because ice_update_vsi_list_rule() and ice_aq_alloc_free_vsi_list()
> consider it invalid. Allow calling these functions with ICE_SW_LKUP_LAST.
>
> This fixes at least one issue in switchdev mode, where the same rule with
> different action cannot be added, e.g.:
>
> tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \
> dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF1_PR
> tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \
> dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF2_PR
>
> Fixes: 0f94570d0cae ("ice: allow adding advanced rules")
> Suggested-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* RE: [Intel-wired-lan] [PATCH iwl-net] ice: Fix VSI list rule with ICE_SW_LKUP_LAST type
2024-06-05 14:17 [PATCH iwl-net] ice: Fix VSI list rule with ICE_SW_LKUP_LAST type Marcin Szycik
2024-06-05 20:35 ` [Intel-wired-lan] " Jacob Keller
2024-06-07 11:37 ` Simon Horman
@ 2024-06-18 6:21 ` Buvaneswaran, Sujai
2 siblings, 0 replies; 4+ messages in thread
From: Buvaneswaran, Sujai @ 2024-06-18 6:21 UTC (permalink / raw)
To: Marcin Szycik, intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, Kitszel, Przemyslaw, Michal Swiatkowski
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Marcin Szycik
> Sent: Wednesday, June 5, 2024 7:48 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; Marcin Szycik <marcin.szycik@linux.intel.com>;
> Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net] ice: Fix VSI list rule with
> ICE_SW_LKUP_LAST type
>
> Adding/updating VSI list rule, as well as allocating/freeing VSI list resource
> are called several times with type ICE_SW_LKUP_LAST, which fails because
> ice_update_vsi_list_rule() and ice_aq_alloc_free_vsi_list() consider it invalid.
> Allow calling these functions with ICE_SW_LKUP_LAST.
>
> This fixes at least one issue in switchdev mode, where the same rule with
> different action cannot be added, e.g.:
>
> tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \
> dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF1_PR
> tc filter add dev $PF1 ingress protocol arp prio 0 flower skip_sw \
> dst_mac ff:ff:ff:ff:ff:ff action mirred egress redirect dev $VF2_PR
>
> Fixes: 0f94570d0cae ("ice: allow adding advanced rules")
> Suggested-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_switch.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-18 6:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05 14:17 [PATCH iwl-net] ice: Fix VSI list rule with ICE_SW_LKUP_LAST type Marcin Szycik
2024-06-05 20:35 ` [Intel-wired-lan] " Jacob Keller
2024-06-07 11:37 ` Simon Horman
2024-06-18 6:21 ` [Intel-wired-lan] " Buvaneswaran, Sujai
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).