Skip to contentSkip to conversation

tg3: Fix for disallow tx coalescing time to be 0

PATCH Superseded Ivan Vecera 3 participants 7 messages Aug 30, 2016 – Sep 1, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tg3: Fix for disallow tx coalescing time to be 0

The recent commit 087d7a8c disallows to set Rx coalescing time to be 0 as this stops generating interrupts for the incoming packets. I found the zero Tx coalescing time stops generating interrupts similarly for outgoing packets and fires Tx watchdog later. To avoid this, don't allow to set Tx coalescing time to 0.

---
 drivers/net/ethernet/broadcom/tg3.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/tg3.c +1 -0
index 6592612..07e3beb 100644
@@ -14012,6 +14012,7 @@ static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
 	if ((ec->rx_coalesce_usecs > MAX_RXCOL_TICKS) ||
 	    (!ec->rx_coalesce_usecs) ||
 	    (ec->tx_coalesce_usecs > MAX_TXCOL_TICKS) ||
+	    (!ec->tx_coalesce_usecs) ||
 	    (ec->rx_max_coalesced_frames > MAX_RXMAX_FRAMES) ||
 	    (ec->tx_max_coalesced_frames > MAX_TXMAX_FRAMES) ||
 	    (ec->rx_coalesce_usecs_irq > max_rxcoal_tick_int) ||
Signature · 1 line
2.7.3
maintainer
#1 lore raw
Quoted 19 lines · Ivan Vecera

The recent commit 087d7a8c disallows to set Rx coalescing time to be 0 as this stops generating interrupts for the incoming packets. I found the zero Tx coalescing time stops generating interrupts similarly for outgoing packets and fires Tx watchdog later. To avoid this, don't allow to set Tx coalescing time to 0.

---
 drivers/net/ethernet/broadcom/tg3.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/tg3.c +0 -0
index 6592612..07e3beb 100644

drivers/net/ethernet/broadcom/tg3.c static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) · line 14018

Quoted 7 lines
drivers/net/ethernet/broadcom/tg3.c +1 -0
@@ -14012,6 +14012,7 @@ static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
        if ((ec->rx_coalesce_usecs > MAX_RXCOL_TICKS) ||
            (!ec->rx_coalesce_usecs) ||
            (ec->tx_coalesce_usecs > MAX_TXCOL_TICKS) ||
+           (!ec->tx_coalesce_usecs) ||
            (ec->rx_max_coalesced_frames > MAX_RXMAX_FRAMES) ||
            (ec->tx_max_coalesced_frames > MAX_TXMAX_FRAMES) ||
            (ec->rx_coalesce_usecs_irq > max_rxcoal_tick_int) ||

As Rick pointed out last time, we can remove this check which follows the block of code above:

/* No tx interrupts will be generated if both are zero */ if ((ec->tx_coalesce_usecs == 0) &&
(ec->tx_max_coalesced_frames == 0))
return -EINVAL;

#5 lore raw
In reply to Ivan Vecera

Hello.

Quoted 1 line · Ivan Vecera

The recent commit 087d7a8c disallows to set Rx coalescing time to be 0

You should specify both 12-digit SHA1 and the commit summary enclosed in ("").

Quoted 9 lines

as this stops generating interrupts for the incoming packets. I found the zero Tx coalescing time stops generating interrupts similarly for outgoing packets and fires Tx watchdog later. To avoid this, don't allow to set Tx coalescing time to 0.

[...]

MBR, Sergei

#6 lore raw

Dne 30.8.2016 v 19:52 Sergei Shtylyov napsal(a):

Quoted 13 lines

Hello.

Quoted 1 line · Ivan Vecera

The recent commit 087d7a8c disallows to set Rx coalescing time to be 0

You should specify both 12-digit SHA1 and the commit summary enclosed in ("").

Quoted 5 lines

as this stops generating interrupts for the incoming packets. I found the zero Tx coalescing time stops generating interrupts similarly for outgoing packets and fires Tx watchdog later. To avoid this, don't allow to set Tx coalescing time to 0.

Quoted 8 lines
Quoted 4 lines

[...]

MBR, Sergei

No problem, Sergei, will post v2.

#2 lore raw
In reply to Michael Chan

Dne 30.8.2016 v 17:46 Michael Chan napsal(a):

Quoted 32 lines · Ivan Vecera
Quoted 19 lines

The recent commit 087d7a8c disallows to set Rx coalescing time to be 0 as this stops generating interrupts for the incoming packets. I found the zero Tx coalescing time stops generating interrupts similarly for outgoing packets and fires Tx watchdog later. To avoid this, don't allow to set Tx coalescing time to 0.

---
 drivers/net/ethernet/broadcom/tg3.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/tg3.c +0 -0
index 6592612..07e3beb 100644

drivers/net/ethernet/broadcom/tg3.c static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) · line 14018

