All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] Mellanox driver update Jul-08-2014
@ 2014-07-08  8:25 Amir Vadai
  2014-07-08  8:25 ` [PATCH net-next 1/6] net/mlx4_en: Fix set port ratelimit for 40GE Amir Vadai
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Amir Vadai @ 2014-07-08  8:25 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Or Gerlitz, Yevgeny Petrilin, Amir Vadai

Hi,

This patch set introduce some small bug fixes.
Most of the patches are small fixes to cornet case bugs.
The patch by Noa ("Fix mac_hash database inconsistency") was sent in the past
[1] and was droped because a fix to the bonding code was supposed to make it
unnecessary. After a second look on the patch, it is still needed even
after the direct access to dev_addr by the bonding will be fixed.

Patches were applied and tested over commit bd4578b
("drivers/net/hyperv/netvsc.c: remove unnecessary null test before kfree")

[1] - http://permalink.gmane.org/gmane.linux.network/315900

Thanks,
Amir

Eugenia Emantayev (4):
  net/mlx4_en: Fix set port ratelimit
  net/mlx4_en: Run loopback test only when port is up
  net/mlx4: Verify port number in __mlx4_unregister_mac
  net/mlx4_en: Do not disable vlan filter during promiscuous mode

Noa Osherovich (1):
  net/mlx4_en: Fix mac_hash database inconsistency

Yishai Hadas (1):
  net/mlx4_en: Do not count LLC/SNAP in MTU calculation

 drivers/net/ethernet/mellanox/mlx4/en_netdev.c   | 33 ++++++++++--------------
 drivers/net/ethernet/mellanox/mlx4/en_rx.c       |  2 +-
 drivers/net/ethernet/mellanox/mlx4/en_selftest.c |  3 ++-
 drivers/net/ethernet/mellanox/mlx4/mlx4.h        |  5 ----
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h     |  4 +--
 drivers/net/ethernet/mellanox/mlx4/port.c        | 32 ++++++++++++++++++-----
 include/linux/mlx4/device.h                      | 11 ++++++++
 7 files changed, 54 insertions(+), 36 deletions(-)

-- 
1.8.3.4

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

* [PATCH net-next 1/6] net/mlx4_en: Fix set port ratelimit for 40GE
  2014-07-08  8:25 [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 Amir Vadai
@ 2014-07-08  8:25 ` Amir Vadai
  2014-07-08  8:25 ` [PATCH net-next 2/6] net/mlx4_en: Run loopback test only when port is up Amir Vadai
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Amir Vadai @ 2014-07-08  8:25 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Or Gerlitz, Yevgeny Petrilin, Amir Vadai,
	Eugenia Emantayev, Sagi Grimberg

From: Eugenia Emantayev <eugenia@mellanox.com>

In 40GE we can't use the default bw units for set ratelimit (100 Mbps)
since the max is 255*100 Mbps = 25 Gbps (not suited for 40GE), thus we need 1 Gbps units.
But for 10GE 1 Gbps units might be too bruit so we use the following solution.

For user set ratelimit <= 25 Gbps:
        use 100 Mbps units * user_ratelimit (* 10).

For user set ratelimit > 25 Gbps:
        use 1 Gbps units * user_ratelimit.

For user set unlimited ratelimit (0 Gbps):
        use 1 Gbps units * MAX_RATELIMIT_DEFAULT (57)

Note: any value > 58 will damage the FW ratelimit computation, so we allow
      a max and any higher value will be pulled down to 57.


Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/mlx4.h |  5 -----
 drivers/net/ethernet/mellanox/mlx4/port.c | 22 +++++++++++++++++-----
 include/linux/mlx4/device.h               | 11 +++++++++++
 3 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index 1d8af73..13fbcd0 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -62,11 +62,6 @@
 
 #define INIT_HCA_TPT_MW_ENABLE          (1 << 7)
 
-#define MLX4_NUM_UP		8
-#define MLX4_NUM_TC		8
-#define MLX4_RATELIMIT_UNITS 3 /* 100 Mbps */
-#define MLX4_RATELIMIT_DEFAULT 0xffff
-
 struct mlx4_set_port_prio2tc_context {
 	u8 prio2tc[4];
 };
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 7ab9717..5d76a60 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -1051,14 +1051,26 @@ int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw,
 
 	for (i = 0; i < MLX4_NUM_TC; i++) {
 		struct mlx4_port_scheduler_tc_cfg_be *tc = &context->tc[i];
-		u16 r = ratelimit && ratelimit[i] ? ratelimit[i] :
-			MLX4_RATELIMIT_DEFAULT;
+		u16 r;
+
+		if (ratelimit && ratelimit[i]) {
+			if (ratelimit[i] <= MLX4_MAX_100M_UNITS_VAL) {
+				r = ratelimit[i];
+				tc->max_bw_units =
+					htons(MLX4_RATELIMIT_100M_UNITS);
+			} else {
+				r = ratelimit[i]/10;
+				tc->max_bw_units =
+					htons(MLX4_RATELIMIT_1G_UNITS);
+			}
+			tc->max_bw_value = htons(r);
+		} else {
+			tc->max_bw_value = htons(MLX4_RATELIMIT_DEFAULT);
+			tc->max_bw_units = htons(MLX4_RATELIMIT_1G_UNITS);
+		}
 
 		tc->pg = htons(pg[i]);
 		tc->bw_precentage = htons(tc_tx_bw[i]);
-
-		tc->max_bw_units = htons(MLX4_RATELIMIT_UNITS);
-		tc->max_bw_value = htons(r);
 	}
 
 	in_mod = MLX4_SET_PORT_SCHEDULER << 8 | port;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index b12f4bb..db0aef3 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -48,6 +48,17 @@
 #define MSIX_LEGACY_SZ		4
 #define MIN_MSIX_P_PORT		5
 
+#define MLX4_NUM_UP			8
+#define MLX4_NUM_TC			8
+#define MLX4_MAX_100M_UNITS_VAL		255	/*
+						 * work around: can't set values
+						 * greater then this value when
+						 * using 100 Mbps units.
+						 */
+#define MLX4_RATELIMIT_100M_UNITS	3	/* 100 Mbps */
+#define MLX4_RATELIMIT_1G_UNITS		4	/* 1 Gbps */
+#define MLX4_RATELIMIT_DEFAULT		0x00ff
+
 #define MLX4_ROCE_MAX_GIDS	128
 #define MLX4_ROCE_PF_GIDS	16
 
-- 
1.8.3.4

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

* [PATCH net-next 2/6] net/mlx4_en: Run loopback test only when port is up
  2014-07-08  8:25 [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 Amir Vadai
  2014-07-08  8:25 ` [PATCH net-next 1/6] net/mlx4_en: Fix set port ratelimit for 40GE Amir Vadai
@ 2014-07-08  8:25 ` Amir Vadai
  2014-07-08  8:25 ` [PATCH net-next 3/6] net/mlx4: Verify port number in __mlx4_unregister_mac Amir Vadai
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Amir Vadai @ 2014-07-08  8:25 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Or Gerlitz, Yevgeny Petrilin, Amir Vadai, Eugenia Emantayev

From: Eugenia Emantayev <eugenia@mellanox.com>

Loopback can't work when port is down.


Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>

Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_selftest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
index 03e5f6a..49d5afc 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
@@ -159,7 +159,8 @@ void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf)
 		if (priv->mdev->dev->caps.flags &
 					MLX4_DEV_CAP_FLAG_UC_LOOPBACK) {
 			buf[3] = mlx4_en_test_registers(priv);
-			buf[4] = mlx4_en_test_loopback(priv);
+			if (priv->port_up)
+				buf[4] = mlx4_en_test_loopback(priv);
 		}
 
 		if (carrier_ok)
-- 
1.8.3.4

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

* [PATCH net-next 3/6] net/mlx4: Verify port number in __mlx4_unregister_mac
  2014-07-08  8:25 [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 Amir Vadai
  2014-07-08  8:25 ` [PATCH net-next 1/6] net/mlx4_en: Fix set port ratelimit for 40GE Amir Vadai
  2014-07-08  8:25 ` [PATCH net-next 2/6] net/mlx4_en: Run loopback test only when port is up Amir Vadai
@ 2014-07-08  8:25 ` Amir Vadai
  2014-07-08  8:25 ` [PATCH net-next 4/6] net/mlx4_en: Do not disable vlan filter during promiscuous mode Amir Vadai
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Amir Vadai @ 2014-07-08  8:25 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Or Gerlitz, Yevgeny Petrilin, Amir Vadai,
	Eugenia Emantayev, Eli Cohen

From: Eugenia Emantayev <eugenia@mellanox.com>

Verify port number to avoid crashes if port number is outside the range.


Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/port.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 5d76a60..9ba0c1c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -244,10 +244,16 @@ EXPORT_SYMBOL_GPL(mlx4_get_base_qpn);
 
 void __mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac)
 {
-	struct mlx4_port_info *info = &mlx4_priv(dev)->port[port];
-	struct mlx4_mac_table *table = &info->mac_table;
+	struct mlx4_port_info *info;
+	struct mlx4_mac_table *table;
 	int index;
 
+	if (port < 1 || port > dev->caps.num_ports) {
+		mlx4_warn(dev, "invalid port number (%d), aborting...\n", port);
+		return;
+	}
+	info = &mlx4_priv(dev)->port[port];
+	table = &info->mac_table;
 	mutex_lock(&table->mutex);
 	index = find_index(dev, table, mac);
 
-- 
1.8.3.4

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

* [PATCH net-next 4/6] net/mlx4_en: Do not disable vlan filter during promiscuous mode
  2014-07-08  8:25 [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 Amir Vadai
                   ` (2 preceding siblings ...)
  2014-07-08  8:25 ` [PATCH net-next 3/6] net/mlx4: Verify port number in __mlx4_unregister_mac Amir Vadai
@ 2014-07-08  8:25 ` Amir Vadai
  2014-07-08  8:25 ` [PATCH net-next 5/6] net/mlx4_en: Do not count LLC/SNAP in MTU calculation Amir Vadai
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Amir Vadai @ 2014-07-08  8:25 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Or Gerlitz, Yevgeny Petrilin, Amir Vadai,
	Eugenia Emantayev, Aviad Yehezkel

From: Eugenia Emantayev <eugenia@mellanox.com>

Promiscous mode is only for MACs.
Should not disable/enable VLAN filter when entering/leaving promisuous mode.


Signed-off-by: Aviad Yehezkel <aviadye@mellanox.co.il>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 7d4fb7b..255950a 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -940,11 +940,6 @@ static void mlx4_en_set_promisc_mode(struct mlx4_en_priv *priv,
 					  0, MLX4_MCAST_DISABLE);
 		if (err)
 			en_err(priv, "Failed disabling multicast filter\n");
-
-		/* Disable port VLAN filter */
-		err = mlx4_SET_VLAN_FLTR(mdev->dev, priv);
-		if (err)
-			en_err(priv, "Failed disabling VLAN filter\n");
 	}
 }
 
@@ -993,11 +988,6 @@ static void mlx4_en_clear_promisc_mode(struct mlx4_en_priv *priv,
 			en_err(priv, "Failed disabling promiscuous mode\n");
 		break;
 	}
-
-	/* Enable port VLAN filter */
-	err = mlx4_SET_VLAN_FLTR(mdev->dev, priv);
-	if (err)
-		en_err(priv, "Failed enabling VLAN filter\n");
 }
 
 static void mlx4_en_do_multicast(struct mlx4_en_priv *priv,
-- 
1.8.3.4

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

* [PATCH net-next 5/6] net/mlx4_en: Do not count LLC/SNAP in MTU calculation
  2014-07-08  8:25 [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 Amir Vadai
                   ` (3 preceding siblings ...)
  2014-07-08  8:25 ` [PATCH net-next 4/6] net/mlx4_en: Do not disable vlan filter during promiscuous mode Amir Vadai
@ 2014-07-08  8:25 ` Amir Vadai
  2014-07-08  8:25 ` [PATCH net-next 6/6] net/mlx4_en: Fix mac_hash database inconsistency Amir Vadai
  2014-07-09  2:59 ` [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Amir Vadai @ 2014-07-08  8:25 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Or Gerlitz, Yevgeny Petrilin, Amir Vadai, Yishai Hadas,
	Eugenia Emantayev

From: Yishai Hadas <yishaih@mellanox.com>

LLC/SNAP 8 bytes should not be added as part of header calculation.
If used, payload will be decreased accordingly. For MTU of 1500
we'll set 1522 instead of 1523.


Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Liran Liss <liranl@mellanox.com>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>

Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c   | 2 +-
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index d2d4157..b8ec920 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -922,7 +922,7 @@ static const int frag_sizes[] = {
 void mlx4_en_calc_rx_buf(struct net_device *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
-	int eff_mtu = dev->mtu + ETH_HLEN + VLAN_HLEN + ETH_LLC_SNAP_SIZE;
+	int eff_mtu = dev->mtu + ETH_HLEN + VLAN_HLEN;
 	int buf_size = 0;
 	int i = 0;
 
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 0e15295..01011d4 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -152,8 +152,6 @@ enum {
 #define MLX4_EN_TX_POLL_MODER	16
 #define MLX4_EN_TX_POLL_TIMEOUT	(HZ / 4)
 
-#define ETH_LLC_SNAP_SIZE	8
-
 #define SMALL_PACKET_SIZE      (256 - NET_IP_ALIGN)
 #define HEADER_COPY_SIZE       (128 - NET_IP_ALIGN)
 #define MLX4_LOOPBACK_TEST_PAYLOAD (HEADER_COPY_SIZE - ETH_HLEN)
-- 
1.8.3.4

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

* [PATCH net-next 6/6] net/mlx4_en: Fix mac_hash database inconsistency
  2014-07-08  8:25 [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 Amir Vadai
                   ` (4 preceding siblings ...)
  2014-07-08  8:25 ` [PATCH net-next 5/6] net/mlx4_en: Do not count LLC/SNAP in MTU calculation Amir Vadai
@ 2014-07-08  8:25 ` Amir Vadai
  2014-07-09  2:59 ` [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Amir Vadai @ 2014-07-08  8:25 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Or Gerlitz, Yevgeny Petrilin, Amir Vadai, Noa Osherovich

From: Noa Osherovich <noaos@mellanox.com>

Using a local copy of dev_addr in mlx4_en_set_mac() to prevent dev_addr
from being modified during error flow or when dev_addr is modified in
another context (which is another problem that is being discussed over
the mailing list [1]).
Also fixing bad naming of priv->prev_mac into priv->current_mac.

[1] - http://patchwork.ozlabs.org/patch/351489/


Reviewed-by: Eyal Perry <eyalpe@mellanox.com>
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 23 ++++++++++++++---------
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h   |  2 +-
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 255950a..f384b354 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -760,21 +760,22 @@ static int mlx4_en_replace_mac(struct mlx4_en_priv *priv, int qpn,
 	return __mlx4_replace_mac(dev, priv->port, qpn, new_mac_u64);
 }
 
-static int mlx4_en_do_set_mac(struct mlx4_en_priv *priv)
+static int mlx4_en_do_set_mac(struct mlx4_en_priv *priv,
+			      unsigned char new_mac[ETH_ALEN + 2])
 {
 	int err = 0;
 
 	if (priv->port_up) {
 		/* Remove old MAC and insert the new one */
 		err = mlx4_en_replace_mac(priv, priv->base_qpn,
-					  priv->dev->dev_addr, priv->prev_mac);
+					  new_mac, priv->current_mac);
 		if (err)
 			en_err(priv, "Failed changing HW MAC address\n");
 	} else
 		en_dbg(HW, priv, "Port is down while registering mac, exiting...\n");
 
-	memcpy(priv->prev_mac, priv->dev->dev_addr,
-	       sizeof(priv->prev_mac));
+	if (!err)
+		memcpy(priv->current_mac, new_mac, sizeof(priv->current_mac));
 
 	return err;
 }
@@ -784,14 +785,17 @@ static int mlx4_en_set_mac(struct net_device *dev, void *addr)
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
 	struct sockaddr *saddr = addr;
+	unsigned char new_mac[ETH_ALEN + 2];
 	int err;
 
 	if (!is_valid_ether_addr(saddr->sa_data))
 		return -EADDRNOTAVAIL;
 
 	mutex_lock(&mdev->state_lock);
-	memcpy(dev->dev_addr, saddr->sa_data, ETH_ALEN);
-	err = mlx4_en_do_set_mac(priv);
+	memcpy(new_mac, saddr->sa_data, ETH_ALEN);
+	err = mlx4_en_do_set_mac(priv, new_mac);
+	if (!err)
+		memcpy(dev->dev_addr, saddr->sa_data, ETH_ALEN);
 	mutex_unlock(&mdev->state_lock);
 
 	return err;
@@ -1156,7 +1160,8 @@ static void mlx4_en_do_uc_filter(struct mlx4_en_priv *priv,
 			}
 
 			/* MAC address of the port is not in uc list */
-			if (ether_addr_equal_64bits(entry->mac, dev->dev_addr))
+			if (ether_addr_equal_64bits(entry->mac,
+						    priv->current_mac))
 				found = true;
 
 			if (!found) {
@@ -1466,7 +1471,7 @@ static void mlx4_en_do_get_stats(struct work_struct *work)
 		queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY);
 	}
 	if (mdev->mac_removed[MLX4_MAX_PORTS + 1 - priv->port]) {
-		mlx4_en_do_set_mac(priv);
+		mlx4_en_do_set_mac(priv, priv->current_mac);
 		mdev->mac_removed[MLX4_MAX_PORTS + 1 - priv->port] = 0;
 	}
 	mutex_unlock(&mdev->state_lock);
@@ -2524,7 +2529,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 		}
 	}
 
-	memcpy(priv->prev_mac, dev->dev_addr, sizeof(priv->prev_mac));
+	memcpy(priv->current_mac, dev->dev_addr, sizeof(priv->current_mac));
 
 	priv->stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) +
 					  DS_SIZE * MLX4_EN_MAX_RX_FRAGS);
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 01011d4..7c1b5ec 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -530,7 +530,7 @@ struct mlx4_en_priv {
 	int registered;
 	int allocated;
 	int stride;
-	unsigned char prev_mac[ETH_ALEN + 2];
+	unsigned char current_mac[ETH_ALEN + 2];
 	int mac_index;
 	unsigned max_mtu;
 	int base_qpn;
-- 
1.8.3.4

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

* Re: [PATCH net-next 0/6] Mellanox driver update Jul-08-2014
  2014-07-08  8:25 [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 Amir Vadai
                   ` (5 preceding siblings ...)
  2014-07-08  8:25 ` [PATCH net-next 6/6] net/mlx4_en: Fix mac_hash database inconsistency Amir Vadai
@ 2014-07-09  2:59 ` David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2014-07-09  2:59 UTC (permalink / raw)
  To: amirv; +Cc: netdev, ogerlitz, yevgenyp

From: Amir Vadai <amirv@mellanox.com>
Date: Tue,  8 Jul 2014 11:25:18 +0300

> This patch set introduce some small bug fixes.
> Most of the patches are small fixes to cornet case bugs.
> The patch by Noa ("Fix mac_hash database inconsistency") was sent in the past
> [1] and was droped because a fix to the bonding code was supposed to make it
> unnecessary. After a second look on the patch, it is still needed even
> after the direct access to dev_addr by the bonding will be fixed.
> 
> Patches were applied and tested over commit bd4578b
> ("drivers/net/hyperv/netvsc.c: remove unnecessary null test before kfree")
> 
> [1] - http://permalink.gmane.org/gmane.linux.network/315900

Series applied, thank you.

Signed-off-by: David S. Miller <davem@davemloft.net>

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

end of thread, other threads:[~2014-07-09  2:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08  8:25 [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 Amir Vadai
2014-07-08  8:25 ` [PATCH net-next 1/6] net/mlx4_en: Fix set port ratelimit for 40GE Amir Vadai
2014-07-08  8:25 ` [PATCH net-next 2/6] net/mlx4_en: Run loopback test only when port is up Amir Vadai
2014-07-08  8:25 ` [PATCH net-next 3/6] net/mlx4: Verify port number in __mlx4_unregister_mac Amir Vadai
2014-07-08  8:25 ` [PATCH net-next 4/6] net/mlx4_en: Do not disable vlan filter during promiscuous mode Amir Vadai
2014-07-08  8:25 ` [PATCH net-next 5/6] net/mlx4_en: Do not count LLC/SNAP in MTU calculation Amir Vadai
2014-07-08  8:25 ` [PATCH net-next 6/6] net/mlx4_en: Fix mac_hash database inconsistency Amir Vadai
2014-07-09  2:59 ` [PATCH net-next 0/6] Mellanox driver update Jul-08-2014 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.