Skip to content

Commit 6415aa5

Browse files
committed
Merge tag 'mlx5-fixes-2017-01-27' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== mlx5-fixes-2017-01-27 A couple of mlx5 core and ethernet driver fixes. From Or, A couple of error return values and error handling fixes. From Hadar, Support TC encapsulation offloads even when the mlx5e uplink device is stacked under an upper device. From Gal, Two patches to fix RSS hash modifications via ethtool. From Moshe, Added a needed ets capability check. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 051a2e0 + d15118a commit 6415aa5

File tree

15 files changed

+181
-157
lines changed

15 files changed

+181
-157
lines changed

drivers/net/ethernet/mellanox/mlx5/core/cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)
17281728
if (cmd->cmdif_rev > CMD_IF_REV) {
17291729
dev_err(&dev->pdev->dev, "driver does not support command interface version. driver %d, firmware %d\n",
17301730
CMD_IF_REV, cmd->cmdif_rev);
1731-
err = -ENOTSUPP;
1731+
err = -EOPNOTSUPP;
17321732
goto err_free_page;
17331733
}
17341734

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,8 @@ void mlx5e_disable_vlan_filter(struct mlx5e_priv *priv);
791791
int mlx5e_modify_rqs_vsd(struct mlx5e_priv *priv, bool vsd);
792792

793793
int mlx5e_redirect_rqt(struct mlx5e_priv *priv, u32 rqtn, int sz, int ix);
794-
void mlx5e_build_tir_ctx_hash(void *tirc, struct mlx5e_priv *priv);
794+
void mlx5e_build_indir_tir_ctx_hash(struct mlx5e_priv *priv, void *tirc,
795+
enum mlx5e_traffic_types tt);
795796

796797
int mlx5e_open_locked(struct net_device *netdev);
797798
int mlx5e_close_locked(struct net_device *netdev);
@@ -863,12 +864,12 @@ static inline void mlx5e_arfs_destroy_tables(struct mlx5e_priv *priv) {}
863864

864865
static inline int mlx5e_arfs_enable(struct mlx5e_priv *priv)
865866
{
866-
return -ENOTSUPP;
867+
return -EOPNOTSUPP;
867868
}
868869

869870
static inline int mlx5e_arfs_disable(struct mlx5e_priv *priv)
870871
{
871-
return -ENOTSUPP;
872+
return -EOPNOTSUPP;
872873
}
873874
#else
874875
int mlx5e_arfs_create_tables(struct mlx5e_priv *priv);

drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static int mlx5e_dcbnl_ieee_getets(struct net_device *netdev,
8989
int i;
9090

9191
if (!MLX5_CAP_GEN(priv->mdev, ets))
92-
return -ENOTSUPP;
92+
return -EOPNOTSUPP;
9393

9494
ets->ets_cap = mlx5_max_tc(priv->mdev) + 1;
9595
for (i = 0; i < ets->ets_cap; i++) {
@@ -236,7 +236,7 @@ static int mlx5e_dcbnl_ieee_setets(struct net_device *netdev,
236236
int err;
237237

238238
if (!MLX5_CAP_GEN(priv->mdev, ets))
239-
return -ENOTSUPP;
239+
return -EOPNOTSUPP;
240240

241241
err = mlx5e_dbcnl_validate_ets(netdev, ets);
242242
if (err)
@@ -402,7 +402,7 @@ static u8 mlx5e_dcbnl_setall(struct net_device *netdev)
402402
struct mlx5_core_dev *mdev = priv->mdev;
403403
struct ieee_ets ets;
404404
struct ieee_pfc pfc;
405-
int err = -ENOTSUPP;
405+
int err = -EOPNOTSUPP;
406406
int i;
407407

408408
if (!MLX5_CAP_GEN(mdev, ets))
@@ -511,6 +511,11 @@ static void mlx5e_dcbnl_getpgtccfgtx(struct net_device *netdev,
511511
struct mlx5e_priv *priv = netdev_priv(netdev);
512512
struct mlx5_core_dev *mdev = priv->mdev;
513513

514+
if (!MLX5_CAP_GEN(priv->mdev, ets)) {
515+
netdev_err(netdev, "%s, ets is not supported\n", __func__);
516+
return;
517+
}
518+
514519
if (priority >= CEE_DCBX_MAX_PRIO) {
515520
netdev_err(netdev,
516521
"%s, priority is out of range\n", __func__);

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ static int mlx5e_get_coalesce(struct net_device *netdev,
595595
struct mlx5e_priv *priv = netdev_priv(netdev);
596596

597597
if (!MLX5_CAP_GEN(priv->mdev, cq_moderation))
598-
return -ENOTSUPP;
598+
return -EOPNOTSUPP;
599599

600600
coal->rx_coalesce_usecs = priv->params.rx_cq_moderation.usec;
601601
coal->rx_max_coalesced_frames = priv->params.rx_cq_moderation.pkts;
@@ -620,7 +620,7 @@ static int mlx5e_set_coalesce(struct net_device *netdev,
620620
int i;
621621

622622
if (!MLX5_CAP_GEN(mdev, cq_moderation))
623-
return -ENOTSUPP;
623+
return -EOPNOTSUPP;
624624

625625
mutex_lock(&priv->state_lock);
626626

@@ -980,22 +980,26 @@ static int mlx5e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
980980

981981
static void mlx5e_modify_tirs_hash(struct mlx5e_priv *priv, void *in, int inlen)
982982
{
983-
struct mlx5_core_dev *mdev = priv->mdev;
984983
void *tirc = MLX5_ADDR_OF(modify_tir_in, in, ctx);
985-
int i;
984+
struct mlx5_core_dev *mdev = priv->mdev;
985+
int ctxlen = MLX5_ST_SZ_BYTES(tirc);
986+
int tt;
986987

987988
MLX5_SET(modify_tir_in, in, bitmask.hash, 1);
988-
mlx5e_build_tir_ctx_hash(tirc, priv);
989989

990-
for (i = 0; i < MLX5E_NUM_INDIR_TIRS; i++)
991-
mlx5_core_modify_tir(mdev, priv->indir_tir[i].tirn, in, inlen);
990+
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++) {
991+
memset(tirc, 0, ctxlen);
992+
mlx5e_build_indir_tir_ctx_hash(priv, tirc, tt);
993+
mlx5_core_modify_tir(mdev, priv->indir_tir[tt].tirn, in, inlen);
994+
}
992995
}
993996

994997
static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
995998
const u8 *key, const u8 hfunc)
996999
{
9971000
struct mlx5e_priv *priv = netdev_priv(dev);
9981001
int inlen = MLX5_ST_SZ_BYTES(modify_tir_in);
1002+
bool hash_changed = false;
9991003
void *in;
10001004

10011005
if ((hfunc != ETH_RSS_HASH_NO_CHANGE) &&
@@ -1017,14 +1021,21 @@ static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
10171021
mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, 0);
10181022
}
10191023

1020-
if (key)
1024+
if (hfunc != ETH_RSS_HASH_NO_CHANGE &&
1025+
hfunc != priv->params.rss_hfunc) {
1026+
priv->params.rss_hfunc = hfunc;
1027+
hash_changed = true;
1028+
}
1029+
1030+
if (key) {
10211031
memcpy(priv->params.toeplitz_hash_key, key,
10221032
sizeof(priv->params.toeplitz_hash_key));
1033+
hash_changed = hash_changed ||
1034+
priv->params.rss_hfunc == ETH_RSS_HASH_TOP;
1035+
}
10231036

1024-
if (hfunc != ETH_RSS_HASH_NO_CHANGE)
1025-
priv->params.rss_hfunc = hfunc;
1026-
1027-
mlx5e_modify_tirs_hash(priv, in, inlen);
1037+
if (hash_changed)
1038+
mlx5e_modify_tirs_hash(priv, in, inlen);
10281039

10291040
mutex_unlock(&priv->state_lock);
10301041

@@ -1296,7 +1307,7 @@ static int mlx5e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
12961307
u32 mlx5_wol_mode;
12971308

12981309
if (!wol_supported)
1299-
return -ENOTSUPP;
1310+
return -EOPNOTSUPP;
13001311

13011312
if (wol->wolopts & ~wol_supported)
13021313
return -EINVAL;
@@ -1426,7 +1437,7 @@ static int set_pflag_rx_cqe_based_moder(struct net_device *netdev, bool enable)
14261437

14271438
if (rx_cq_period_mode == MLX5_CQ_PERIOD_MODE_START_FROM_CQE &&
14281439
!MLX5_CAP_GEN(mdev, cq_period_start_from_cqe))
1429-
return -ENOTSUPP;
1440+
return -EOPNOTSUPP;
14301441

14311442
if (!rx_mode_changed)
14321443
return 0;
@@ -1452,7 +1463,7 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev,
14521463
bool reset;
14531464

14541465
if (!MLX5_CAP_GEN(mdev, cqe_compression))
1455-
return -ENOTSUPP;
1466+
return -EOPNOTSUPP;
14561467

14571468
if (enable && priv->tstamp.hwtstamp_config.rx_filter != HWTSTAMP_FILTER_NONE) {
14581469
netdev_err(netdev, "Can't enable cqe compression while timestamping is enabled.\n");

drivers/net/ethernet/mellanox/mlx5/core/en_fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ int mlx5e_create_flow_steering(struct mlx5e_priv *priv)
10891089
MLX5_FLOW_NAMESPACE_KERNEL);
10901090

10911091
if (!priv->fs.ns)
1092-
return -EINVAL;
1092+
return -EOPNOTSUPP;
10931093

10941094
err = mlx5e_arfs_create_tables(priv);
10951095
if (err) {

drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static struct mlx5e_ethtool_table *get_flow_table(struct mlx5e_priv *priv,
9292
ns = mlx5_get_flow_namespace(priv->mdev,
9393
MLX5_FLOW_NAMESPACE_ETHTOOL);
9494
if (!ns)
95-
return ERR_PTR(-ENOTSUPP);
95+
return ERR_PTR(-EOPNOTSUPP);
9696

9797
table_size = min_t(u32, BIT(MLX5_CAP_FLOWTABLE(priv->mdev,
9898
flow_table_properties_nic_receive.log_max_ft_size)),

0 commit comments

Comments
 (0)