Skip to contentSkip to conversation

mlxsw: spectrum_flower: Do not stop at FLOW_ACTION_{VLAN_MANGLE, PRIORITY}

PATCH In review Ido Schimmel 2 participants 4 messages Apr 5, 2020 – Apr 6, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover mlxsw: spectrum_flower: Do not stop at FLOW_ACTION_{VLAN_MANGLE, PRIORITY}

From: Ido Schimmel <[email protected]>

Petr says:

The handlers for FLOW_ACTION_VLAN_MANGLE and FLOW_ACTION_PRIORITY end by returning whatever the lower-level function that they call returns. If there are more actions lined up after one of these actions, those are never offloaded. Each of the two patches fixes one of those actions.

v2:
* Patch #1: Use valid SHA1 ID in Fixes line (Dave)

Petr Machata (2):
mlxsw: spectrum_flower: Do not stop at FLOW_ACTION_PRIORITY
mlxsw: spectrum_flower: Do not stop at FLOW_ACTION_VLAN_MANGLE

 .../ethernet/mellanox/mlxsw/spectrum_flower.c  | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
Signature · 1 line
2.24.1
#1 lore raw

PATCH v2 1/2 mlxsw: spectrum_flower: Do not stop at FLOW_ACTION_PRIORITY

From: Petr Machata <[email protected]>

The handler for FLOW_ACTION_PRIORITY ends by returning whatever the lower-level function that it calls returns. If there are more actions lined up after this action, those are never offloaded. Fix by only bailing out when the called function returns an error.

Fixes 463957e3fbab ("mlxsw: spectrum_flower: Offload FLOW_ACTION_PRIORITY")
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c +6 -3
index 2f76908cae73..69f77615c816 100644
@@ -155,9 +155,12 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
 							   proto, prio, extack);
 			}
 		case FLOW_ACTION_PRIORITY:
-			return mlxsw_sp_acl_rulei_act_priority(mlxsw_sp, rulei,
-							       act->priority,
-							       extack);
+			err = mlxsw_sp_acl_rulei_act_priority(mlxsw_sp, rulei,
+							      act->priority,
+							      extack);
+			if (err)
+				return err;
+			break;
 		case FLOW_ACTION_MANGLE: {
 			enum flow_action_mangle_base htype = act->mangle.htype;
 			__be32 be_mask = (__force __be32) act->mangle.mask;
Signature · 1 line
2.24.1
#2 lore raw

PATCH v2 2/2 mlxsw: spectrum_flower: Do not stop at FLOW_ACTION_VLAN_MANGLE

In reply to Ido Schimmel

From: Petr Machata <[email protected]>

The handler for FLOW_ACTION_VLAN_MANGLE ends by returning whatever the lower-level function that it calls returns. If there are more actions lined up after this action, those are never offloaded. Fix by only bailing out when the called function returns an error.

Fixes a150201a70da ("mlxsw: spectrum: Add support for vlan modify TC action")
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c +6 -3
index 69f77615c816..51117a5a6bbf 100644
@@ -150,9 +150,12 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
 			u8 prio = act->vlan.prio;
 			u16 vid = act->vlan.vid;
 
-			return mlxsw_sp_acl_rulei_act_vlan(mlxsw_sp, rulei,
-							   act->id, vid,
-							   proto, prio, extack);
+			err = mlxsw_sp_acl_rulei_act_vlan(mlxsw_sp, rulei,
+							  act->id, vid,
+							  proto, prio, extack);
+			if (err)
+				return err;
+			break;
 			}
 		case FLOW_ACTION_PRIORITY:
 			err = mlxsw_sp_acl_rulei_act_priority(mlxsw_sp, rulei,
Signature · 1 line
2.24.1
maintainer
#3 lore raw
In reply to Ido Schimmel

From: Ido Schimmel <[email protected]>
Date: Sun, 5 Apr 2020 09:50:20 +0300

Quoted 11 lines

From: Ido Schimmel <[email protected]>

Petr says:

The handlers for FLOW_ACTION_VLAN_MANGLE and FLOW_ACTION_PRIORITY end by returning whatever the lower-level function that they call returns. If there are more actions lined up after one of these actions, those are never offloaded. Each of the two patches fixes one of those actions.

v2:
* Patch #1: Use valid SHA1 ID in Fixes line (Dave)

Series applied and patch #2 queued up for -stable, thanks.