All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] e1000e: Fix TX dispatch condition
@ 2022-10-28 13:00 ` Akihiko Odaki
  0 siblings, 0 replies; 6+ messages in thread
From: Akihiko Odaki @ 2022-10-28 13:00 UTC (permalink / raw)
  Cc: Paul Menzel, netdev, linux-kernel, Yuri Benditovich,
	Eric Dumazet, Jakub Kicinski, Yan Vugenfirer, intel-wired-lan,
	Paolo Abeni, David S . Miller, Akihiko Odaki

e1000_xmit_frame is expected to stop the queue and dispatch frames to
hardware if there is not sufficient space for the next frame in the
buffer, but sometimes it failed to do so because the estimated maxmium
size of frame was wrong. As the consequence, the later invocation of
e1000_xmit_frame failed with NETDEV_TX_BUSY, and the frame in the buffer
remained forever, resulting in a watchdog failure.

This change fixes the estimated size by making it match with the
condition for NETDEV_TX_BUSY. Apparently, the old estimation failed to
account for the following lines which determines the space requirement
for not causing NETDEV_TX_BUSY:
    ```
    	/* reserve a descriptor for the offload context */
    	if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
    		count++;
    	count++;

    	count += DIV_ROUND_UP(len, adapter->tx_fifo_limit);
    ```

This issue was found when running http-stress02 test included in Linux
Test Project 20220930 on QEMU with the following commandline:
```
qemu-system-x86_64 -M q35,accel=kvm -m 8G -smp 8
	-drive if=virtio,format=raw,file=root.img,file.locking=on
	-device e1000e,netdev=netdev
	-netdev tap,script=ifup,downscript=no,id=netdev
```

Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 49e926959ad3..55cf2f62bb30 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -5936,9 +5936,9 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 		e1000_tx_queue(tx_ring, tx_flags, count);
 		/* Make sure there is space in the ring for the next send. */
 		e1000_maybe_stop_tx(tx_ring,
-				    (MAX_SKB_FRAGS *
+				    ((MAX_SKB_FRAGS + 1) *
 				     DIV_ROUND_UP(PAGE_SIZE,
-						  adapter->tx_fifo_limit) + 2));
+						  adapter->tx_fifo_limit) + 4));
 
 		if (!netdev_xmit_more() ||
 		    netif_xmit_stopped(netdev_get_tx_queue(netdev, 0))) {
-- 
2.37.3


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

* [Intel-wired-lan] [PATCH v2] e1000e: Fix TX dispatch condition
@ 2022-10-28 13:00 ` Akihiko Odaki
  0 siblings, 0 replies; 6+ messages in thread
From: Akihiko Odaki @ 2022-10-28 13:00 UTC (permalink / raw)
  Cc: Paul Menzel, netdev, linux-kernel, Yuri Benditovich,
	Eric Dumazet, intel-wired-lan, Yan Vugenfirer, Jakub Kicinski,
	Paolo Abeni, David S . Miller

e1000_xmit_frame is expected to stop the queue and dispatch frames to
hardware if there is not sufficient space for the next frame in the
buffer, but sometimes it failed to do so because the estimated maxmium
size of frame was wrong. As the consequence, the later invocation of
e1000_xmit_frame failed with NETDEV_TX_BUSY, and the frame in the buffer
remained forever, resulting in a watchdog failure.

This change fixes the estimated size by making it match with the
condition for NETDEV_TX_BUSY. Apparently, the old estimation failed to
account for the following lines which determines the space requirement
for not causing NETDEV_TX_BUSY:
    ```
    	/* reserve a descriptor for the offload context */
    	if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
    		count++;
    	count++;

    	count += DIV_ROUND_UP(len, adapter->tx_fifo_limit);
    ```