Quoted 7 lines
drivers/net/ethernet/broadcom/tg3.c +1 -0
@@ -14012,6 +14012,7 @@ static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
        if ((ec->rx_coalesce_usecs > MAX_RXCOL_TICKS) ||
            (!ec->rx_coalesce_usecs) ||
            (ec->tx_coalesce_usecs > MAX_TXCOL_TICKS) ||
+           (!ec->tx_coalesce_usecs) ||
            (ec->rx_max_coalesced_frames > MAX_RXMAX_FRAMES) ||
            (ec->tx_max_coalesced_frames > MAX_TXMAX_FRAMES) ||
            (ec->rx_coalesce_usecs_irq > max_rxcoal_tick_int) ||

As Rick pointed out last time, we can remove this check which follows the block of code above:

Quoted 5 lines

/* No tx interrupts will be generated if both are zero */ if ((ec->tx_coalesce_usecs == 0) &&
(ec->tx_max_coalesced_frames == 0))
return -EINVAL;

Michael,
should I add the removal of these checks to v2?

Ivan

maintainer
#3 lore raw
Quoted 38 lines · Ivan Vecera

Dne 30.8.2016 v 17:46 Michael Chan napsal(a):

Quoted 37 lines · Ivan Vecera
Quoted 28 lines

The recent commit 087d7a8c disallows to set Rx coalescing time to be 0 as this stops generating interrupts for the incoming packets. I found the zero Tx coalescing time stops generating interrupts similarly for outgoing packets and fires Tx watchdog later. To avoid this, don't allow to set Tx coalescing time to 0.

---
 drivers/net/ethernet/broadcom/tg3.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/tg3.c +1 -0
index 6592612..07e3beb 100644
@@ -14012,6 +14012,7 @@ static int tg3_set_coalesce(struct net_device
 *dev, struct ethtool_coalesce *ec)
        if ((ec->rx_coalesce_usecs > MAX_RXCOL_TICKS) ||
            (!ec->rx_coalesce_usecs) ||
            (ec->tx_coalesce_usecs > MAX_TXCOL_TICKS) ||
+           (!ec->tx_coalesce_usecs) ||
            (ec->rx_max_coalesced_frames > MAX_RXMAX_FRAMES) ||
            (ec->tx_max_coalesced_frames > MAX_TXMAX_FRAMES) ||
Quoted 1 line
            (ec->rx_coalesce_usecs_irq > max_rxcoal_tick_int) ||

As Rick pointed out last time, we can remove this check which follows the block of code above:

Quoted 8 lines
Quoted 5 lines

/* No tx interrupts will be generated if both are zero */ if ((ec->tx_coalesce_usecs == 0) &&
(ec->tx_max_coalesced_frames == 0))
return -EINVAL;

Michael,
should I add the removal of these checks to v2?

Yes, please remove both the TX and the RX checks. Thanks.

#4 lore raw

Dne 31.8.2016 v 18:19 Michael Chan napsal(a):

Quoted 44 lines · Ivan Vecera
Quoted 43 lines

Dne 30.8.2016 v 17:46 Michael Chan napsal(a):

Quoted 42 lines · Ivan Vecera
Quoted 28 lines

The recent commit 087d7a8c disallows to set Rx coalescing time to be 0 as this stops generating interrupts for the incoming packets. I found the zero Tx coalescing time stops generating interrupts similarly for outgoing packets and fires Tx watchdog later. To avoid this, don't allow to set Tx coalescing time to 0.

---
 drivers/net/ethernet/broadcom/tg3.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/tg3.c +1 -0
index 6592612..07e3beb 100644
@@ -14012,6 +14012,7 @@ static int tg3_set_coalesce(struct net_device
 *dev, struct ethtool_coalesce *ec)
        if ((ec->rx_coalesce_usecs > MAX_RXCOL_TICKS) ||
            (!ec->rx_coalesce_usecs) ||
            (ec->tx_coalesce_usecs > MAX_TXCOL_TICKS) ||
+           (!ec->tx_coalesce_usecs) ||
            (ec->rx_max_coalesced_frames > MAX_RXMAX_FRAMES) ||
            (ec->tx_max_coalesced_frames > MAX_TXMAX_FRAMES) ||
Quoted 1 line
            (ec->rx_coalesce_usecs_irq > max_rxcoal_tick_int) ||

As Rick pointed out last time, we can remove this check which follows the block of code above:

/* No tx interrupts will be generated if both are zero */ if ((ec->tx_coalesce_usecs == 0) &&
(ec->tx_max_coalesced_frames == 0))
return -EINVAL;

Quoted 5 lines
Quoted 3 lines

Michael,
should I add the removal of these checks to v2?

Yes, please remove both the TX and the RX checks. Thanks.

Ok, v2 sent.

I.