All of lore.kernel.org
 help / color / mirror / Atom feed
* [pull request][net 0/7] mlx5 fixes 2021-09-07
@ 2021-09-07 21:24 Saeed Mahameed
  2021-09-07 21:24 ` [net 1/7] net/mlx5: Bridge, fix uninitialized variable usage Saeed Mahameed
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Saeed Mahameed @ 2021-09-07 21:24 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: netdev, Saeed Mahameed

From: Saeed Mahameed <saeedm@nvidia.com>

Hi Dave, Jakub, 

This series introduces some fixes to mlx5 driver.
Please pull and let me know if there is any problem.

Included here, a patch which solves a build warning reported on
linux-kernel mailing list [1]:
Fix commit ("net/mlx5: Bridge, fix uninitialized variable usage")

I hope this series can make it to rc1.

[1] https://www.spinics.net/lists/netdev/msg765481.html

Thanks,
Saeed.

---
The following changes since commit 0f77f2defaf682eb7e7ef623168e49c74ae529e3:

  ieee802154: Remove redundant initialization of variable ret (2021-09-07 14:06:08 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2021-09-07

for you to fetch changes up to 8db6a54f3cae6a803b2cbf5390662bca641f7da8:

  net/mlx5e: Fix condition when retrieving PTP-rqn (2021-09-07 14:17:02 -0700)

----------------------------------------------------------------
mlx5-fixes-2021-09-07

----------------------------------------------------------------
Aya Levin (2):
      net/mlx5e: Fix mutual exclusion between CQE compression and HW TS
      net/mlx5e: Fix condition when retrieving PTP-rqn

Maor Gottlieb (1):
      net/mlx5: Fix potential sleeping in atomic context

Mark Bloch (1):
      net/mlx5: Lag, don't update lag if lag isn't supported

Parav Pandit (1):
      net/mlx5: Fix rdma aux device on devlink reload

Saeed Mahameed (1):
      net/mlx5: FWTrace, cancel work on alloc pd error flow

Vlad Buslov (1):
      net/mlx5: Bridge, fix uninitialized variable usage

 drivers/net/ethernet/mellanox/mlx5/core/devlink.c        |  7 ++-----
 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c |  3 ++-
 drivers/net/ethernet/mellanox/mlx5/core/en.h             |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c  |  4 ++--
 drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c      |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c     | 11 ++++++-----
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c        |  4 ++--
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c        |  5 ++---
 drivers/net/ethernet/mellanox/mlx5/core/lag.c            | 10 ++++++++--
 9 files changed, 26 insertions(+), 22 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [net 1/7] net/mlx5: Bridge, fix uninitialized variable usage
  2021-09-07 21:24 [pull request][net 0/7] mlx5 fixes 2021-09-07 Saeed Mahameed
@ 2021-09-07 21:24 ` Saeed Mahameed
  2021-09-08 10:50   ` patchwork-bot+netdevbpf
  2021-09-07 21:24 ` [net 2/7] net/mlx5: Fix rdma aux device on devlink reload Saeed Mahameed
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Saeed Mahameed @ 2021-09-07 21:24 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Vlad Buslov, Colin King, Tim Gardner, Naresh Kamboju,
	linux-kernel, Saeed Mahameed

From: Vlad Buslov <vladbu@nvidia.com>

In some conditions variable 'err' is not assigned with value in
mlx5_esw_bridge_port_obj_attr_set() and mlx5_esw_bridge_port_changeupper()
functions after recent changes to support LAG. Initialize the variable with
zero value in both cases.

