diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2013-04-06 23:44:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-07 16:55:46 -0400 |
commit | 540b3a39eea0056d305f17dda47eb185c4d56ddc (patch) | |
tree | 4e3bbd87a657d525eca9601b2bae91aabb49b87a | |
parent | 4d531aa8ab44983561857098592f860c8b3f5ec4 (diff) |
net/mlx4_en: Enable DCB ETS ops only when supported by the firmware
Enable the DCB ETS ops only when supported by the firmware. For older firmware/cards
which don't support ETS, advertize only PFC DCB ops.
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/fw.c | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 | ||||
-rw-r--r-- | include/linux/mlx4/device.h | 1 |
5 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c index b799ab12a291..321553fd58df 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c | |||
@@ -253,3 +253,11 @@ const struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops = { | |||
253 | .getdcbx = mlx4_en_dcbnl_getdcbx, | 253 | .getdcbx = mlx4_en_dcbnl_getdcbx, |
254 | .setdcbx = mlx4_en_dcbnl_setdcbx, | 254 | .setdcbx = mlx4_en_dcbnl_setdcbx, |
255 | }; | 255 | }; |
256 | |||
257 | const struct dcbnl_rtnl_ops mlx4_en_dcbnl_pfc_ops = { | ||
258 | .ieee_getpfc = mlx4_en_dcbnl_ieee_getpfc, | ||
259 | .ieee_setpfc = mlx4_en_dcbnl_ieee_setpfc, | ||
260 | |||
261 | .getdcbx = mlx4_en_dcbnl_getdcbx, | ||
262 | .setdcbx = mlx4_en_dcbnl_setdcbx, | ||
263 | }; | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 473c9d2fec1a..d2a4f919bf1f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -2013,8 +2013,14 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
2013 | INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate); | 2013 | INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate); |
2014 | INIT_DELAYED_WORK(&priv->stats_task, mlx4_en_do_get_stats); | 2014 | INIT_DELAYED_WORK(&priv->stats_task, mlx4_en_do_get_stats); |
2015 | #ifdef CONFIG_MLX4_EN_DCB | 2015 | #ifdef CONFIG_MLX4_EN_DCB |
2016 | if (!mlx4_is_slave(priv->mdev->dev)) | 2016 | if (!mlx4_is_slave(priv->mdev->dev)) { |
2017 | dev->dcbnl_ops = &mlx4_en_dcbnl_ops; | 2017 | if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_SET_ETH_SCHED) { |
2018 | dev->dcbnl_ops = &mlx4_en_dcbnl_ops; | ||
2019 | } else { | ||
2020 | en_info(priv, "enabling only PFC DCB ops\n"); | ||
2021 | dev->dcbnl_ops = &mlx4_en_dcbnl_pfc_ops; | ||
2022 | } | ||
2023 | } | ||
2018 | #endif | 2024 | #endif |
2019 | 2025 | ||
2020 | for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i) | 2026 | for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 876439748cdf..ab470d991ade 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -109,6 +109,7 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags) | |||
109 | [41] = "Unicast VEP steering support", | 109 | [41] = "Unicast VEP steering support", |
110 | [42] = "Multicast VEP steering support", | 110 | [42] = "Multicast VEP steering support", |
111 | [48] = "Counters support", | 111 | [48] = "Counters support", |
112 | [53] = "Port ETS Scheduler support", | ||
112 | [55] = "Port link type sensing support", | 113 | [55] = "Port link type sensing support", |
113 | [59] = "Port management change event support", | 114 | [59] = "Port management change event support", |
114 | [61] = "64 byte EQE support", | 115 | [61] = "64 byte EQE support", |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index f710b7ce0dcb..d4cb5d3b28a2 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -624,6 +624,7 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_dev *mdev, u8 port); | |||
624 | 624 | ||
625 | #ifdef CONFIG_MLX4_EN_DCB | 625 | #ifdef CONFIG_MLX4_EN_DCB |
626 | extern const struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops; | 626 | extern const struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops; |
627 | extern const struct dcbnl_rtnl_ops mlx4_en_dcbnl_pfc_ops; | ||
627 | #endif | 628 | #endif |
628 | 629 | ||
629 | int mlx4_en_setup_tc(struct net_device *dev, u8 up); | 630 | int mlx4_en_setup_tc(struct net_device *dev, u8 up); |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 811f91cf5e8c..1bc5a750b330 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -140,6 +140,7 @@ enum { | |||
140 | MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, | 140 | MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, |
141 | MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, | 141 | MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, |
142 | MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, | 142 | MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, |
143 | MLX4_DEV_CAP_FLAG_SET_ETH_SCHED = 1LL << 53, | ||
143 | MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55, | 144 | MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55, |
144 | MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59, | 145 | MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59, |
145 | MLX4_DEV_CAP_FLAG_64B_EQE = 1LL << 61, | 146 | MLX4_DEV_CAP_FLAG_64B_EQE = 1LL << 61, |