netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] mlx4 misc fixes
@ 2017-05-09 11:45 Tariq Toukan
  2017-05-09 11:45 ` [PATCH net 1/3] net/mlx4_en: Change the error print to debug print Tariq Toukan
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Tariq Toukan @ 2017-05-09 11:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Tariq Toukan

Hi Dave,

This patchset contains misc bug fixes from the team
to the mlx4 Core and Eth drivers.

Series generated against net commit:
32f1bc0f3d26 Revert "ipv4: restore rt->fi for reference counting"

Thanks,
Tariq.

Jack Morgenstein (1):
  net/mlx4_core: Reduce harmless SRIOV error message to debug level

Kamal Heib (1):
  net/mlx4_en: Change the error print to debug print

Talat Batheesh (1):
  net/mlx4_en: Avoid adding steering rules with invalid ring

 drivers/net/ethernet/mellanox/mlx4/cmd.c              | 14 +++++++++++---
 drivers/net/ethernet/mellanox/mlx4/en_ethtool.c       |  5 +++++
 drivers/net/ethernet/mellanox/mlx4/en_rx.c            |  3 ++-
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c |  2 +-
 4 files changed, 19 insertions(+), 5 deletions(-)

-- 
1.8.3.1

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

* [PATCH net 1/3] net/mlx4_en: Change the error print to debug print
  2017-05-09 11:45 [PATCH net 0/3] mlx4 misc fixes Tariq Toukan
@ 2017-05-09 11:45 ` Tariq Toukan
  2017-05-09 11:45 ` [PATCH net 2/3] net/mlx4_en: Avoid adding steering rules with invalid ring Tariq Toukan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2017-05-09 11:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Kamal Heib, Tariq Toukan

From: Kamal Heib <kamalh@mellanox.com>

The error print within mlx4_en_calc_rx_buf() should be a debug print.

Fixes: 51151a16a60f ('mlx4: allow order-0 memory allocations in RX path')
Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index aa074e57ce06..77abd1813047 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -997,7 +997,8 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
 	en_dbg(DRV, priv, "Rx buffer scatter-list (effective-mtu:%d num_frags:%d):\n",
 	       eff_mtu, priv->num_frags);
 	for (i = 0; i < priv->num_frags; i++) {
-		en_err(priv,
+		en_dbg(DRV,
+		       priv,
 		       "  frag:%d - size:%d stride:%d\n",
 		       i,
 		       priv->frag_info[i].frag_size,
-- 
1.8.3.1

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

* [PATCH net 2/3] net/mlx4_en: Avoid adding steering rules with invalid ring
  2017-05-09 11:45 [PATCH net 0/3] mlx4 misc fixes Tariq Toukan
  2017-05-09 11:45 ` [PATCH net 1/3] net/mlx4_en: Change the error print to debug print Tariq Toukan
@ 2017-05-09 11:45 ` Tariq Toukan
  2017-05-10 16:55   ` Or Gerlitz
  2017-05-09 11:45 ` [PATCH net 3/3] net/mlx4_core: Reduce harmless SRIOV error message to debug level Tariq Toukan
  2017-05-09 15:23 ` [PATCH net 0/3] mlx4 misc fixes David Miller
  3 siblings, 1 reply; 6+ messages in thread
From: Tariq Toukan @ 2017-05-09 11:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Talat Batheesh, Tariq Toukan

From: Talat Batheesh <talatb@mellanox.com>

Inserting steering rules with illegal ring is an invalid operation,
block it.

Fixes: 820672812f82 ('net/mlx4_en: Manage flow steering rules with ethtool')
Signed-off-by: Talat Batheesh <talatb@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index ffbcb27c05e5..ae5fdc2df654 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -1562,6 +1562,11 @@ static int mlx4_en_flow_replace(struct net_device *dev,
 		qpn = priv->drop_qp.qpn;
 	else if (cmd->fs.ring_cookie & EN_ETHTOOL_QP_ATTACH) {
 		qpn = cmd->fs.ring_cookie & (EN_ETHTOOL_QP_ATTACH - 1);
+		if (qpn < priv->rss_map.base_qpn ||
+		    qpn >= priv->rss_map.base_qpn + priv->rx_ring_num) {
+			en_warn(priv, "rxnfc: QP (0x%x) doesn't exist\n", qpn);
+			return -EINVAL;
+		}
 	} else {
 		if (cmd->fs.ring_cookie >= priv->rx_ring_num) {
 			en_warn(priv, "rxnfc: RX ring (%llu) doesn't exist\n",
-- 
1.8.3.1

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

* [PATCH net 3/3] net/mlx4_core: Reduce harmless SRIOV error message to debug level
  2017-05-09 11:45 [PATCH net 0/3] mlx4 misc fixes Tariq Toukan
  2017-05-09 11:45 ` [PATCH net 1/3] net/mlx4_en: Change the error print to debug print Tariq Toukan
  2017-05-09 11:45 ` [PATCH net 2/3] net/mlx4_en: Avoid adding steering rules with invalid ring Tariq Toukan
@ 2017-05-09 11:45 ` Tariq Toukan
  2017-05-09 15:23 ` [PATCH net 0/3] mlx4 misc fixes David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2017-05-09 11:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Jack Morgenstein, Tariq Toukan

From: Jack Morgenstein <jackm@dev.mellanox.co.il>

Under SRIOV resource management, extra counters are allocated to VFs
from a free pool. If that pool is empty, the ALLOC_RES command for
a counter resource fails -- and this generates a misleading error
message in the message log.

Under SRIOV, each VF is allocated (i.e., guaranteed) 2 counters --
one counter per port. For ETH ports, the RoCE driver requests an
additional counter (above the guaranteed counters). If that request
fails, the VF RoCE driver simply uses the default (i.e., guaranteed)
counter for that port.

Thus, failing to allocate an additional counter does not constitute
a  problem, and the error message on the PF when this occurs should
be reduced to debug level.

Finally, to identify the situation that the reason for the failure is
that no resources are available to grant to the VF, we modified the
error returned by mlx4_grant_resource to -EDQUOT (Quota exceeded),
which more accurately describes the error.

Fixes: c3abb51bdb0e ("IB/mlx4: Add RoCE/IB dedicated counters")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/cmd.c              | 14 +++++++++++---
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c |  2 +-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index 0e0fa7030565..c1af47e45d3f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -1789,9 +1789,17 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave,
 	}
 
 	if (err) {
-		if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR))
-			mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with error:%d, status %d\n",
-				  vhcr->op, slave, vhcr->errno, err);
+		if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR)) {
+			if (vhcr->op == MLX4_CMD_ALLOC_RES &&
+			    (vhcr->in_modifier & 0xff) == RES_COUNTER &&
+			    err == -EDQUOT)
+				mlx4_dbg(dev,
+					 "Unable to allocate counter for slave %d (%d)\n",
+					 slave, err);
+			else
+				mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with error:%d, status %d\n",
+					  vhcr->op, slave, vhcr->errno, err);
+		}
 		vhcr_cmd->status = mlx4_errno_to_status(err);
 		goto out_status;
 	}
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 4aa29ee93013..07516545474f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -311,7 +311,7 @@ static inline int mlx4_grant_resource(struct mlx4_dev *dev, int slave,
 	struct mlx4_priv *priv = mlx4_priv(dev);
 	struct resource_allocator *res_alloc =
 		&priv->mfunc.master.res_tracker.res_alloc[res_type];
-	int err = -EINVAL;
+	int err = -EDQUOT;
 	int allocated, free, reserved, guaranteed, from_free;
 	int from_rsvd;
 
-- 
1.8.3.1

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

* Re: [PATCH net 0/3] mlx4 misc fixes
  2017-05-09 11:45 [PATCH net 0/3] mlx4 misc fixes Tariq Toukan
                   ` (2 preceding siblings ...)
  2017-05-09 11:45 ` [PATCH net 3/3] net/mlx4_core: Reduce harmless SRIOV error message to debug level Tariq Toukan
@ 2017-05-09 15:23 ` David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-05-09 15:23 UTC (permalink / raw)
  To: tariqt; +Cc: netdev, eranbe

From: Tariq Toukan <tariqt@mellanox.com>
Date: Tue,  9 May 2017 14:45:21 +0300

> This patchset contains misc bug fixes from the team
> to the mlx4 Core and Eth drivers.
> 
> Series generated against net commit:
> 32f1bc0f3d26 Revert "ipv4: restore rt->fi for reference counting"

Series applied, thanks Tariq.

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

* Re: [PATCH net 2/3] net/mlx4_en: Avoid adding steering rules with invalid ring
  2017-05-09 11:45 ` [PATCH net 2/3] net/mlx4_en: Avoid adding steering rules with invalid ring Tariq Toukan
@ 2017-05-10 16:55   ` Or Gerlitz
  0 siblings, 0 replies; 6+ messages in thread
From: Or Gerlitz @ 2017-05-10 16:55 UTC (permalink / raw)
  To: David S. Miller
  Cc: Linux Netdev List, Eran Ben Elisha, Talat Batheesh, Tariq Toukan

On Tue, May 9, 2017 at 2:45 PM, Tariq Toukan <tariqt@mellanox.com> wrote:
> From: Talat Batheesh <talatb@mellanox.com>
>
> Inserting steering rules with illegal ring is an invalid operation, block it.

Hi Dave,

I realized today that the patch introduced a regression, Tariq will
see if to revert it as a whole or fix the regression.

Just wanted to drop you a note and to make sure you don't further
carry it to -stable,

xxit happens :(

Or.

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

end of thread, other threads:[~2017-05-10 16:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 11:45 [PATCH net 0/3] mlx4 misc fixes Tariq Toukan
2017-05-09 11:45 ` [PATCH net 1/3] net/mlx4_en: Change the error print to debug print Tariq Toukan
2017-05-09 11:45 ` [PATCH net 2/3] net/mlx4_en: Avoid adding steering rules with invalid ring Tariq Toukan
2017-05-10 16:55   ` Or Gerlitz
2017-05-09 11:45 ` [PATCH net 3/3] net/mlx4_core: Reduce harmless SRIOV error message to debug level Tariq Toukan
2017-05-09 15:23 ` [PATCH net 0/3] mlx4 misc fixes 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).