This issue was found when running http-stress02 test included in Linux
Test Project 20220930 on QEMU with the following commandline:
```
qemu-system-x86_64 -M q35,accel=kvm -m 8G -smp 8
	-drive if=virtio,format=raw,file=root.img,file.locking=on
	-device e1000e,netdev=netdev
	-netdev tap,script=ifup,downscript=no,id=netdev
```

Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 49e926959ad3..55cf2f62bb30 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -5936,9 +5936,9 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 		e1000_tx_queue(tx_ring, tx_flags, count);
 		/* Make sure there is space in the ring for the next send. */
 		e1000_maybe_stop_tx(tx_ring,
-				    (MAX_SKB_FRAGS *
+				    ((MAX_SKB_FRAGS + 1) *
 				     DIV_ROUND_UP(PAGE_SIZE,
-						  adapter->tx_fifo_limit) + 2));
+						  adapter->tx_fifo_limit) + 4));
 
 		if (!netdev_xmit_more() ||
 		    netif_xmit_stopped(netdev_get_tx_queue(netdev, 0))) {
-- 
2.37.3

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

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

* RE: [Intel-wired-lan] [PATCH v2] e1000e: Fix TX dispatch condition
  2022-10-28 13:00 ` [Intel-wired-lan] " Akihiko Odaki
@ 2022-11-03 16:16   ` G, GurucharanX
  -1 siblings, 0 replies; 6+ messages in thread
From: G, GurucharanX @ 2022-11-03 16:16 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Paul Menzel, netdev, linux-kernel, Yuri Benditovich,
	Eric Dumazet, intel-wired-lan, Yan Vugenfirer, Jakub Kicinski,
	Paolo Abeni, David S . Miller



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Akihiko Odaki
> Sent: Friday, October 28, 2022 6:30 PM
> Cc: Paul Menzel <pmenzel@molgen.mpg.de>; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; Yuri Benditovich
> <yuri.benditovich@daynix.com>; Eric Dumazet <edumazet@google.com>;
> intel-wired-lan@lists.osuosl.org; Yan Vugenfirer <yan@daynix.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S .
> Miller <davem@davemloft.net>
> Subject: [Intel-wired-lan] [PATCH v2] e1000e: Fix TX dispatch condition
> 
> e1000_xmit_frame is expected to stop the queue and dispatch frames to
> hardware if there is not sufficient space for the next frame in the buffer, but
> sometimes it failed to do so because the estimated maxmium size of frame
> was wrong. As the consequence, the later invocation of e1000_xmit_frame
> failed with NETDEV_TX_BUSY, and the frame in the buffer remained forever,
> resulting in a watchdog failure.
> 
> This change fixes the estimated size by making it match with the condition for
> NETDEV_TX_BUSY. Apparently, the old estimation failed to account for the
> following lines which determines the space requirement for not causing
> NETDEV_TX_BUSY:
>     ```
>     	/* reserve a descriptor for the offload context */
>     	if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
>     		count++;
>     	count++;
> 
>     	count += DIV_ROUND_UP(len, adapter->tx_fifo_limit);
>     ```
> 
> This issue was found when running http-stress02 test included in Linux Test
> Project 20220930 on QEMU with the following commandline:
> ```
> qemu-system-x86_64 -M q35,accel=kvm -m 8G -smp 8
> 	-drive if=virtio,format=raw,file=root.img,file.locking=on
> 	-device e1000e,netdev=netdev
> 	-netdev tap,script=ifup,downscript=no,id=netdev
> ```
> 
> Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for
> ICH9 devices only)")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>  drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)

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

* Re: [Intel-wired-lan] [PATCH v2] e1000e: Fix TX dispatch condition
@ 2022-11-03 16:16   ` G, GurucharanX
  0 siblings, 0 replies; 6+ messages in thread
From: G, GurucharanX @ 2022-11-03 16:16 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Paul Menzel, netdev, linux-kernel, Yuri Benditovich,
	Eric Dumazet, intel-wired-lan, Yan Vugenfirer, Jakub Kicinski,
	Paolo Abeni, David S . Miller



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Akihiko Odaki
> Sent: Friday, October 28, 2022 6:30 PM
> Cc: Paul Menzel <pmenzel@molgen.mpg.de>; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; Yuri Benditovich
> <yuri.benditovich@daynix.com>; Eric Dumazet <edumazet@google.com>;
> intel-wired-lan@lists.osuosl.org; Yan Vugenfirer <yan@daynix.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S .
> Miller <davem@davemloft.net>
> Subject: [Intel-wired-lan] [PATCH v2] e1000e: Fix TX dispatch condition
> 
> e1000_xmit_frame is expected to stop the queue and dispatch frames to
> hardware if there is not sufficient space for the next frame in the buffer, but
> sometimes it failed to do so because the estimated maxmium size of frame
> was wrong. As the consequence, the later invocation of e1000_xmit_frame
> failed with NETDEV_TX_BUSY, and the frame in the buffer remained forever,
> resulting in a watchdog failure.
> 
> This change fixes the estimated size by making it match with the condition for
> NETDEV_TX_BUSY. Apparently, the old estimation failed to account for the
> following lines which determines the space requirement for not causing
> NETDEV_TX_BUSY:
>     ```
>     	/* reserve a descriptor for the offload context */
>     	if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
>     		count++;
>     	count++;
> 
>     	count += DIV_ROUND_UP(len, adapter->tx_fifo_limit);
>     ```
> 
> This issue was found when running http-stress02 test included in Linux Test
> Project 20220930 on QEMU with the following commandline:
> ```
> qemu-system-x86_64 -M q35,accel=kvm -m 8G -smp 8
> 	-drive if=virtio,format=raw,file=root.img,file.locking=on
> 	-device e1000e,netdev=netdev
> 	-netdev tap,script=ifup,downscript=no,id=netdev
> ```
> 
> Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for
> ICH9 devices only)")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>  drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

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

* Re: [Intel-wired-lan] [PATCH v2] e1000e: Fix TX dispatch condition
  2022-10-28 13:00 ` [Intel-wired-lan] " Akihiko Odaki
