Skip to contentSkip to conversation

Patch "net/mlx5: Return EOPNOTSUPP when failing to get steering name-space" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Jun 15, 2017

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net/mlx5: Return EOPNOTSUPP when failing to get steering name-space

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-mlx5-return-eopnotsupp-when-failing-to-get-steering-name-space.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Jun 15 14:38:52 CEST 2017

From: Or Gerlitz <[email protected]>
Date: Thu, 12 Jan 2017 13:04:01 +0200
Subject: net/mlx5: Return EOPNOTSUPP when failing to get steering name-space

From: Or Gerlitz <[email protected]>

[ Upstream commit eff596da48784316ccb83bef82bc1213b512d5e0 ]

When we fail to retrieve a hardware steering name-space, the returned error code should say that this operation is not supported. Align the various places in the driver where this call is made to this convention.

Also, make sure to warn when we fail to retrieve a SW (ANCHOR) name-space.

---
 drivers/net/ethernet/mellanox/mlx5/core/en_fs.c            |    2 +-
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c          |    6 +++---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c |    2 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c          |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +1 -1
@@ -1081,7 +1081,7 @@ int mlx5e_create_flow_steering(struct ml
 					       MLX5_FLOW_NAMESPACE_KERNEL);
 
 	if (!priv->fs.ns)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	err = mlx5e_arfs_create_tables(priv);
 	if (err) {
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +3 -3
@@ -352,7 +352,7 @@ static int esw_create_legacy_fdb_table(s
 	root_ns = mlx5_get_flow_namespace(dev, MLX5_FLOW_NAMESPACE_FDB);
 	if (!root_ns) {
 		esw_warn(dev, "Failed to get FDB flow namespace\n");
-		return -ENOMEM;
+		return -EOPNOTSUPP;
 	}
 
 	flow_group_in = mlx5_vzalloc(inlen);
@@ -961,7 +961,7 @@ static int esw_vport_enable_egress_acl(s
 	root_ns = mlx5_get_flow_namespace(dev, MLX5_FLOW_NAMESPACE_ESW_EGRESS);
 	if (!root_ns) {
 		esw_warn(dev, "Failed to get E-Switch egress flow namespace\n");
-		return -EIO;
+		return -EOPNOTSUPP;
 	}
 
 	flow_group_in = mlx5_vzalloc(inlen);
@@ -1078,7 +1078,7 @@ static int esw_vport_enable_ingress_acl(
 	root_ns = mlx5_get_flow_namespace(dev, MLX5_FLOW_NAMESPACE_ESW_INGRESS);
 	if (!root_ns) {
 		esw_warn(dev, "Failed to get E-Switch ingress flow namespace\n");
-		return -EIO;
+		return -EOPNOTSUPP;
 	}
 
 	flow_group_in = mlx5_vzalloc(inlen);
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +1 -1
@@ -521,7 +521,7 @@ static int esw_create_offloads_table(str
 	ns = mlx5_get_flow_namespace(dev, MLX5_FLOW_NAMESPACE_OFFLOADS);
 	if (!ns) {
 		esw_warn(esw->dev, "Failed to get offloads flow namespace\n");
-		return -ENOMEM;
+		return -EOPNOTSUPP;
 	}
 
 	ft_offloads = mlx5_create_flow_table(ns, 0, dev->priv.sriov.num_vfs + 2, 0);
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +1 -1
@@ -1678,7 +1678,7 @@ static int create_anchor_flow_table(stru
 	struct mlx5_flow_table *ft;
 
 	ns = mlx5_get_flow_namespace(steering->dev, MLX5_FLOW_NAMESPACE_ANCHOR);
-	if (!ns)
+	if (WARN_ON(!ns))
 		return -EINVAL;
 	ft = mlx5_create_flow_table(ns, ANCHOR_PRIO, ANCHOR_SIZE, ANCHOR_LEVEL);
 	if (IS_ERR(ft)) {

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/net-mlx5-return-eopnotsupp-when-failing-to-get-steering-name-space.patch queue-4.9/net-mlx5-e-switch-err-when-retrieving-steering-name-space-fails.patch