diff options
author | Mark Bloch <markb@mellanox.com> | 2018-08-28 14:18:40 +0300 |
---|---|---|
committer | Leon Romanovsky <leonro@mellanox.com> | 2018-09-05 07:56:27 +0300 |
commit | 2226dcb424bf0641f9ee61b1209e0bb4e5db5b94 (patch) | |
tree | c76f1eee404f16c4a7a6c59508ff2c78ee1e99d7 /drivers | |
parent | 09adbb5dd01b197d093ec5af82785e49fa0a4a69 (diff) | |
download | linux-2226dcb424bf0641f9ee61b1209e0bb4e5db5b94.tar.bz2 |
net/mlx5: Cleanup flow namespace getter switch logic
Refactor the switch logic so it's simpler to follow and understand.
Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index f418541af7cf..5624030d2ed4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -1986,40 +1986,28 @@ struct mlx5_flow_namespace *mlx5_get_flow_namespace(struct mlx5_core_dev *dev, return NULL; switch (type) { - case MLX5_FLOW_NAMESPACE_BYPASS: - case MLX5_FLOW_NAMESPACE_LAG: - case MLX5_FLOW_NAMESPACE_OFFLOADS: - case MLX5_FLOW_NAMESPACE_ETHTOOL: - case MLX5_FLOW_NAMESPACE_KERNEL: - case MLX5_FLOW_NAMESPACE_LEFTOVERS: - case MLX5_FLOW_NAMESPACE_ANCHOR: - prio = type; - break; case MLX5_FLOW_NAMESPACE_FDB: if (steering->fdb_root_ns) return &steering->fdb_root_ns->ns; - else - return NULL; + return NULL; case MLX5_FLOW_NAMESPACE_SNIFFER_RX: if (steering->sniffer_rx_root_ns) return &steering->sniffer_rx_root_ns->ns; - else - return NULL; + return NULL; case MLX5_FLOW_NAMESPACE_SNIFFER_TX: if (steering->sniffer_tx_root_ns) return &steering->sniffer_tx_root_ns->ns; - else - return NULL; + return NULL; case MLX5_FLOW_NAMESPACE_EGRESS: if (steering->egress_root_ns) return &steering->egress_root_ns->ns; - else - return NULL; - default: return NULL; + default: + break; } root_ns = steering->root_ns; + prio = type; if (!root_ns) return NULL; |