[PATCH net] bnxt: do not busy-poll when link is down

Subsystems: broadcom bnxt_en 50 gigabit ethernet driver, networking drivers, the rest

STALE3545d REVIEWED: 1 (0M)

1 review trailer.

5 messages, 4 authors, 2016-11-24 · open the first message on its own page

[PATCH net] bnxt: do not busy-poll when link is down

From: Andy Gospodarek <hidden>
Date: 2016-11-22 18:20:35

When busy polling while a link is down (during a link-flap test), TX
timeouts were observed as well as the following messages in the ring
buffer:

bnxt_en 0008:01:00.2 enP8p1s0f2d2: Resp cmpl intr err msg: 0x51
bnxt_en 0008:01:00.2 enP8p1s0f2d2: hwrm_ring_free tx failed. rc:-1
bnxt_en 0008:01:00.2 enP8p1s0f2d2: Resp cmpl intr err msg: 0x51
bnxt_en 0008:01:00.2 enP8p1s0f2d2: hwrm_ring_free rx failed. rc:-1

These were resolved by checking for link status and returning if link
was not up.

Signed-off-by: Andy Gospodarek <redacted>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Rob Miller <redacted>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index e18635b..013e373 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1811,6 +1811,9 @@ static int bnxt_busy_poll(struct napi_struct *napi)
 	if (atomic_read(&bp->intr_sem) != 0)
 		return LL_FLUSH_FAILED;
 
+	if (!bp->link_info.link_up)
+		return LL_FLUSH_FAILED;
+
 	if (!bnxt_lock_poll(bnapi))
 		return LL_FLUSH_BUSY;
 
-- 
2.1.0

Re: [PATCH net] bnxt: do not busy-poll when link is down

From: Eric Dumazet <hidden>
Date: 2016-11-22 18:38:38

On Tue, 2016-11-22 at 13:14 -0500, Andy Gospodarek wrote:
quoted hunk
When busy polling while a link is down (during a link-flap test), TX
timeouts were observed as well as the following messages in the ring
buffer:

bnxt_en 0008:01:00.2 enP8p1s0f2d2: Resp cmpl intr err msg: 0x51
bnxt_en 0008:01:00.2 enP8p1s0f2d2: hwrm_ring_free tx failed. rc:-1
bnxt_en 0008:01:00.2 enP8p1s0f2d2: Resp cmpl intr err msg: 0x51
bnxt_en 0008:01:00.2 enP8p1s0f2d2: hwrm_ring_free rx failed. rc:-1

These were resolved by checking for link status and returning if link
was not up.

Signed-off-by: Andy Gospodarek <redacted>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Rob Miller <redacted>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index e18635b..013e373 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1811,6 +1811,9 @@ static int bnxt_busy_poll(struct napi_struct *napi)
 	if (atomic_read(&bp->intr_sem) != 0)
 		return LL_FLUSH_FAILED;
 
+	if (!bp->link_info.link_up)
+		return LL_FLUSH_FAILED;
+
 	if (!bnxt_lock_poll(bnapi))
 		return LL_FLUSH_BUSY;
 

Any plans removing this busy polling stuff, now it is done in core
networking stack ?

This would remove bnxt_lock_napi() extra overhead in normal path ( napi
poll )

I could do this but I do not have the hardware to do the tests.

Re: [PATCH net] bnxt: do not busy-poll when link is down

From: Michael Chan <michael.chan@broadcom.com>
Date: 2016-11-22 18:55:54

On Tue, Nov 22, 2016 at 10:38 AM, Eric Dumazet [off-list ref] wrote:
On Tue, 2016-11-22 at 13:14 -0500, Andy Gospodarek wrote:
quoted
When busy polling while a link is down (during a link-flap test), TX
timeouts were observed as well as the following messages in the ring
buffer:

bnxt_en 0008:01:00.2 enP8p1s0f2d2: Resp cmpl intr err msg: 0x51
bnxt_en 0008:01:00.2 enP8p1s0f2d2: hwrm_ring_free tx failed. rc:-1
bnxt_en 0008:01:00.2 enP8p1s0f2d2: Resp cmpl intr err msg: 0x51
bnxt_en 0008:01:00.2 enP8p1s0f2d2: hwrm_ring_free rx failed. rc:-1

These were resolved by checking for link status and returning if link
was not up.

Signed-off-by: Andy Gospodarek <redacted>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Rob Miller <redacted>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index e18635b..013e373 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1811,6 +1811,9 @@ static int bnxt_busy_poll(struct napi_struct *napi)
      if (atomic_read(&bp->intr_sem) != 0)
              return LL_FLUSH_FAILED;

+     if (!bp->link_info.link_up)
+             return LL_FLUSH_FAILED;
+
      if (!bnxt_lock_poll(bnapi))
              return LL_FLUSH_BUSY;

Any plans removing this busy polling stuff, now it is done in core
networking stack ?

This would remove bnxt_lock_napi() extra overhead in normal path ( napi
poll )

I could do this but I do not have the hardware to do the tests.
It's on my list of many TODO things.  Probably in the next few weeks.

Re: [PATCH net] bnxt: do not busy-poll when link is down

From: Eric Dumazet <hidden>
Date: 2016-11-22 19:06:20

On Tue, 2016-11-22 at 10:55 -0800, Michael Chan wrote:
On Tue, Nov 22, 2016 at 10:38 AM, Eric Dumazet [off-list ref] wrote:
quoted
Any plans removing this busy polling stuff, now it is done in core
networking stack ?

This would remove bnxt_lock_napi() extra overhead in normal path ( napi
poll )

I could do this but I do not have the hardware to do the tests.
It's on my list of many TODO things.  Probably in the next few weeks.
Awesome, thanks !

Re: [PATCH net] bnxt: do not busy-poll when link is down

From: David Miller <davem@davemloft.net>
Date: 2016-11-24 20:40:08

From: Andy Gospodarek <redacted>
Date: Tue, 22 Nov 2016 13:14:08 -0500
When busy polling while a link is down (during a link-flap test), TX
timeouts were observed as well as the following messages in the ring
buffer:

bnxt_en 0008:01:00.2 enP8p1s0f2d2: Resp cmpl intr err msg: 0x51
bnxt_en 0008:01:00.2 enP8p1s0f2d2: hwrm_ring_free tx failed. rc:-1
bnxt_en 0008:01:00.2 enP8p1s0f2d2: Resp cmpl intr err msg: 0x51
bnxt_en 0008:01:00.2 enP8p1s0f2d2: hwrm_ring_free rx failed. rc:-1

These were resolved by checking for link status and returning if link
was not up.

Signed-off-by: Andy Gospodarek <redacted>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Rob Miller <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help