netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10
@ 2018-05-10 23:19 Saeed Mahameed
  2018-05-10 23:19 ` [net 1/3] net/mlx5: Free IRQs in shutdown path Saeed Mahameed
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Saeed Mahameed @ 2018-05-10 23:19 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Saeed Mahameed

Hi Dave,

the following series includes some fixes for mlx5 core driver.
Please pull and let me know if there's any problem.

For -stable v4.5
("net/mlx5: E-Switch, Include VF RDMA stats in vport statistics")

For -stable v4.10
("net/mlx5e: Err if asked to offload TC match on frag being first")

Thanks,
Saeed.

---

The following changes since commit ca3943c4aaff083bc25419f04e549e293590258e:

  Merge tag 'linux-can-fixes-for-4.17-20180510' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can (2018-05-10 17:57:11 -0400)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2018-05-10

for you to fetch changes up to f85900c3e13fdb61f040c9feecbcda601e0cdcfb:

  net/mlx5e: Err if asked to offload TC match on frag being first (2018-05-10 16:10:13 -0700)

----------------------------------------------------------------
mlx5-fixes-2018-05-10

----------------------------------------------------------------
Adi Nissim (1):
      net/mlx5: E-Switch, Include VF RDMA stats in vport statistics

Daniel Jurgens (1):
      net/mlx5: Free IRQs in shutdown path

Roi Dayan (1):
      net/mlx5e: Err if asked to offload TC match on frag being first

 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c    |  4 ++++
 drivers/net/ethernet/mellanox/mlx5/core/eq.c       | 28 ++++++++++++++++++++++
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c  | 11 ++++++++-
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  8 +++++++
 .../net/ethernet/mellanox/mlx5/core/mlx5_core.h    |  2 ++
 5 files changed, 52 insertions(+), 1 deletion(-)

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

* [net 1/3] net/mlx5: Free IRQs in shutdown path
  2018-05-10 23:19 [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10 Saeed Mahameed
@ 2018-05-10 23:19 ` Saeed Mahameed
  2018-05-10 23:19 ` [net 2/3] net/mlx5: E-Switch, Include VF RDMA stats in vport statistics Saeed Mahameed
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2018-05-10 23:19 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Daniel Jurgens, Saeed Mahameed

From: Daniel Jurgens <danielj@mellanox.com>

Some platforms require IRQs to be free'd in the shutdown path. Otherwise
they will fail to be reallocated after a kexec.

Fixes: 8812c24d28f4 ("net/mlx5: Add fast unload support in shutdown flow")
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eq.c       | 28 ++++++++++++++++++++++
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  8 +++++++
 .../net/ethernet/mellanox/mlx5/core/mlx5_core.h    |  2 ++
 3 files changed, 38 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
index c1c94974e16b..1814f803bd2c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
@@ -34,6 +34,9 @@
 #include <linux/module.h>
 #include <linux/mlx5/driver.h>
 #include <linux/mlx5/cmd.h>
+#ifdef CONFIG_RFS_ACCEL
+#include <linux/cpu_rmap.h>
+#endif
 #include "mlx5_core.h"
 #include "fpga/core.h"
 #include "eswitch.h"
@@ -923,3 +926,28 @@ int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq,
 	MLX5_SET(query_eq_in, in, eq_number, eq->eqn);
 	return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen);
 }
+
+/* This function should only be called after mlx5_cmd_force_teardown_hca */
+void mlx5_core_eq_free_irqs(struct mlx5_core_dev *dev)
+{
+	struct mlx5_eq_table *table = &dev->priv.eq_table;
+	struct mlx5_eq *eq;
+
+#ifdef CONFIG_RFS_ACCEL
+	if (dev->rmap) {
+		free_irq_cpu_rmap(dev->rmap);
+		dev->rmap = NULL;
+	}
+#endif
+	list_for_each_entry(eq, &table->comp_eqs_list, list)
+		free_irq(eq->irqn, eq);
+
+	free_irq(table->pages_eq.irqn, &table->pages_eq);
+	free_irq(table->async_eq.irqn, &table->async_eq);
+	free_irq(table->cmd_eq.irqn, &table->cmd_eq);
+#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
+	if (MLX5_CAP_GEN(dev, pg))
+		free_irq(table->pfault_eq.irqn, &table->pfault_eq);
+#endif
+	pci_free_irq_vectors(dev->pdev);
+}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 63a8ea31601c..e2c465b0b3f8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1587,6 +1587,14 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev *dev)
 
 	mlx5_enter_error_state(dev, true);
 
+	/* Some platforms requiring freeing the IRQ's in the shutdown
+	 * flow. If they aren't freed they can't be allocated after
+	 * kexec. There is no need to cleanup the mlx5_core software
+	 * contexts.
+	 */
+	mlx5_irq_clear_affinity_hints(dev);
+	mlx5_core_eq_free_irqs(dev);
+
 	return 0;
 }
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
index 7d001fe6e631..023882d9a22e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
@@ -128,6 +128,8 @@ int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq,
 		       u32 *out, int outlen);
 int mlx5_start_eqs(struct mlx5_core_dev *dev);
 void mlx5_stop_eqs(struct mlx5_core_dev *dev);
+/* This function should only be called after mlx5_cmd_force_teardown_hca */
+void mlx5_core_eq_free_irqs(struct mlx5_core_dev *dev);
 struct mlx5_eq *mlx5_eqn2eq(struct mlx5_core_dev *dev, int eqn);
 u32 mlx5_eq_poll_irq_disabled(struct mlx5_eq *eq);
 void mlx5_cq_tasklet_cb(unsigned long data);
-- 
2.14.3

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

* [net 2/3] net/mlx5: E-Switch, Include VF RDMA stats in vport statistics
  2018-05-10 23:19 [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10 Saeed Mahameed
  2018-05-10 23:19 ` [net 1/3] net/mlx5: Free IRQs in shutdown path Saeed Mahameed
@ 2018-05-10 23:19 ` Saeed Mahameed
  2018-05-10 23:19 ` [net 3/3] net/mlx5e: Err if asked to offload TC match on frag being first Saeed Mahameed
  2018-05-11 16:27 ` [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10 David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2018-05-10 23:19 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Adi Nissim, Saeed Mahameed

From: Adi Nissim <adin@mellanox.com>

The host side reporting of VF vport statistics didn't include the VF
RDMA traffic.

Fixes: 3b751a2a418a ("net/mlx5: E-Switch, Introduce get vf statistics")
Signed-off-by: Adi Nissim <adin@mellanox.com>
Reported-by: Ariel Almog <ariela@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 332bc56306bf..1352d13eedb3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -2175,26 +2175,35 @@ int mlx5_eswitch_get_vport_stats(struct mlx5_eswitch *esw,
 	memset(vf_stats, 0, sizeof(*vf_stats));
 	vf_stats->rx_packets =
 		MLX5_GET_CTR(out, received_eth_unicast.packets) +
+		MLX5_GET_CTR(out, received_ib_unicast.packets) +
 		MLX5_GET_CTR(out, received_eth_multicast.packets) +
+		MLX5_GET_CTR(out, received_ib_multicast.packets) +
 		MLX5_GET_CTR(out, received_eth_broadcast.packets);
 
 	vf_stats->rx_bytes =
 		MLX5_GET_CTR(out, received_eth_unicast.octets) +
+		MLX5_GET_CTR(out, received_ib_unicast.octets) +
 		MLX5_GET_CTR(out, received_eth_multicast.octets) +
+		MLX5_GET_CTR(out, received_ib_multicast.octets) +
 		MLX5_GET_CTR(out, received_eth_broadcast.octets);
 
 	vf_stats->tx_packets =
 		MLX5_GET_CTR(out, transmitted_eth_unicast.packets) +
+		MLX5_GET_CTR(out, transmitted_ib_unicast.packets) +
 		MLX5_GET_CTR(out, transmitted_eth_multicast.packets) +
+		MLX5_GET_CTR(out, transmitted_ib_multicast.packets) +
 		MLX5_GET_CTR(out, transmitted_eth_broadcast.packets);
 
 	vf_stats->tx_bytes =
 		MLX5_GET_CTR(out, transmitted_eth_unicast.octets) +
+		MLX5_GET_CTR(out, transmitted_ib_unicast.octets) +
 		MLX5_GET_CTR(out, transmitted_eth_multicast.octets) +
+		MLX5_GET_CTR(out, transmitted_ib_multicast.octets) +
 		MLX5_GET_CTR(out, transmitted_eth_broadcast.octets);
 
 	vf_stats->multicast =
-		MLX5_GET_CTR(out, received_eth_multicast.packets);
+		MLX5_GET_CTR(out, received_eth_multicast.packets) +
+		MLX5_GET_CTR(out, received_ib_multicast.packets);
 
 	vf_stats->broadcast =
 		MLX5_GET_CTR(out, received_eth_broadcast.packets);
-- 
2.14.3

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

* [net 3/3] net/mlx5e: Err if asked to offload TC match on frag being first
  2018-05-10 23:19 [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10 Saeed Mahameed
  2018-05-10 23:19 ` [net 1/3] net/mlx5: Free IRQs in shutdown path Saeed Mahameed
  2018-05-10 23:19 ` [net 2/3] net/mlx5: E-Switch, Include VF RDMA stats in vport statistics Saeed Mahameed
@ 2018-05-10 23:19 ` Saeed Mahameed
  2018-05-11 16:27 ` [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10 David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2018-05-10 23:19 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Roi Dayan, Saeed Mahameed

From: Roi Dayan <roid@mellanox.com>

The HW doesn't support matching on frag first/later, return error if we are
asked to offload that.

Fixes: 3f7d0eb42d59 ("net/mlx5e: Offload TC matching on packets being IP fragments")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 3c534fc43400..b94276db3ce9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1261,6 +1261,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
 						  f->mask);
 		addr_type = key->addr_type;
 
+		/* the HW doesn't support frag first/later */
+		if (mask->flags & FLOW_DIS_FIRST_FRAG)
+			return -EOPNOTSUPP;
+
 		if (mask->flags & FLOW_DIS_IS_FRAGMENT) {
 			MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1);
 			MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag,
-- 
2.14.3

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

* Re: [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10
  2018-05-10 23:19 [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2018-05-10 23:19 ` [net 3/3] net/mlx5e: Err if asked to offload TC match on frag being first Saeed Mahameed
@ 2018-05-11 16:27 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-05-11 16:27 UTC (permalink / raw)
  To: saeedm; +Cc: netdev

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Thu, 10 May 2018 16:19:12 -0700

> the following series includes some fixes for mlx5 core driver.
> Please pull and let me know if there's any problem.

Pulled.

> For -stable v4.5
> ("net/mlx5: E-Switch, Include VF RDMA stats in vport statistics")
> 
> For -stable v4.10
> ("net/mlx5e: Err if asked to offload TC match on frag being first")

Queued up for -stable.

Thanks.

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

end of thread, other threads:[~2018-05-11 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-10 23:19 [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10 Saeed Mahameed
2018-05-10 23:19 ` [net 1/3] net/mlx5: Free IRQs in shutdown path Saeed Mahameed
2018-05-10 23:19 ` [net 2/3] net/mlx5: E-Switch, Include VF RDMA stats in vport statistics Saeed Mahameed
2018-05-10 23:19 ` [net 3/3] net/mlx5e: Err if asked to offload TC match on frag being first Saeed Mahameed
2018-05-11 16:27 ` [pull request][net 0/3] Mellanox, mlx5 fixes 2018-05-10 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).