All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [pull request][net 0/2] Mellanox, mlx5 fixes 2019-08-15
@ 2019-08-15 18:47 Saeed Mahameed
  2019-08-15 18:47 ` [net 1/2] net/mlx5e: Fix a race with XSKICOSQ in XSK wakeup flow Saeed Mahameed
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Saeed Mahameed @ 2019-08-15 18:47 UTC (permalink / raw
  To: David S. Miller; +Cc: netdev@vger.kernel.org, Saeed Mahameed

Hi Dave,

This series introduces two fixes to mlx5 driver.

1) Eran fixes a compatibility issue with ethtool flash.
2) Maxim fixes a race in XSK wakeup flow.

Please pull and let me know if there is any problem.

Thanks,
Saeed.

---
The following changes since commit 2aafdf5a5786ebbd8ccfe132ed6267c6962c5c3c:

  selftests: net: tcp_fastopen_backup_key.sh: fix shellcheck issue (2019-08-15 11:34:32 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2019-08-15

for you to fetch changes up to f43d48d10a42787c1de1d3facd7db210c91db1da:

  net/mlx5e: Fix compatibility issue with ethtool flash device (2019-08-15 11:43:57 -0700)

----------------------------------------------------------------
mlx5-fixes-2019-08-15

----------------------------------------------------------------
Eran Ben Elisha (1):
      net/mlx5e: Fix compatibility issue with ethtool flash device

Maxim Mikityanskiy (1):
      net/mlx5e: Fix a race with XSKICOSQ in XSK wakeup flow

 drivers/net/ethernet/mellanox/mlx5/core/en.h       |  2 ++
 .../net/ethernet/mellanox/mlx5/core/en/xsk/setup.c |  3 ++
 .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   | 35 ++++++++++++++++++++++
 .../ethernet/mellanox/mlx5/core/ipoib/ethtool.c    |  9 ++++++
 4 files changed, 49 insertions(+)

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

* [net 1/2] net/mlx5e: Fix a race with XSKICOSQ in XSK wakeup flow
  2019-08-15 18:47 [pull request][net 0/2] Mellanox, mlx5 fixes 2019-08-15 Saeed Mahameed
@ 2019-08-15 18:47 ` Saeed Mahameed
  2019-08-15 18:47 ` [net 2/2] net/mlx5e: Fix compatibility issue with ethtool flash device Saeed Mahameed
  2019-08-15 19:10 ` [pull request][net 0/2] Mellanox, mlx5 fixes 2019-08-15 David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2019-08-15 18:47 UTC (permalink / raw
  To: David S. Miller
  Cc: netdev@vger.kernel.org, Maxim Mikityanskiy, Tariq Toukan,
	Saeed Mahameed

From: Maxim Mikityanskiy <maximmi@mellanox.com>

Add a missing spinlock around XSKICOSQ usage at the activation stage,
because there is a race between a configuration change and the
application calling sendto().

Fixes: db05815b36cb ("net/mlx5e: Add XSK zero-copy support")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c
index aaffa6f68dc0..7f78c004d12f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c
@@ -143,7 +143,10 @@ void mlx5e_activate_xsk(struct mlx5e_channel *c)
 {
 	set_bit(MLX5E_RQ_STATE_ENABLED, &c->xskrq.state);
 	/* TX queue is created active. */
+
+	spin_lock(&c->xskicosq_lock);
 	mlx5e_trigger_irq(&c->xskicosq);
+	spin_unlock(&c->xskicosq_lock);
 }
 
 void mlx5e_deactivate_xsk(struct mlx5e_channel *c)
-- 
2.21.0


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

* [net 2/2] net/mlx5e: Fix compatibility issue with ethtool flash device
  2019-08-15 18:47 [pull request][net 0/2] Mellanox, mlx5 fixes 2019-08-15 Saeed Mahameed
  2019-08-15 18:47 ` [net 1/2] net/mlx5e: Fix a race with XSKICOSQ in XSK wakeup flow Saeed Mahameed
@ 2019-08-15 18:47 ` Saeed Mahameed
  2019-08-15 19:10 ` [pull request][net 0/2] Mellanox, mlx5 fixes 2019-08-15 David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2019-08-15 18:47 UTC (permalink / raw
  To: David S. Miller
  Cc: netdev@vger.kernel.org, Eran Ben Elisha, Jiri Pirko,
	Saeed Mahameed

From: Eran Ben Elisha <eranbe@mellanox.com>

Cited patch deleted ethtool flash device support, as ethtool core can
fallback into devlink flash callback. However, this is supported only if
there is a devlink port registered over the corresponding netdevice.

As mlx5e do not have devlink port support over native netdevice, it broke
the ability to flash device via ethtool.

This patch re-add the ethtool callback to avoid user functionality breakage
when trying to flash device via ethtool.

Fixes: 9c8bca2637b8 ("mlx5: Move firmware flash implementation to devlink")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h  |  2 ++
 .../ethernet/mellanox/mlx5/core/en_ethtool.c  | 35 +++++++++++++++++++
 .../mellanox/mlx5/core/ipoib/ethtool.c        |  9 +++++
 3 files changed, 46 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index f6b64a03cd06..65bec19a438f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -1105,6 +1105,8 @@ u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv);
 u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv);
 int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
 			      struct ethtool_ts_info *info);
+int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv,
+			       struct ethtool_flash *flash);
 void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
 				  struct ethtool_pauseparam *pauseparam);
 int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index e89dba790a2d..20e628c907e5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -1690,6 +1690,40 @@ static int mlx5e_get_module_eeprom(struct net_device *netdev,
 	return 0;
 }
 
+int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv,
+			       struct ethtool_flash *flash)
+{
+	struct mlx5_core_dev *mdev = priv->mdev;
+	struct net_device *dev = priv->netdev;
+	const struct firmware *fw;
+	int err;
+
+	if (flash->region != ETHTOOL_FLASH_ALL_REGIONS)
+		return -EOPNOTSUPP;
+
+	err = request_firmware_direct(&fw, flash->data, &dev->dev);
+	if (err)
+		return err;
+
+	dev_hold(dev);
+	rtnl_unlock();
+
+	err = mlx5_firmware_flash(mdev, fw, NULL);
+	release_firmware(fw);
+
+	rtnl_lock();
+	dev_put(dev);
+	return err;
+}
+
+static int mlx5e_flash_device(struct net_device *dev,
+			      struct ethtool_flash *flash)
+{
+	struct mlx5e_priv *priv = netdev_priv(dev);
+
+	return mlx5e_ethtool_flash_device(priv, flash);
+}
+
 static int set_pflag_cqe_based_moder(struct net_device *netdev, bool enable,
 				     bool is_rx_cq)
 {
@@ -1972,6 +2006,7 @@ const struct ethtool_ops mlx5e_ethtool_ops = {
 	.set_wol	   = mlx5e_set_wol,
 	.get_module_info   = mlx5e_get_module_info,
 	.get_module_eeprom = mlx5e_get_module_eeprom,
+	.flash_device      = mlx5e_flash_device,
 	.get_priv_flags    = mlx5e_get_priv_flags,
 	.set_priv_flags    = mlx5e_set_priv_flags,
 	.self_test         = mlx5e_self_test,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
index ebd81f6b556e..90cb50fe17fd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
@@ -122,6 +122,14 @@ static int mlx5i_get_ts_info(struct net_device *netdev,
 	return mlx5e_ethtool_get_ts_info(priv, info);
 }
 
+static int mlx5i_flash_device(struct net_device *netdev,
+			      struct ethtool_flash *flash)
+{
+	struct mlx5e_priv *priv = mlx5i_epriv(netdev);
+
+	return mlx5e_ethtool_flash_device(priv, flash);
+}
+
 enum mlx5_ptys_width {
 	MLX5_PTYS_WIDTH_1X	= 1 << 0,
 	MLX5_PTYS_WIDTH_2X	= 1 << 1,
@@ -233,6 +241,7 @@ const struct ethtool_ops mlx5i_ethtool_ops = {
 	.get_ethtool_stats  = mlx5i_get_ethtool_stats,
 	.get_ringparam      = mlx5i_get_ringparam,
 	.set_ringparam      = mlx5i_set_ringparam,
+	.flash_device       = mlx5i_flash_device,
 	.get_channels       = mlx5i_get_channels,
 	.set_channels       = mlx5i_set_channels,
 	.get_coalesce       = mlx5i_get_coalesce,
-- 
2.21.0


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

* Re: [pull request][net 0/2] Mellanox, mlx5 fixes 2019-08-15
  2019-08-15 18:47 [pull request][net 0/2] Mellanox, mlx5 fixes 2019-08-15 Saeed Mahameed
  2019-08-15 18:47 ` [net 1/2] net/mlx5e: Fix a race with XSKICOSQ in XSK wakeup flow Saeed Mahameed
  2019-08-15 18:47 ` [net 2/2] net/mlx5e: Fix compatibility issue with ethtool flash device Saeed Mahameed
@ 2019-08-15 19:10 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-08-15 19:10 UTC (permalink / raw
  To: saeedm; +Cc: netdev

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Thu, 15 Aug 2019 18:47:04 +0000

> This series introduces two fixes to mlx5 driver.
> 
> 1) Eran fixes a compatibility issue with ethtool flash.
> 2) Maxim fixes a race in XSK wakeup flow.
> 
> Please pull and let me know if there is any problem.

Pulled, thank you.

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

end of thread, other threads:[~2019-08-15 19:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-15 18:47 [pull request][net 0/2] Mellanox, mlx5 fixes 2019-08-15 Saeed Mahameed
2019-08-15 18:47 ` [net 1/2] net/mlx5e: Fix a race with XSKICOSQ in XSK wakeup flow Saeed Mahameed
2019-08-15 18:47 ` [net 2/2] net/mlx5e: Fix compatibility issue with ethtool flash device Saeed Mahameed
2019-08-15 19:10 ` [pull request][net 0/2] Mellanox, mlx5 fixes 2019-08-15 David Miller

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.