Skip to contentSkip to conversation

bnxt: do not busy-poll when link is down

PATCH Applied Andy Gospodarek 4 participants 5 messages Nov 22, 2016 – Nov 24, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnxt: do not busy-poll when link is down

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.

---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +3 -0
index e18635b..013e373 100644
@@ -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;
 
Signature · 1 line
2.1.0
#1 lore raw
Quoted 24 lines · Andy Gospodarek

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.

---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +0 -0
index e18635b..013e373 100644

drivers/net/ethernet/broadcom/bnxt/bnxt.c static int bnxt_busy_poll(struct napi_struct *napi) · line 1819

Quoted 9 lines
drivers/net/ethernet/broadcom/bnxt/bnxt.c +3 -0
@@ -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.

maintainer
#2 lore raw
Quoted 39 lines · Eric Dumazet
Quoted 24 lines · Andy Gospodarek

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.

---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +0 -0
index e18635b..013e373 100644

drivers/net/ethernet/broadcom/bnxt/bnxt.c static int bnxt_busy_poll(struct napi_struct *napi) · line 1819

Quoted 9 lines
drivers/net/ethernet/broadcom/bnxt/bnxt.c +3 -0
@@ -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 ?

Quoted 5 lines

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.

#3 lore raw
Quoted 6 lines · Michael Chan
Quoted 4 lines · Eric Dumazet

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

Quoted 6 lines
Quoted 5 lines

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 !

maintainer Applied
#4 lore raw
In reply to Andy Gospodarek

From: Andy Gospodarek <[email protected]>
Date: Tue, 22 Nov 2016 13:14:08 -0500

Quoted 9 lines

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

Quoted 6 lines

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

Applied.