Commit f9162539 authored by Hadar Hen Zion's avatar Hadar Hen Zion Committed by Roland Dreier

mlx4: Match DMFS promiscuous field names to firmware spec

Align the names used by enum mlx4_net_trans_promisc_mode with the
actual firmware specification.  The patch doesn't introduce any
functional change or API change towards the firmware.

Remove MLX4_FS_PROMISC_FUNCTION_PORT which isn't of use.  Add new
enums MLX4_FS_{UC/MC}_SNIFFER as a preparation step for sniffer
support.
Signed-off-by: default avatarHadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 3cd0e178
...@@ -889,7 +889,7 @@ static int mlx4_en_flow_replace(struct net_device *dev, ...@@ -889,7 +889,7 @@ static int mlx4_en_flow_replace(struct net_device *dev,
.queue_mode = MLX4_NET_TRANS_Q_FIFO, .queue_mode = MLX4_NET_TRANS_Q_FIFO,
.exclusive = 0, .exclusive = 0,
.allow_loopback = 1, .allow_loopback = 1,
.promisc_mode = MLX4_FS_PROMISC_NONE, .promisc_mode = MLX4_FS_REGULAR,
}; };
rule.port = priv->port; rule.port = priv->port;
......
...@@ -127,7 +127,7 @@ static void mlx4_en_filter_work(struct work_struct *work) ...@@ -127,7 +127,7 @@ static void mlx4_en_filter_work(struct work_struct *work)
.queue_mode = MLX4_NET_TRANS_Q_LIFO, .queue_mode = MLX4_NET_TRANS_Q_LIFO,
.exclusive = 1, .exclusive = 1,
.allow_loopback = 1, .allow_loopback = 1,
.promisc_mode = MLX4_FS_PROMISC_NONE, .promisc_mode = MLX4_FS_REGULAR,
.port = priv->port, .port = priv->port,
.priority = MLX4_DOMAIN_RFS, .priority = MLX4_DOMAIN_RFS,
}; };
...@@ -446,7 +446,7 @@ static int mlx4_en_uc_steer_add(struct mlx4_en_priv *priv, ...@@ -446,7 +446,7 @@ static int mlx4_en_uc_steer_add(struct mlx4_en_priv *priv,
.queue_mode = MLX4_NET_TRANS_Q_FIFO, .queue_mode = MLX4_NET_TRANS_Q_FIFO,
.exclusive = 0, .exclusive = 0,
.allow_loopback = 1, .allow_loopback = 1,
.promisc_mode = MLX4_FS_PROMISC_NONE, .promisc_mode = MLX4_FS_REGULAR,
.priority = MLX4_DOMAIN_NIC, .priority = MLX4_DOMAIN_NIC,
}; };
...@@ -793,7 +793,7 @@ static void mlx4_en_set_promisc_mode(struct mlx4_en_priv *priv, ...@@ -793,7 +793,7 @@ static void mlx4_en_set_promisc_mode(struct mlx4_en_priv *priv,
err = mlx4_flow_steer_promisc_add(mdev->dev, err = mlx4_flow_steer_promisc_add(mdev->dev,
priv->port, priv->port,
priv->base_qpn, priv->base_qpn,
MLX4_FS_PROMISC_UPLINK); MLX4_FS_ALL_DEFAULT);
if (err) if (err)
en_err(priv, "Failed enabling promiscuous mode\n"); en_err(priv, "Failed enabling promiscuous mode\n");
priv->flags |= MLX4_EN_FLAG_MC_PROMISC; priv->flags |= MLX4_EN_FLAG_MC_PROMISC;
...@@ -856,7 +856,7 @@ static void mlx4_en_clear_promisc_mode(struct mlx4_en_priv *priv, ...@@ -856,7 +856,7 @@ static void mlx4_en_clear_promisc_mode(struct mlx4_en_priv *priv,
case MLX4_STEERING_MODE_DEVICE_MANAGED: case MLX4_STEERING_MODE_DEVICE_MANAGED:
err = mlx4_flow_steer_promisc_remove(mdev->dev, err = mlx4_flow_steer_promisc_remove(mdev->dev,
priv->port, priv->port,
MLX4_FS_PROMISC_UPLINK); MLX4_FS_ALL_DEFAULT);
if (err) if (err)
en_err(priv, "Failed disabling promiscuous mode\n"); en_err(priv, "Failed disabling promiscuous mode\n");
priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC; priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC;
...@@ -917,7 +917,7 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv, ...@@ -917,7 +917,7 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv,
err = mlx4_flow_steer_promisc_add(mdev->dev, err = mlx4_flow_steer_promisc_add(mdev->dev,
priv->port, priv->port,
priv->base_qpn, priv->base_qpn,
MLX4_FS_PROMISC_ALL_MULTI); MLX4_FS_MC_DEFAULT);
break; break;
case MLX4_STEERING_MODE_B0: case MLX4_STEERING_MODE_B0:
...@@ -940,7 +940,7 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv, ...@@ -940,7 +940,7 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv,
case MLX4_STEERING_MODE_DEVICE_MANAGED: case MLX4_STEERING_MODE_DEVICE_MANAGED:
err = mlx4_flow_steer_promisc_remove(mdev->dev, err = mlx4_flow_steer_promisc_remove(mdev->dev,
priv->port, priv->port,
MLX4_FS_PROMISC_ALL_MULTI); MLX4_FS_MC_DEFAULT);
break; break;
case MLX4_STEERING_MODE_B0: case MLX4_STEERING_MODE_B0:
...@@ -1598,10 +1598,10 @@ void mlx4_en_stop_port(struct net_device *dev, int detach) ...@@ -1598,10 +1598,10 @@ void mlx4_en_stop_port(struct net_device *dev, int detach)
MLX4_EN_FLAG_MC_PROMISC); MLX4_EN_FLAG_MC_PROMISC);
mlx4_flow_steer_promisc_remove(mdev->dev, mlx4_flow_steer_promisc_remove(mdev->dev,
priv->port, priv->port,
MLX4_FS_PROMISC_UPLINK); MLX4_FS_ALL_DEFAULT);
mlx4_flow_steer_promisc_remove(mdev->dev, mlx4_flow_steer_promisc_remove(mdev->dev,
priv->port, priv->port,
MLX4_FS_PROMISC_ALL_MULTI); MLX4_FS_MC_DEFAULT);
} else if (priv->flags & MLX4_EN_FLAG_PROMISC) { } else if (priv->flags & MLX4_EN_FLAG_PROMISC) {
priv->flags &= ~MLX4_EN_FLAG_PROMISC; priv->flags &= ~MLX4_EN_FLAG_PROMISC;
......
...@@ -649,10 +649,11 @@ static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl, ...@@ -649,10 +649,11 @@ static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl,
struct mlx4_net_trans_rule_hw_ctrl *hw) struct mlx4_net_trans_rule_hw_ctrl *hw)
{ {
static const u8 __promisc_mode[] = { static const u8 __promisc_mode[] = {
[MLX4_FS_PROMISC_NONE] = 0x0, [MLX4_FS_REGULAR] = 0x0,
[MLX4_FS_PROMISC_UPLINK] = 0x1, [MLX4_FS_ALL_DEFAULT] = 0x1,
[MLX4_FS_PROMISC_FUNCTION_PORT] = 0x2, [MLX4_FS_MC_DEFAULT] = 0x3,
[MLX4_FS_PROMISC_ALL_MULTI] = 0x3, [MLX4_FS_UC_SNIFFER] = 0x4,
[MLX4_FS_MC_SNIFFER] = 0x5,
}; };
u32 dw = 0; u32 dw = 0;
...@@ -1153,7 +1154,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], ...@@ -1153,7 +1154,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
struct mlx4_net_trans_rule rule = { struct mlx4_net_trans_rule rule = {
.queue_mode = MLX4_NET_TRANS_Q_FIFO, .queue_mode = MLX4_NET_TRANS_Q_FIFO,
.exclusive = 0, .exclusive = 0,
.promisc_mode = MLX4_FS_PROMISC_NONE, .promisc_mode = MLX4_FS_REGULAR,
.priority = MLX4_DOMAIN_NIC, .priority = MLX4_DOMAIN_NIC,
}; };
...@@ -1222,11 +1223,10 @@ int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, ...@@ -1222,11 +1223,10 @@ int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port,
u64 *regid_p; u64 *regid_p;
switch (mode) { switch (mode) {
case MLX4_FS_PROMISC_UPLINK: case MLX4_FS_ALL_DEFAULT:
case MLX4_FS_PROMISC_FUNCTION_PORT:
regid_p = &dev->regid_promisc_array[port]; regid_p = &dev->regid_promisc_array[port];
break; break;
case MLX4_FS_PROMISC_ALL_MULTI: case MLX4_FS_MC_DEFAULT:
regid_p = &dev->regid_allmulti_array[port]; regid_p = &dev->regid_allmulti_array[port];
break; break;
default: default:
...@@ -1253,11 +1253,10 @@ int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, ...@@ -1253,11 +1253,10 @@ int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port,
u64 *regid_p; u64 *regid_p;
switch (mode) { switch (mode) {
case MLX4_FS_PROMISC_UPLINK: case MLX4_FS_ALL_DEFAULT:
case MLX4_FS_PROMISC_FUNCTION_PORT:
regid_p = &dev->regid_promisc_array[port]; regid_p = &dev->regid_promisc_array[port];
break; break;
case MLX4_FS_PROMISC_ALL_MULTI: case MLX4_FS_MC_DEFAULT:
regid_p = &dev->regid_allmulti_array[port]; regid_p = &dev->regid_allmulti_array[port];
break; break;
default: default:
......
...@@ -896,11 +896,12 @@ static inline int map_hw_to_sw_id(u16 header_id) ...@@ -896,11 +896,12 @@ static inline int map_hw_to_sw_id(u16 header_id)
} }
enum mlx4_net_trans_promisc_mode { enum mlx4_net_trans_promisc_mode {
MLX4_FS_PROMISC_NONE = 0, MLX4_FS_REGULAR = 1,
MLX4_FS_PROMISC_UPLINK, MLX4_FS_ALL_DEFAULT,
/* For future use. Not implemented yet */ MLX4_FS_MC_DEFAULT,
MLX4_FS_PROMISC_FUNCTION_PORT, MLX4_FS_UC_SNIFFER,
MLX4_FS_PROMISC_ALL_MULTI, MLX4_FS_MC_SNIFFER,
}; };
struct mlx4_spec_eth { struct mlx4_spec_eth {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment