netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25
@ 2013-06-25  9:09 Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 01/10] net/mlx4_en: Fix resource leak in error flow Or Gerlitz
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Or Gerlitz

Hi Dave,

This patch set contains some small fixes to mlx4_core and mlx4_en.

Amir is OOO and he passed the stick to me on this series.

The patches were applied and tested on commit d3c5f47ee2 "net: Restore 
unintentional reverts." plus Eric's patch "mlx4: allow order-0 memory 
allocations in RX path" from http://patchwork.ozlabs.org/patch/253575/ 
that I just acknowledged.

Changes from V0:
- dropped patch 1/11 as this is handled by Eric's change
- addressed feedback on patch 6/10: Add prints when TX timeout occurs
  - en_info => en_warn
  - Use single line for warning message
  - Update change log

Thanks,

Or.

Dotan Barak (4):
  net/mlx4_en: Fix resource leak in error flow
  net/mlx4_en: Remove an unnecessary test
  net/mlx4_core: Replace sscanf() with kstrtoint()
  net/mlx4_core: Add warning in case of command timeouts

Eugenia Emantayev (3):
  net/mlx4_en: Move register_netdev() to the end of initialization function
  net/mlx4_en: Change log level from error to debug for vlan related messages
  net/mlx4_en: Fix a race between napi poll function and RX ring cleanup

Jack Morgenstein (2):
  net/mlx4_en: Do not query stats when device port is down
  net/mlx4_core: Fail device init if num_vfs is negative

Yevgeny Petrilin (1):
  net/mlx4_en: Add prints when TX timeout occurs

 drivers/net/ethernet/mellanox/mlx4/cmd.c       |    6 ++++
 drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c |    3 --
 drivers/net/ethernet/mellanox/mlx4/en_main.c   |    2 +-
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |   33 ++++++++++++++++--------
 drivers/net/ethernet/mellanox/mlx4/main.c      |   11 ++++++--
 5 files changed, 37 insertions(+), 18 deletions(-)

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

* [PATCH V1 net-next 01/10] net/mlx4_en: Fix resource leak in error flow
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 02/10] net/mlx4_en: Do not query stats when device port is down Or Gerlitz
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dotan Barak, Amir Vadai

From: Dotan Barak <dotanb@dev.mellanox.com>

Wrong condition was used when calling iounmap.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c
index a5c9df0..a071cda 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c
@@ -310,7 +310,7 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
 err_mr:
 	(void) mlx4_mr_free(dev, &mdev->mr);
 err_map:
-	if (!mdev->uar_map)
+	if (mdev->uar_map)
 		iounmap(mdev->uar_map);
 err_uar:
 	mlx4_uar_free(dev, &mdev->priv_uar);
-- 
1.7.1

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

* [PATCH V1 net-next 02/10] net/mlx4_en: Do not query stats when device port is down
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 01/10] net/mlx4_en: Fix resource leak in error flow Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 03/10] net/mlx4_en: Move register_netdev() to the end of initialization function Or Gerlitz
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Jack Morgenstein, Amir Vadai

From: Jack Morgenstein <jackm@dev.mellanox.com>

There are no counters allocated to the eth device when the port is down, so
this query is meaningless at that time.

It also leads to querying incorrect counters (since the counter_index is not
valid when the device port is down).

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 7299ada..c0b02d7 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1375,12 +1375,13 @@ static void mlx4_en_do_get_stats(struct work_struct *work)
 
 	mutex_lock(&mdev->state_lock);
 	if (mdev->device_up) {
-		err = mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 0);
-		if (err)
-			en_dbg(HW, priv, "Could not update stats\n");
+		if (priv->port_up) {
+			err = mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 0);
+			if (err)
+				en_dbg(HW, priv, "Could not update stats\n");
 
-		if (priv->port_up)
 			mlx4_en_auto_moderation(priv);
+		}
 
 		queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY);
 	}
-- 
1.7.1

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

* [PATCH V1 net-next 03/10] net/mlx4_en: Move register_netdev() to the end of initialization function
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 01/10] net/mlx4_en: Fix resource leak in error flow Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 02/10] net/mlx4_en: Do not query stats when device port is down Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 04/10] net/mlx4_en: Change log level from error to debug for vlan related messages Or Gerlitz
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Eugenia Emantayev, Amir Vadai

From: Eugenia Emantayev <eugenia@mellanox.com>

To avoid a race between the open function and everything that happens after
register_netdev() move it to be the last operation called.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index c0b02d7..1f0f817 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2323,6 +2323,8 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 	mdev->pndev[port] = dev;
 
 	netif_carrier_off(dev);
+	mlx4_en_set_default_moderation(priv);
+
 	err = register_netdev(dev);
 	if (err) {
 		en_err(priv, "Netdev registration failed for port %d\n", port);
@@ -2354,7 +2356,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 		en_err(priv, "Failed Initializing port\n");
 		goto out;
 	}
-	mlx4_en_set_default_moderation(priv);
 	queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY);
 
 	if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS)
-- 
1.7.1

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

* [PATCH V1 net-next 04/10] net/mlx4_en: Change log level from error to debug for vlan related messages
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
                   ` (2 preceding siblings ...)
  2013-06-25  9:09 ` [PATCH V1 net-next 03/10] net/mlx4_en: Move register_netdev() to the end of initialization function Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 05/10] net/mlx4_en: Fix a race between napi poll function and RX ring cleanup Or Gerlitz
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Eugenia Emantayev, Aviad Yehezkel, Amir Vadai

From: Eugenia Emantayev <eugenia@mellanox.com>

The port vlan table size is 126 (used for IBoE) so after 126 we will
not have space and the user need to see it only in debug print and not
error.

Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.com>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 1f0f817..f256a73 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -405,7 +405,7 @@ static int mlx4_en_vlan_rx_add_vid(struct net_device *dev,
 			en_err(priv, "Failed configuring VLAN filter\n");
 	}
 	if (mlx4_register_vlan(mdev->dev, priv->port, vid, &idx))
-		en_err(priv, "failed adding vlan %d\n", vid);
+		en_dbg(HW, priv, "failed adding vlan %d\n", vid);
 	mutex_unlock(&mdev->state_lock);
 
 	return 0;
@@ -428,7 +428,7 @@ static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev,
 	if (!mlx4_find_cached_vlan(mdev->dev, priv->port, vid, &idx))
 		mlx4_unregister_vlan(mdev->dev, priv->port, idx);
 	else
-		en_err(priv, "could not find vid %d in cache\n", vid);
+		en_dbg(HW, priv, "could not find vid %d in cache\n", vid);
 
 	if (mdev->device_up && priv->port_up) {
 		err = mlx4_SET_VLAN_FLTR(mdev->dev, priv);
-- 
1.7.1

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

* [PATCH V1 net-next 05/10] net/mlx4_en: Fix a race between napi poll function and RX ring cleanup
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
                   ` (3 preceding siblings ...)
  2013-06-25  9:09 ` [PATCH V1 net-next 04/10] net/mlx4_en: Change log level from error to debug for vlan related messages Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 06/10] net/mlx4_en: Add prints when TX timeout occurs Or Gerlitz
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Eugenia Emantayev, Amir Vadai

From: Eugenia Emantayev <eugenia@mellanox.com>

The RX rings were cleaned while there was still possible RX traffic completion
handling.
Change the sequance of events so that the port is closed and the QPs are being
stopped before RX cleanup.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index f256a73..f1dcddc 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1635,6 +1635,9 @@ void mlx4_en_stop_port(struct net_device *dev, int detach)
 		return;
 	}
 
+	/* close port*/
+	mlx4_CLOSE_PORT(mdev->dev, priv->port);
+
 	/* Synchronize with tx routine */
 	netif_tx_lock_bh(dev);
 	if (detach)
@@ -1735,14 +1738,11 @@ void mlx4_en_stop_port(struct net_device *dev, int detach)
 		}
 		local_bh_enable();
 
-		mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[i]);
 		while (test_bit(NAPI_STATE_SCHED, &cq->napi.state))
 			msleep(1);
+		mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[i]);
 		mlx4_en_deactivate_cq(priv, cq);
 	}
-
-	/* close port*/
-	mlx4_CLOSE_PORT(mdev->dev, priv->port);
 }
 
 static void mlx4_en_restart(struct work_struct *work)
-- 
1.7.1

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

* [PATCH V1 net-next 06/10] net/mlx4_en: Add prints when TX timeout occurs
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
                   ` (4 preceding siblings ...)
  2013-06-25  9:09 ` [PATCH V1 net-next 05/10] net/mlx4_en: Fix a race between napi poll function and RX ring cleanup Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 07/10] net/mlx4_en: Remove an unnecessary test Or Gerlitz
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Yevgeny Petrilin, Eugenia Emantayev, Amir Vadai

From: Yevgeny Petrilin <yevgenyp@mellanox.com>

Print a warning when a TX timeout is detected

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.com>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index f1dcddc..caf2047 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1236,10 +1236,19 @@ static void mlx4_en_tx_timeout(struct net_device *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
+	int i;
 
 	if (netif_msg_timer(priv))
 		en_warn(priv, "Tx timeout called on port:%d\n", priv->port);
 
+	for (i = 0; i < priv->tx_ring_num; i++) {
+		if (!netif_tx_queue_stopped(netdev_get_tx_queue(dev, i)))
+			continue;
+		en_warn(priv, "TX timeout on queue: %d, QP: 0x%x, CQ: 0x%x, Cons: 0x%x, Prod: 0x%x\n",
+			i, priv->tx_ring[i].qpn, priv->tx_ring[i].cqn,
+			priv->tx_ring[i].cons, priv->tx_ring[i].prod);
+	}
+
 	priv->port_stats.tx_timeout++;
 	en_dbg(DRV, priv, "Scheduling watchdog\n");
 	queue_work(mdev->workqueue, &priv->watchdog_task);
-- 
1.7.1

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

* [PATCH V1 net-next 07/10] net/mlx4_en: Remove an unnecessary test
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
                   ` (5 preceding siblings ...)
  2013-06-25  9:09 ` [PATCH V1 net-next 06/10] net/mlx4_en: Add prints when TX timeout occurs Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 08/10] net/mlx4_core: Replace sscanf() with kstrtoint() Or Gerlitz
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dotan Barak, Amir Vadai

From: Dotan Barak <dotanb@dev.mellanox.com>

Since this variable is now part of a structure and not allocated dynamically,
this test is irrelevant now.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
index 0f91222..9d4a1ea 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
@@ -207,9 +207,6 @@ static int mlx4_en_dcbnl_ieee_getmaxrate(struct net_device *dev,
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	int i;
 
-	if (!priv->maxrate)
-		return -EINVAL;
-
 	for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
 		maxrate->tc_maxrate[i] =
 			priv->maxrate[i] * MLX4_RATELIMIT_UNITS_IN_KB;
-- 
1.7.1

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

* [PATCH V1 net-next 08/10] net/mlx4_core: Replace sscanf() with kstrtoint()
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
                   ` (6 preceding siblings ...)
  2013-06-25  9:09 ` [PATCH V1 net-next 07/10] net/mlx4_en: Remove an unnecessary test Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 09/10] net/mlx4_core: Add warning in case of command timeouts Or Gerlitz
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dotan Barak, Vladimir Sokolovsky, Amir Vadai

From: Dotan Barak <dotanb@dev.mellanox.com>

It is not safe to use sscanf.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 2f4a260..81e4529 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -839,11 +839,11 @@ static ssize_t set_port_ib_mtu(struct device *dev,
 		return -EINVAL;
 	}
 
-	err = sscanf(buf, "%d", &mtu);
-	if (err > 0)
+	err = kstrtoint(buf, 0, &mtu);
+	if (!err)
 		ibta_mtu = int_to_ibta_mtu(mtu);
 
-	if (err <= 0 || ibta_mtu < 0) {
+	if (err || ibta_mtu < 0) {
 		mlx4_err(mdev, "%s is invalid IBTA mtu\n", buf);
 		return -EINVAL;
 	}
-- 
1.7.1

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

* [PATCH V1 net-next 09/10] net/mlx4_core: Add warning in case of command timeouts
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
                   ` (7 preceding siblings ...)
  2013-06-25  9:09 ` [PATCH V1 net-next 08/10] net/mlx4_core: Replace sscanf() with kstrtoint() Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25  9:09 ` [PATCH V1 net-next 10/10] net/mlx4_core: Fail device init if num_vfs is negative Or Gerlitz
  2013-06-25 23:30 ` [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 David Miller
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dotan Barak, Amir Vadai

From: Dotan Barak <dotanb@dev.mellanox.com>

Warning prints when there are command timeout to help debugging future
failures.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/cmd.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index ea1e038..df04c82 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -257,6 +257,8 @@ static int mlx4_comm_cmd_wait(struct mlx4_dev *dev, u8 op,
 
 	if (!wait_for_completion_timeout(&context->done,
 					 msecs_to_jiffies(timeout))) {
+		mlx4_warn(dev, "communication channel command 0x%x timed out\n",
+			  op);
 		err = -EBUSY;
 		goto out;
 	}
@@ -486,6 +488,8 @@ static int mlx4_cmd_poll(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
 	}
 
 	if (cmd_pending(dev)) {
+		mlx4_warn(dev, "command 0x%x timed out (go bit not cleared)\n",
+			  op);
 		err = -ETIMEDOUT;
 		goto out;
 	}
@@ -549,6 +553,8 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
 
 	if (!wait_for_completion_timeout(&context->done,
 					 msecs_to_jiffies(timeout))) {
+		mlx4_warn(dev, "command 0x%x timed out (go bit not cleared)\n",
+			  op);
 		err = -EBUSY;
 		goto out;
 	}
-- 
1.7.1

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

* [PATCH V1 net-next 10/10] net/mlx4_core: Fail device init if num_vfs is negative
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
                   ` (8 preceding siblings ...)
  2013-06-25  9:09 ` [PATCH V1 net-next 09/10] net/mlx4_core: Add warning in case of command timeouts Or Gerlitz
@ 2013-06-25  9:09 ` Or Gerlitz
  2013-06-25 23:30 ` [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 David Miller
  10 siblings, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2013-06-25  9:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Jack Morgenstein, Vladimir Sokolovsky, Amir Vadai

From: Jack Morgenstein <jackm@dev.mellanox.com>

Should not allow negative num_vfs

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 81e4529..56160a2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -2077,6 +2077,11 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data)
 		       num_vfs, MLX4_MAX_NUM_VF);
 		return -EINVAL;
 	}
+
+	if (num_vfs < 0) {
+		pr_err("num_vfs module parameter cannot be negative\n");
+		return -EINVAL;
+	}
 	/*
 	 * Check for BARs.
 	 */
-- 
1.7.1

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

* Re: [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25
  2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
                   ` (9 preceding siblings ...)
  2013-06-25  9:09 ` [PATCH V1 net-next 10/10] net/mlx4_core: Fail device init if num_vfs is negative Or Gerlitz
@ 2013-06-25 23:30 ` David Miller
  10 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2013-06-25 23:30 UTC (permalink / raw)
  To: ogerlitz; +Cc: netdev

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Tue, 25 Jun 2013 12:09:28 +0300

> This patch set contains some small fixes to mlx4_core and mlx4_en.
> 
> Amir is OOO and he passed the stick to me on this series.
> 
> The patches were applied and tested on commit d3c5f47ee2 "net: Restore 
> unintentional reverts." plus Eric's patch "mlx4: allow order-0 memory 
> allocations in RX path" from http://patchwork.ozlabs.org/patch/253575/ 
> that I just acknowledged.
> 
> Changes from V0:
> - dropped patch 1/11 as this is handled by Eric's change
> - addressed feedback on patch 6/10: Add prints when TX timeout occurs
>   - en_info => en_warn
>   - Use single line for warning message
>   - Update change log

Series applied, thanks.

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

end of thread, other threads:[~2013-06-25 23:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-25  9:09 [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 01/10] net/mlx4_en: Fix resource leak in error flow Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 02/10] net/mlx4_en: Do not query stats when device port is down Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 03/10] net/mlx4_en: Move register_netdev() to the end of initialization function Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 04/10] net/mlx4_en: Change log level from error to debug for vlan related messages Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 05/10] net/mlx4_en: Fix a race between napi poll function and RX ring cleanup Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 06/10] net/mlx4_en: Add prints when TX timeout occurs Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 07/10] net/mlx4_en: Remove an unnecessary test Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 08/10] net/mlx4_core: Replace sscanf() with kstrtoint() Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 09/10] net/mlx4_core: Add warning in case of command timeouts Or Gerlitz
2013-06-25  9:09 ` [PATCH V1 net-next 10/10] net/mlx4_core: Fail device init if num_vfs is negative Or Gerlitz
2013-06-25 23:30 ` [PATCH net-next V1 00/10] Mellanox driver updates 2013-06-25 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).