netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/5] bnx2x: `fixes' patch-series
@ 2014-08-25 14:48 Yuval Mintz
  2014-08-25 14:48 ` [PATCH net-next 1/5] bnx2x: ethtool -d might cause timeout in log Yuval Mintz
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Yuval Mintz @ 2014-08-25 14:48 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ariel.Elior, Yuval Mintz

Hi,

This series contains mostly bug fixes, but never the less is intended
for `net-next' and not `net', as:
  - Some of the fixes are quite insignificant [`VF clean statistics',
    `ethtool -d might cause timeout in log'].
  - Some only recently were submitted to `net-next' [`Fix timesync endianity'].
  - Some are not usually compiled as part of the kernel [`Fix stop-on-error'].

Dave - please consider applying this series to `net-next'; If you prefer,
I can break this series into 2 parts [one for `net' and the other for
`net-next'] - but personally I don't see much benefit in it.

Thanks,
Yuval Mintz

Dmitry Kravkov (2):
  bnx2x: ethtool -d might cause timeout in log
  bnx2x: Be more forgiving toward SW GRO

Michal Kalderon (1):
  bnx2x: Fix timesync endianity

Yuval Mintz (2):
  bnx2x: Fix stop-on-error
  bnx2x: VF clean statistics

 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c   | 35 +++++++++++++++++++----
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h  | 14 ++++-----
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c  |  2 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c    |  6 ++--
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c |  5 ++++
 5 files changed, 44 insertions(+), 18 deletions(-)

-- 
1.8.3.1

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

* [PATCH net-next 1/5] bnx2x: ethtool -d might cause timeout in log
  2014-08-25 14:48 [PATCH net-next 0/5] bnx2x: `fixes' patch-series Yuval Mintz
@ 2014-08-25 14:48 ` Yuval Mintz
  2014-08-25 14:48 ` [PATCH net-next 2/5] bnx2x: Fix stop-on-error Yuval Mintz
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Yuval Mintz @ 2014-08-25 14:48 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ariel.Elior, Dmitry Kravkov, Yuval Mintz

From: Dmitry Kravkov <Dmitry.Kravkov@qlogic.com>

This changes slightly the set of registers read during `ethtool -d'.
Without this change, it's possible the HW will generate a grc Attention which
will be logged into system logs as `grc timeout'.

Signed-off-by: Dmitry Kravkov <Dmitry.Kravkov@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h
index 12eb4ba..741aa13 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h
@@ -40,7 +40,7 @@ struct	dump_header {
 	u32 dump_meta_data; /* OR of CHIP and PATH. */
 };
 
-#define BNX2X_DUMP_VERSION 0x50acff01
+#define  BNX2X_DUMP_VERSION 0x61111111
 struct reg_addr {
 	u32 addr;
 	u32 size;
@@ -1464,7 +1464,6 @@ static const struct reg_addr reg_addrs[] = {
 	{ 0x180398, 1, 0x1c, 0x924},
 	{ 0x1803a0, 5, 0x1c, 0x924},
 	{ 0x1803b4, 2, 0x18, 0x924},
-	{ 0x180400, 256, 0x3, 0xfff},
 	{ 0x181000, 4, 0x1f, 0x93c},
 	{ 0x181010, 1020, 0x1f, 0x38},
 	{ 0x182000, 4, 0x18, 0x924},
@@ -1576,7 +1575,6 @@ static const struct reg_addr reg_addrs[] = {
 	{ 0x200398, 1, 0x1c, 0x924},
 	{ 0x2003a0, 1, 0x1c, 0x924},
 	{ 0x2003a8, 2, 0x1c, 0x924},
-	{ 0x200400, 256, 0x3, 0xfff},
 	{ 0x202000, 4, 0x1f, 0x1927},
 	{ 0x202010, 2044, 0x1f, 0x1007},
 	{ 0x204000, 4, 0x18, 0x924},
@@ -1688,7 +1686,6 @@ static const struct reg_addr reg_addrs[] = {
 	{ 0x280398, 1, 0x1c, 0x924},
 	{ 0x2803a0, 1, 0x1c, 0x924},
 	{ 0x2803a8, 2, 0x1c, 0x924},
-	{ 0x280400, 256, 0x3, 0xfff},
 	{ 0x282000, 4, 0x1f, 0x9e4},
 	{ 0x282010, 2044, 0x1f, 0x1c0},
 	{ 0x284000, 4, 0x18, 0x924},
@@ -1800,7 +1797,6 @@ static const struct reg_addr reg_addrs[] = {
 	{ 0x300398, 1, 0x1c, 0x924},
 	{ 0x3003a0, 1, 0x1c, 0x924},
 	{ 0x3003a8, 2, 0x1c, 0x924},
-	{ 0x300400, 256, 0x3, 0xfff},
 	{ 0x302000, 4, 0x1f, 0xf24},
 	{ 0x302010, 2044, 0x1f, 0xe00},
 	{ 0x304000, 4, 0x18, 0x924},
@@ -2206,10 +2202,10 @@ static const struct wreg_addr wreg_addr_e3b0 = {
 	0x1b0c00, 128, 2, read_reg_e3b0, 0x1f, 0x1fff};
 
 static const unsigned int dump_num_registers[NUM_CHIPS][NUM_PRESETS] = {
-	{20782, 18567, 27975, 19729, 18311, 27719, 20836, 32391, 41799, 20812,
-	 26247, 35655, 19074},
-	{32774, 19297, 33277, 31721, 19041, 33021, 32828, 33121, 47101, 32804,
-	 26977, 40957, 35895},
+	{19758, 17543, 26951, 18705, 17287, 26695, 19812, 31367, 40775, 19788,
+	 25223, 34631, 19074},
+	{31750, 18273, 32253, 30697, 18017, 31997, 31804, 32097, 46077, 31780,
+	 25953, 39933, 35895},
 	{36527, 17928, 33697, 35474, 18700, 34466, 36581, 31752, 47521, 36557,
 	 25608, 41377, 43903},
 	{45239, 17936, 34387, 44186, 18708, 35156, 45293, 31760, 48211, 45269,
-- 
1.8.3.1

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

* [PATCH net-next 2/5] bnx2x: Fix stop-on-error
  2014-08-25 14:48 [PATCH net-next 0/5] bnx2x: `fixes' patch-series Yuval Mintz
  2014-08-25 14:48 ` [PATCH net-next 1/5] bnx2x: ethtool -d might cause timeout in log Yuval Mintz
@ 2014-08-25 14:48 ` Yuval Mintz
  2014-08-25 14:48 ` [PATCH net-next 3/5] bnx2x: VF clean statistics Yuval Mintz
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Yuval Mintz @ 2014-08-25 14:48 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ariel.Elior, Yuval Mintz

When STOP_ON_ERROR is set driver will not compile. Even if it did,
traffic will not pass without this patch as several fields which are
verified by FW/HW on the Tx path are not properly set.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c  | 25 +++++++++++++++++++-----
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |  2 +-
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 2388144..2f210ba 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -3873,12 +3873,16 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		/* when transmitting in a vf, start bd must hold the ethertype
 		 * for fw to enforce it
 		 */
+#ifndef BNX2X_STOP_ON_ERROR
 		if (IS_VF(bp))
+#endif
 			tx_start_bd->vlan_or_ethertype =
 				cpu_to_le16(ntohs(eth->h_proto));
+#ifndef BNX2X_STOP_ON_ERROR
 		else
 			/* used by FW for packet accounting */
 			tx_start_bd->vlan_or_ethertype = cpu_to_le16(pkt_prod);
+#endif
 	}
 
 	nbd = 2; /* start_bd + pbd + frags (updated when pages are mapped) */
@@ -3951,11 +3955,22 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
 					      &pbd_e2->data.mac_addr.dst_mid,
 					      &pbd_e2->data.mac_addr.dst_lo,
 					      eth->h_dest);
-		} else if (bp->flags & TX_SWITCHING) {
-			bnx2x_set_fw_mac_addr(&pbd_e2->data.mac_addr.dst_hi,
-					      &pbd_e2->data.mac_addr.dst_mid,
-					      &pbd_e2->data.mac_addr.dst_lo,
-					      eth->h_dest);
+		} else {
+			if (bp->flags & TX_SWITCHING)
+				bnx2x_set_fw_mac_addr(
+						&pbd_e2->data.mac_addr.dst_hi,
+						&pbd_e2->data.mac_addr.dst_mid,
+						&pbd_e2->data.mac_addr.dst_lo,
+						eth->h_dest);
+#ifdef BNX2X_STOP_ON_ERROR
+			/* Enforce security is always set in Stop on Error -
+			 * source mac should be present in the parsing BD
+			 */
+			bnx2x_set_fw_mac_addr(&pbd_e2->data.mac_addr.src_hi,
+					      &pbd_e2->data.mac_addr.src_mid,
+					      &pbd_e2->data.mac_addr.src_lo,
+					      eth->h_source);
+#endif
 		}
 
 		SET_FLAG(pbd_e2_parsing_data,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index a008f48..cf5b3b4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -1142,7 +1142,7 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)
 			if (!fp->txdata_ptr)
 				break;
 
-			if (!txdata.tx_cons_sb)
+			if (!txdata->tx_cons_sb)
 				continue;
 
 			start = TX_BD(le16_to_cpu(*txdata->tx_cons_sb) - 10);
-- 
1.8.3.1

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

* [PATCH net-next 3/5] bnx2x: VF clean statistics
  2014-08-25 14:48 [PATCH net-next 0/5] bnx2x: `fixes' patch-series Yuval Mintz
  2014-08-25 14:48 ` [PATCH net-next 1/5] bnx2x: ethtool -d might cause timeout in log Yuval Mintz
  2014-08-25 14:48 ` [PATCH net-next 2/5] bnx2x: Fix stop-on-error Yuval Mintz
@ 2014-08-25 14:48 ` Yuval Mintz
  2014-08-25 14:48 ` [PATCH net-next 4/5] bnx2x: Be more forgiving toward SW GRO Yuval Mintz
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Yuval Mintz @ 2014-08-25 14:48 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ariel.Elior, Yuval Mintz

During statistics initialization of a VF we need to clean its statistics.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
index e1c8193..d160829 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
@@ -1629,6 +1629,11 @@ void bnx2x_stats_init(struct bnx2x *bp)
 	int /*abs*/port = BP_PORT(bp);
 	int mb_idx = BP_FW_MB_IDX(bp);
 
+	if (IS_VF(bp)) {
+		bnx2x_memset_stats(bp);
+		return;
+	}
+
 	bp->stats_pending = 0;
 	bp->executer_idx = 0;
 	bp->stats_counter = 0;
-- 
1.8.3.1

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

* [PATCH net-next 4/5] bnx2x: Be more forgiving toward SW GRO
  2014-08-25 14:48 [PATCH net-next 0/5] bnx2x: `fixes' patch-series Yuval Mintz
                   ` (2 preceding siblings ...)
  2014-08-25 14:48 ` [PATCH net-next 3/5] bnx2x: VF clean statistics Yuval Mintz
@ 2014-08-25 14:48 ` Yuval Mintz
  2014-08-25 14:48 ` [PATCH net-next 5/5] bnx2x: Fix timesync endianity Yuval Mintz
  2014-08-26  0:30 ` [PATCH net-next 0/5] bnx2x: `fixes' patch-series David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: Yuval Mintz @ 2014-08-25 14:48 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ariel.Elior, Dmitry Kravkov, Yuval Mintz

From: Dmitry Kravkov <Dmitry.Kravkov@qlogic.com>

This introduces 2 new relaxations in the bnx2x driver regarding GRO:
  1. Don't prevent SW GRO if HW GRO is disabled.
  2. If all aggregations are disabled, when GRO configuration changes
     there's no need to perform an inner-reload [since it will have no
     actual effect].

Signed-off-by: Dmitry Kravkov <Dmitry.Kravkov@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 6304da2..de65640 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -4816,11 +4816,15 @@ netdev_features_t bnx2x_fix_features(struct net_device *dev,
 	struct bnx2x *bp = netdev_priv(dev);
 
 	/* TPA requires Rx CSUM offloading */
-	if (!(features & NETIF_F_RXCSUM) || bp->disable_tpa) {
+	if (!(features & NETIF_F_RXCSUM)) {
 		features &= ~NETIF_F_LRO;
 		features &= ~NETIF_F_GRO;
 	}
 
+	/* Note: do not disable SW GRO in kernel when HW GRO is off */
+	if (bp->disable_tpa)
+		features &= ~NETIF_F_LRO;
+
 	return features;
 }
 
@@ -4859,6 +4863,10 @@ int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
 	if ((changes & GRO_ENABLE_FLAG) && (flags & TPA_ENABLE_FLAG))
 		changes &= ~GRO_ENABLE_FLAG;
 
+	/* if GRO is changed while HW TPA is off, don't force a reload */
+	if ((changes & GRO_ENABLE_FLAG) && bp->disable_tpa)
+		changes &= ~GRO_ENABLE_FLAG;
+
 	if (changes)
 		bnx2x_reload = true;
 
-- 
1.8.3.1

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

* [PATCH net-next 5/5] bnx2x: Fix timesync endianity
  2014-08-25 14:48 [PATCH net-next 0/5] bnx2x: `fixes' patch-series Yuval Mintz
                   ` (3 preceding siblings ...)
  2014-08-25 14:48 ` [PATCH net-next 4/5] bnx2x: Be more forgiving toward SW GRO Yuval Mintz
@ 2014-08-25 14:48 ` Yuval Mintz
  2014-08-26  0:30 ` [PATCH net-next 0/5] bnx2x: `fixes' patch-series David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: Yuval Mintz @ 2014-08-25 14:48 UTC (permalink / raw)
  To: davem, netdev; +Cc: Ariel.Elior, Michal Kalderon, Yuval Mintz

From: Michal Kalderon <Michal.Kalderon@qlogic.com>

Commit eeed018cbfa30 ("bnx2x: Add timestamping and PTP hardware clock support")
has a missing conversion to LE32, which will prevent the feature from working
on big endian machines.

Signed-off-by: Michal Kalderon <Michal.Kalderon@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index 798e97f..38acecd 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -5877,8 +5877,10 @@ int bnx2x_func_send_set_timesync(struct bnx2x *bp,
 		set_timesync_params->add_sub_drift_adjust_value;
 	rdata->drift_adjust_value = set_timesync_params->drift_adjust_value;
 	rdata->drift_adjust_period = set_timesync_params->drift_adjust_period;
-	rdata->offset_delta.lo = U64_LO(set_timesync_params->offset_delta);
-	rdata->offset_delta.hi = U64_HI(set_timesync_params->offset_delta);
+	rdata->offset_delta.lo =
+		cpu_to_le32(U64_LO(set_timesync_params->offset_delta));
+	rdata->offset_delta.hi =
+		cpu_to_le32(U64_HI(set_timesync_params->offset_delta));
 
 	DP(BNX2X_MSG_SP, "Set timesync command params: drift_cmd = %d, offset_cmd = %d, add_sub_drift = %d, drift_val = %d, drift_period = %d, offset_lo = %d, offset_hi = %d\n",
 	   rdata->drift_adjust_cmd, rdata->offset_cmd,
-- 
1.8.3.1

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

* Re: [PATCH net-next 0/5] bnx2x: `fixes' patch-series
  2014-08-25 14:48 [PATCH net-next 0/5] bnx2x: `fixes' patch-series Yuval Mintz
                   ` (4 preceding siblings ...)
  2014-08-25 14:48 ` [PATCH net-next 5/5] bnx2x: Fix timesync endianity Yuval Mintz
@ 2014-08-26  0:30 ` David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2014-08-26  0:30 UTC (permalink / raw)
  To: Yuval.Mintz; +Cc: netdev, Ariel.Elior

From: Yuval Mintz <Yuval.Mintz@qlogic.com>
Date: Mon, 25 Aug 2014 17:48:28 +0300

> This series contains mostly bug fixes, but never the less is intended
> for `net-next' and not `net', as:
>   - Some of the fixes are quite insignificant [`VF clean statistics',
>     `ethtool -d might cause timeout in log'].
>   - Some only recently were submitted to `net-next' [`Fix timesync endianity'].
>   - Some are not usually compiled as part of the kernel [`Fix stop-on-error'].
> 
> Dave - please consider applying this series to `net-next'; If you prefer,
> I can break this series into 2 parts [one for `net' and the other for
> `net-next'] - but personally I don't see much benefit in it.

Series applied to net-next, thanks.

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

end of thread, other threads:[~2014-08-26  0:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-25 14:48 [PATCH net-next 0/5] bnx2x: `fixes' patch-series Yuval Mintz
2014-08-25 14:48 ` [PATCH net-next 1/5] bnx2x: ethtool -d might cause timeout in log Yuval Mintz
2014-08-25 14:48 ` [PATCH net-next 2/5] bnx2x: Fix stop-on-error Yuval Mintz
2014-08-25 14:48 ` [PATCH net-next 3/5] bnx2x: VF clean statistics Yuval Mintz
2014-08-25 14:48 ` [PATCH net-next 4/5] bnx2x: Be more forgiving toward SW GRO Yuval Mintz
2014-08-25 14:48 ` [PATCH net-next 5/5] bnx2x: Fix timesync endianity Yuval Mintz
2014-08-26  0:30 ` [PATCH net-next 0/5] bnx2x: `fixes' patch-series 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).