Reported-by: Colin King <colin.king@canonical.com>
Reported-by: Tim Gardner <tim.gardner@canonical.com>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
CC: linux-kernel@vger.kernel.org
Fixes: ff9b7521468b ("net/mlx5: Bridge, support LAG")
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
index 0c38c2e319be..b5ddaa82755f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
@@ -137,7 +137,7 @@ static int mlx5_esw_bridge_port_changeupper(struct notifier_block *nb, void *ptr
 	u16 vport_num, esw_owner_vhca_id;
 	struct netlink_ext_ack *extack;
 	int ifindex = upper->ifindex;
-	int err;
+	int err = 0;
 
 	if (!netif_is_bridge_master(upper))
 		return 0;
@@ -244,7 +244,7 @@ mlx5_esw_bridge_port_obj_attr_set(struct net_device *dev,
 	struct netlink_ext_ack *extack = switchdev_notifier_info_to_extack(&port_attr_info->info);
 	const struct switchdev_attr *attr = port_attr_info->attr;
 	u16 vport_num, esw_owner_vhca_id;
-	int err;
+	int err = 0;
 
 	if (!mlx5_esw_bridge_lower_rep_vport_num_vhca_id_get(dev, br_offloads->esw, &vport_num,
 							     &esw_owner_vhca_id))
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net 2/7] net/mlx5: Fix rdma aux device on devlink reload
  2021-09-07 21:24 [pull request][net 0/7] mlx5 fixes 2021-09-07 Saeed Mahameed
  2021-09-07 21:24 ` [net 1/7] net/mlx5: Bridge, fix uninitialized variable usage Saeed Mahameed
@ 2021-09-07 21:24 ` Saeed Mahameed
  2021-09-07 21:24 ` [net 3/7] net/mlx5: Lag, don't update lag if lag isn't supported Saeed Mahameed
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2021-09-07 21:24 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Parav Pandit, Shay Drory, Saeed Mahameed

From: Parav Pandit <parav@nvidia.com>

RDMA auxdev parameter registration was skipped for eswitch manager PCI PF.
Due to this when devlink parameter is read, it reads as false in below
code flow.

$ devlink dev reload pci/0000:06:00.0
  devlink_reload()
    mlx5_load_one()
      mlx5_attach_device()
        is_ib_enabled()
          devlink_param_driverinit_value_get()

Due to this, is_ib_enabled() returns false for the RDMA auxiliary
device. This results into a skipping RDMA auxiliary device creation on
reload.

There is no need to check for eswitch manager capability to support RDMA
auxiliary device. Hence, fix it by skipping eswitch manager capability.

Fixes: 87158cedf00e ("net/mlx5: Support enable_rdma devlink dev param")
Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
index e84287ffc7ce..dcf9f27ba2ef 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
@@ -658,11 +658,10 @@ static const struct devlink_param enable_rdma_param =
 
 static int mlx5_devlink_rdma_param_register(struct devlink *devlink)
 {
-	struct mlx5_core_dev *dev = devlink_priv(devlink);
 	union devlink_param_value value;
 	int err;
 
-	if (!IS_ENABLED(CONFIG_MLX5_INFINIBAND) || MLX5_ESWITCH_MANAGER(dev))
+	if (!IS_ENABLED(CONFIG_MLX5_INFINIBAND))
 		return 0;
 
 	err = devlink_param_register(devlink, &enable_rdma_param);
@@ -679,9 +678,7 @@ static int mlx5_devlink_rdma_param_register(struct devlink *devlink)
 
 static void mlx5_devlink_rdma_param_unregister(struct devlink *devlink)
 {
-	struct mlx5_core_dev *dev = devlink_priv(devlink);
-
-	if (!IS_ENABLED(CONFIG_MLX5_INFINIBAND) || MLX5_ESWITCH_MANAGER(dev))
+	if (!IS_ENABLED(CONFIG_MLX5_INFINIBAND))
 		return;
 
 	devlink_param_unpublish(devlink, &enable_rdma_param);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net 3/7] net/mlx5: Lag, don't update lag if lag isn't supported
  2021-09-07 21:24 [pull request][net 0/7] mlx5 fixes 2021-09-07 Saeed Mahameed
  2021-09-07 21:24 ` [net 1/7] net/mlx5: Bridge, fix uninitialized variable usage Saeed Mahameed
  2021-09-07 21:24 ` [net 2/7] net/mlx5: Fix rdma aux device on devlink reload Saeed Mahameed
@ 2021-09-07 21:24 ` Saeed Mahameed
  2021-09-07 21:24 ` [net 4/7] net/mlx5: FWTrace, cancel work on alloc pd error flow Saeed Mahameed
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2021-09-07 21:24 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Mark Bloch, Maor Gottlieb, Leon Romanovsky, Saeed Mahameed

From: Mark Bloch <mbloch@nvidia.com>

In NICs that don't support LAG, the LAG control structure won't be
allocated. If it wasn't allocated it means LAG doesn't exists and can be
skipped.

Fixes: cac1eb2cf2e3 ("net/mlx5: Lag, properly lock eswitch if needed")
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/lag.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag.c
index 49ca57c6d31d..ca5690b0a7ab 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag.c
@@ -927,9 +927,12 @@ void mlx5_lag_disable_change(struct mlx5_core_dev *dev)
 	struct mlx5_core_dev *dev1;
 	struct mlx5_lag *ldev;
 
+	ldev = mlx5_lag_dev(dev);
+	if (!ldev)
+		return;
+
 	mlx5_dev_list_lock();
 
-	ldev = mlx5_lag_dev(dev);
 	dev0 = ldev->pf[MLX5_LAG_P1].dev;
 	dev1 = ldev->pf[MLX5_LAG_P2].dev;
 
@@ -946,8 +949,11 @@ void mlx5_lag_enable_change(struct mlx5_core_dev *dev)
 {
 	struct mlx5_lag *ldev;
 
-	mlx5_dev_list_lock();
 	ldev = mlx5_lag_dev(dev);
+	if (!ldev)
+		return;
+
+	mlx5_dev_list_lock();
 	ldev->mode_changes_in_progress--;
 	mlx5_dev_list_unlock();
 	mlx5_queue_bond_work(ldev, 0);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net 4/7] net/mlx5: FWTrace, cancel work on alloc pd error flow
  2021-09-07 21:24 [pull request][net 0/7] mlx5 fixes 2021-09-07 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2021-09-07 21:24 ` [net 3/7] net/mlx5: Lag, don't update lag if lag isn't supported Saeed Mahameed
@ 2021-09-07 21:24 ` Saeed Mahameed
  2021-09-11  7:43   ` Pavel Machek
  2021-09-07 21:24 ` [net 5/7] net/mlx5: Fix potential sleeping in atomic context Saeed Mahameed
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Saeed Mahameed @ 2021-09-07 21:24 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Saeed Mahameed, Pavel Machek, Aya Levin

From: Saeed Mahameed <saeedm@nvidia.com>

Handle error flow on mlx5_core_alloc_pd() failure,
read_fw_strings_work must be canceled.

Fixes: c71ad41ccb0c ("net/mlx5: FW tracer, events handling")
Reported-by: Pavel Machek (CIP) <pavel@denx.de>
Suggested-by: Pavel Machek (CIP) <pavel@denx.de>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Aya Levin <ayal@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
index 3f8a98093f8c..f9cf9fb31547 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
@@ -1007,7 +1007,7 @@ int mlx5_fw_tracer_init(struct mlx5_fw_tracer *tracer)
 	err = mlx5_core_alloc_pd(dev, &tracer->buff.pdn);
 	if (err) {
 		mlx5_core_warn(dev, "FWTracer: Failed to allocate PD %d\n", err);
-		return err;
+		goto err_cancel_work;
 	}
 
 	err = mlx5_fw_tracer_create_mkey(tracer);
@@ -1031,6 +1031,7 @@ int mlx5_fw_tracer_init(struct mlx5_fw_tracer *tracer)
 	mlx5_core_destroy_mkey(dev, &tracer->buff.mkey);
 err_dealloc_pd:
 	mlx5_core_dealloc_pd(dev, tracer->buff.pdn);
+err_cancel_work:
 	cancel_work_sync(&tracer->read_fw_strings_work);
 	return err;
 }
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net 5/7] net/mlx5: Fix potential sleeping in atomic context
  2021-09-07 21:24 [pull request][net 0/7] mlx5 fixes 2021-09-07 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2021-09-07 21:24 ` [net 4/7] net/mlx5: FWTrace, cancel work on alloc pd error flow Saeed Mahameed
@ 2021-09-07 21:24 ` Saeed Mahameed
  2021-09-07 21:24 ` [net 6/7] net/mlx5e: Fix mutual exclusion between CQE compression and HW TS Saeed Mahameed
  2021-09-07 21:24 ` [net 7/7] net/mlx5e: Fix condition when retrieving PTP-rqn Saeed Mahameed
  6 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2021-09-07 21:24 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Maor Gottlieb, Dan Carpenter, Saeed Mahameed

From: Maor Gottlieb <maorg@nvidia.com>

Fixes the below flow of sleeping in atomic context by releasing
the RCU lock before calling to free_match_list.

build_match_list() <- disables preempt
-> free_match_list()
   -> tree_put_node()
      -> down_write_ref_node() <- take write lock

Fixes: 693c6883bbc4 ("net/mlx5: Add hash table for flow groups in flow table")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 9fe8e3c204d6..fe501ba88bea 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1682,14 +1682,13 @@ static int build_match_list(struct match_list *match_head,
 
 		curr_match = kmalloc(sizeof(*curr_match), GFP_ATOMIC);
 		if (!curr_match) {
+			rcu_read_unlock();
 			free_match_list(match_head, ft_locked);
-			err = -ENOMEM;
-			goto out;
+			return -ENOMEM;
 		}
 		curr_match->g = g;
 		list_add_tail(&curr_match->list, &match_head->list);
 	}
-out:
 	rcu_read_unlock();
 	return err;
 }
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net 6/7] net/mlx5e: Fix mutual exclusion between CQE compression and HW TS
  2021-09-07 21:24 [pull request][net 0/7] mlx5 fixes 2021-09-07 Saeed Mahameed
                   ` (4 preceding siblings ...)
  2021-09-07 21:24 ` [net 5/7] net/mlx5: Fix potential sleeping in atomic context Saeed Mahameed
@ 2021-09-07 21:24 ` Saeed Mahameed
  2021-09-07 21:24 ` [net 7/7] net/mlx5e: Fix condition when retrieving PTP-rqn Saeed Mahameed
  6 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2021-09-07 21:24 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Aya Levin, Moshe Shemesh, Saeed Mahameed

From: Aya Levin <ayal@nvidia.com>

Some profiles of the driver don't support a dedicated PTP-RQ, hence can't
support HW TS and CQE compression simultaneously. When HW TS is enabled
the COE compression is disabled, and should be restored when the HW TS
is turned off. Add rx_filter as an input to modifying CQE compression to
enforce this restriction.

Fixes: 256f79d13c1d ("net/mlx5e: Fix HW TS with CQE compression according to profile")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h         |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 11 ++++++-----
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c    |  4 ++--
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 669a75f3537a..7b8c8187543a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -922,7 +922,7 @@ void mlx5e_set_rx_mode_work(struct work_struct *work);
 
 int mlx5e_hwstamp_set(struct mlx5e_priv *priv, struct ifreq *ifr);
 int mlx5e_hwstamp_get(struct mlx5e_priv *priv, struct ifreq *ifr);
-int mlx5e_modify_rx_cqe_compression_locked(struct mlx5e_priv *priv, bool val);
+int mlx5e_modify_rx_cqe_compression_locked(struct mlx5e_priv *priv, bool val, bool rx_filter);
 
 int mlx5e_vlan_rx_add_vid(struct net_device *dev, __always_unused __be16 proto,
 			  u16 vid);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 2cfd12953909..306fb5d6a36d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -1884,7 +1884,7 @@ static int set_pflag_rx_cqe_based_moder(struct net_device *netdev, bool enable)
 	return set_pflag_cqe_based_moder(netdev, enable, true);
 }
 
-int mlx5e_modify_rx_cqe_compression_locked(struct mlx5e_priv *priv, bool new_val)
+int mlx5e_modify_rx_cqe_compression_locked(struct mlx5e_priv *priv, bool new_val, bool rx_filter)
 {
 	bool curr_val = MLX5E_GET_PFLAG(&priv->channels.params, MLX5E_PFLAG_RX_CQE_COMPRESS);
 	struct mlx5e_params new_params;
@@ -1896,8 +1896,7 @@ int mlx5e_modify_rx_cqe_compression_locked(struct mlx5e_priv *priv, bool new_val
 	if (curr_val == new_val)
 		return 0;
 
-	if (new_val && !priv->profile->rx_ptp_support &&
-	    priv->tstamp.rx_filter != HWTSTAMP_FILTER_NONE) {
+	if (new_val && !priv->profile->rx_ptp_support && rx_filter) {
 		netdev_err(priv->netdev,
 			   "Profile doesn't support enabling of CQE compression while hardware time-stamping is enabled.\n");
 		return -EINVAL;
@@ -1905,7 +1904,7 @@ int mlx5e_modify_rx_cqe_compression_locked(struct mlx5e_priv *priv, bool new_val
 
 	new_params = priv->channels.params;
 	MLX5E_SET_PFLAG(&new_params, MLX5E_PFLAG_RX_CQE_COMPRESS, new_val);
-	if (priv->tstamp.rx_filter != HWTSTAMP_FILTER_NONE)
+	if (rx_filter)
 		new_params.ptp_rx = new_val;
 
 	if (new_params.ptp_rx == priv->channels.params.ptp_rx)
@@ -1928,12 +1927,14 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev,
 {
 	struct mlx5e_priv *priv = netdev_priv(netdev);
 	struct mlx5_core_dev *mdev = priv->mdev;
+	bool rx_filter;
 	int err;
 
 	if (!MLX5_CAP_GEN(mdev, cqe_compression))
 		return -EOPNOTSUPP;
 
-	err = mlx5e_modify_rx_cqe_compression_locked(priv, enable);
+	rx_filter = priv->tstamp.rx_filter != HWTSTAMP_FILTER_NONE;
+	err = mlx5e_modify_rx_cqe_compression_locked(priv, enable, rx_filter);
 	if (err)
 		return err;
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 47efd858964d..3fd515e7bf30 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3554,14 +3554,14 @@ static int mlx5e_hwstamp_config_no_ptp_rx(struct mlx5e_priv *priv, bool rx_filte
 
 	if (!rx_filter)
 		/* Reset CQE compression to Admin default */
-		return mlx5e_modify_rx_cqe_compression_locked(priv, rx_cqe_compress_def);
+		return mlx5e_modify_rx_cqe_compression_locked(priv, rx_cqe_compress_def, false);
 
 	if (!MLX5E_GET_PFLAG(&priv->channels.params, MLX5E_PFLAG_RX_CQE_COMPRESS))
 		return 0;
 
 	/* Disable CQE compression */
 	netdev_warn(priv->netdev, "Disabling RX cqe compression\n");
-	err = mlx5e_modify_rx_cqe_compression_locked(priv, false);
+	err = mlx5e_modify_rx_cqe_compression_locked(priv, false, true);
 	if (err)
 		netdev_err(priv->netdev, "Failed disabling cqe compression err=%d\n", err);
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net 7/7] net/mlx5e: Fix condition when retrieving PTP-rqn
  2021-09-07 21:24 [pull request][net 0/7] mlx5 fixes 2021-09-07 Saeed Mahameed
                   ` (5 preceding siblings ...)
  2021-09-07 21:24 ` [net 6/7] net/mlx5e: Fix mutual exclusion between CQE compression and HW TS Saeed Mahameed
@ 2021-09-07 21:24 ` Saeed Mahameed
  2021-09-08 16:39   ` Jakub Kicinski
  6 siblings, 1 reply; 12+ messages in thread
From: Saeed Mahameed @ 2021-09-07 21:24 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: netdev, Aya Levin, Tariq Toukan, Saeed Mahameed

From: Aya Levin <ayal@nvidia.com>

When activating the PTP-RQ, redirect the RQT from drop-RQ to PTP-RQ.
Use mlx5e_channels_get_ptp_rqn to retrieve the rqn. This helper returns
a boolean (not status), hence caller should consider return value 0 as a
fail. Change the caller interpretation of the return value.

Fixes: 43ec0f41fa73 ("net/mlx5e: Hide all implementation details of mlx5e_rx_res")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c
index bf0313e2682b..13056cb9757d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c
@@ -572,7 +572,7 @@ void mlx5e_rx_res_channels_activate(struct mlx5e_rx_res *res, struct mlx5e_chann
 	if (res->features & MLX5E_RX_RES_FEATURE_PTP) {
 		u32 rqn;
 
-		if (mlx5e_channels_get_ptp_rqn(chs, &rqn))
+		if (!mlx5e_channels_get_ptp_rqn(chs, &rqn))
 			rqn = res->drop_rqn;
 
 		err = mlx5e_rqt_redirect_direct(&res->ptp.rqt, rqn);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [net 1/7] net/mlx5: Bridge, fix uninitialized variable usage
  2021-09-07 21:24 ` [net 1/7] net/mlx5: Bridge, fix uninitialized variable usage Saeed Mahameed
@ 2021-09-08 10:50   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-08 10:50 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: davem, kuba, netdev, vladbu, colin.king, tim.gardner,
	naresh.kamboju, linux-kernel, saeedm

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Tue,  7 Sep 2021 14:24:14 -0700 you wrote:
> From: Vlad Buslov <vladbu@nvidia.com>
> 
> In some conditions variable 'err' is not assigned with value in
> mlx5_esw_bridge_port_obj_attr_set() and mlx5_esw_bridge_port_changeupper()
> functions after recent changes to support LAG. Initialize the variable with
> zero value in both cases.
> 
> [...]

Here is the summary with links:
  - [net,1/7] net/mlx5: Bridge, fix uninitialized variable usage
    https://git.kernel.org/netdev/net/c/8343268ec3cf
  - [net,2/7] net/mlx5: Fix rdma aux device on devlink reload
    https://git.kernel.org/netdev/net/c/897ae4b40e80
  - [net,3/7] net/mlx5: Lag, don't update lag if lag isn't supported
    https://git.kernel.org/netdev/net/c/da8252d5805d
  - [net,4/7] net/mlx5: FWTrace, cancel work on alloc pd error flow
    https://git.kernel.org/netdev/net/c/dfe6fd72b5f1
  - [net,5/7] net/mlx5: Fix potential sleeping in atomic context
    https://git.kernel.org/netdev/net/c/ee27e330a953
  - [net,6/7] net/mlx5e: Fix mutual exclusion between CQE compression and HW TS
    https://git.kernel.org/netdev/net/c/c91c1da72b47
  - [net,7/7] net/mlx5e: Fix condition when retrieving PTP-rqn
    https://git.kernel.org/netdev/net/c/8db6a54f3cae

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [net 7/7] net/mlx5e: Fix condition when retrieving PTP-rqn
  2021-09-07 21:24 ` [net 7/7] net/mlx5e: Fix condition when retrieving PTP-rqn Saeed Mahameed
@ 2021-09-08 16:39   ` Jakub Kicinski
  2021-09-08 17:34     ` Saeed Mahameed
  0 siblings, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2021-09-08 16:39 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: David S. Miller, netdev, Aya Levin, Tariq Toukan, Saeed Mahameed

On Tue,  7 Sep 2021 14:24:20 -0700 Saeed Mahameed wrote:
> From: Aya Levin <ayal@nvidia.com>
> 
> When activating the PTP-RQ, redirect the RQT from drop-RQ to PTP-RQ.
> Use mlx5e_channels_get_ptp_rqn to retrieve the rqn. This helper returns
> a boolean (not status), hence caller should consider return value 0 as a
> fail. Change the caller interpretation of the return value.

It would be really great to turn down the dial on the abbreviations and
add some user-visible impact, as is best practice (some would say a
requirement) for fixes.

I've been following the PTP work in mlx5 a little bit but I have no idea
what a RQT is and what kind of issues to expect without this patch.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [net 7/7] net/mlx5e: Fix condition when retrieving PTP-rqn
  2021-09-08 16:39   ` Jakub Kicinski
@ 2021-09-08 17:34     ` Saeed Mahameed
  0 siblings, 0 replies; 12+ messages in thread
From: Saeed Mahameed @ 2021-09-08 17:34 UTC (permalink / raw)
  To: kuba; +Cc: Tariq Toukan, davem, netdev, Aya Levin

On Wed, 2021-09-08 at 09:39 -0700, Jakub Kicinski wrote:
> On Tue,  7 Sep 2021 14:24:20 -0700 Saeed Mahameed wrote:
> > From: Aya Levin <ayal@nvidia.com>
> > 
> > When activating the PTP-RQ, redirect the RQT from drop-RQ to PTP-
> > RQ.
> > Use mlx5e_channels_get_ptp_rqn to retrieve the rqn. This helper
> > returns
> > a boolean (not status), hence caller should consider return value 0
> > as a
> > fail. Change the caller interpretation of the return value.
> 
> It would be really great to turn down the dial on the abbreviations
> and
> add some user-visible impact, as is best practice (some would say a
> requirement) for fixes.
> 

Ack and agreed ! I will enforce this.

> I've been following the PTP work in mlx5 a little bit but I have no
> idea
> what a RQT is and what kind of issues to expect without this patch.

RQT is a simple RQ Table; where we group rq numbers in one table object
so steering and RSS objects can point to a table of RQs.

To simplify driver code: 
 1. we use RQT objects also for single RQ destinations.
 2. HW/FW do not allow destroying RQs when they are directly being
referenced by Steering rules. RQTs help keeping steering objects
pointing to a valid RQT object  while driver is destroying RQs, while
re-configuring, we just swap the rq number in the RQT with the new
configuration RQs, or when device is deactivated (ifconfig down) we
just swap all RQ numbers in all RQTs with the "Drop RQ"






^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [net 4/7] net/mlx5: FWTrace, cancel work on alloc pd error flow
  2021-09-07 21:24 ` [net 4/7] net/mlx5: FWTrace, cancel work on alloc pd error flow Saeed Mahameed
@ 2021-09-11  7:43   ` Pavel Machek
  0 siblings, 0 replies; 12+ messages in thread
From: Pavel Machek @ 2021-09-11  7:43 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: David S. Miller, Jakub Kicinski, netdev, Saeed Mahameed,
	Pavel Machek, Aya Levin

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

On Tue 2021-09-07 14:24:17, Saeed Mahameed wrote:
> From: Saeed Mahameed <saeedm@nvidia.com>
> 
> Handle error flow on mlx5_core_alloc_pd() failure,
> read_fw_strings_work must be canceled.
> 
> Fixes: c71ad41ccb0c ("net/mlx5: FW tracer, events handling")

Reviewed-by: Pavel Machek (CIP) <pavel@denx.de>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-09-11  7:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 21:24 [pull request][net 0/7] mlx5 fixes 2021-09-07 Saeed Mahameed
2021-09-07 21:24 ` [net 1/7] net/mlx5: Bridge, fix uninitialized variable usage Saeed Mahameed
2021-09-08 10:50   ` patchwork-bot+netdevbpf
2021-09-07 21:24 ` [net 2/7] net/mlx5: Fix rdma aux device on devlink reload Saeed Mahameed
2021-09-07 21:24 ` [net 3/7] net/mlx5: Lag, don't update lag if lag isn't supported Saeed Mahameed
2021-09-07 21:24 ` [net 4/7] net/mlx5: FWTrace, cancel work on alloc pd error flow Saeed Mahameed
2021-09-11  7:43   ` Pavel Machek
2021-09-07 21:24 ` [net 5/7] net/mlx5: Fix potential sleeping in atomic context Saeed Mahameed
2021-09-07 21:24 ` [net 6/7] net/mlx5e: Fix mutual exclusion between CQE compression and HW TS Saeed Mahameed
2021-09-07 21:24 ` [net 7/7] net/mlx5e: Fix condition when retrieving PTP-rqn Saeed Mahameed
2021-09-08 16:39   ` Jakub Kicinski
2021-09-08 17:34     ` Saeed Mahameed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.