@ 2022-11-10  9:55   ` naamax.meir
  -1 siblings, 0 replies; 6+ messages in thread
From: naamax.meir @ 2022-11-10  9:55 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Paul Menzel, netdev, linux-kernel, Yuri Benditovich,
	Eric Dumazet, intel-wired-lan, Yan Vugenfirer, Jakub Kicinski,
	Paolo Abeni, David S . Miller

On 10/28/2022 16:00, Akihiko Odaki wrote:
> e1000_xmit_frame is expected to stop the queue and dispatch frames to
> hardware if there is not sufficient space for the next frame in the
> buffer, but sometimes it failed to do so because the estimated maxmium
> size of frame was wrong. As the consequence, the later invocation of
> e1000_xmit_frame failed with NETDEV_TX_BUSY, and the frame in the buffer
> remained forever, resulting in a watchdog failure.
> 
> This change fixes the estimated size by making it match with the
> condition for NETDEV_TX_BUSY. Apparently, the old estimation failed to
> account for the following lines which determines the space requirement
> for not causing NETDEV_TX_BUSY:
>      ```
>      	/* reserve a descriptor for the offload context */
>      	if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
>      		count++;
>      	count++;
> 
>      	count += DIV_ROUND_UP(len, adapter->tx_fifo_limit);
>      ```
> 
> This issue was found when running http-stress02 test included in Linux
> Test Project 20220930 on QEMU with the following commandline:
> ```
> qemu-system-x86_64 -M q35,accel=kvm -m 8G -smp 8
> 	-drive if=virtio,format=raw,file=root.img,file.locking=on
> 	-device e1000e,netdev=netdev
> 	-netdev tap,script=ifup,downscript=no,id=netdev
> ```
> 
> Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>   drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
Tested-by: Naama Meir <naamax.meir@linux.intel.com>

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

* Re: [Intel-wired-lan] [PATCH v2] e1000e: Fix TX dispatch condition
@ 2022-11-10  9:55   ` naamax.meir
  0 siblings, 0 replies; 6+ messages in thread
From: naamax.meir @ 2022-11-10  9:55 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Paul Menzel, netdev, linux-kernel, Yuri Benditovich,
	Eric Dumazet, intel-wired-lan, Yan Vugenfirer, Jakub Kicinski,
	Paolo Abeni, David S . Miller

On 10/28/2022 16:00, Akihiko Odaki wrote:
> e1000_xmit_frame is expected to stop the queue and dispatch frames to
> hardware if there is not sufficient space for the next frame in the
> buffer, but sometimes it failed to do so because the estimated maxmium
> size of frame was wrong. As the consequence, the later invocation of
> e1000_xmit_frame failed with NETDEV_TX_BUSY, and the frame in the buffer
> remained forever, resulting in a watchdog failure.
> 
> This change fixes the estimated size by making it match with the
> condition for NETDEV_TX_BUSY. Apparently, the old estimation failed to
> account for the following lines which determines the space requirement
> for not causing NETDEV_TX_BUSY:
>      ```
>      	/* reserve a descriptor for the offload context */
>      	if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
>      		count++;
>      	count++;
> 
>      	count += DIV_ROUND_UP(len, adapter->tx_fifo_limit);
>      ```
> 
> This issue was found when running http-stress02 test included in Linux
> Test Project 20220930 on QEMU with the following commandline:
> ```
> qemu-system-x86_64 -M q35,accel=kvm -m 8G -smp 8
> 	-drive if=virtio,format=raw,file=root.img,file.locking=on
> 	-device e1000e,netdev=netdev
> 	-netdev tap,script=ifup,downscript=no,id=netdev
> ```
> 
> Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>   drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

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

end of thread, other threads:[~2022-11-10  9:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 13:00 [PATCH v2] e1000e: Fix TX dispatch condition Akihiko Odaki
2022-10-28 13:00 ` [Intel-wired-lan] " Akihiko Odaki
2022-11-03 16:16 ` G, GurucharanX
2022-11-03 16:16   ` G, GurucharanX
2022-11-10  9:55 ` naamax.meir
2022-11-10  9:55   ` naamax.meir

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.