[PATCH for-7.2 v3 0/3] rtl8139: honor large send MSS value

Stefan Hajnoczi posted 3 patches 1 year, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221117165554.1773409-1-stefanha@redhat.com
Maintainers: Jason Wang <jasowang@redhat.com>
hw/net/rtl8139.c | 47 ++++++++++++++++++++++++-----------------------
1 file changed, 24 insertions(+), 23 deletions(-)
[PATCH for-7.2 v3 0/3] rtl8139: honor large send MSS value
Posted by Stefan Hajnoczi 1 year, 5 months ago
v3:
- Add Patch 1 to avoid clobbering tx descriptor bits
- Add Patch 2 to avoid confusing tx command modes
- Exclude IP and TCP headers from large send MSS value

The rtl8139 large send offload currently does not honor the MSS value provided
by the driver. This is a problem especially when the MTU is small because IP
fragmentation occurs and leads to poor performance.

These patches make use of the large send MSS value.

I have done basic testing by running the following Python code inside the
guest:

  import socket
  s = socket.socket()
  s.connect(('10.0.2.2', 1234))
  buf = b'A' * 4096
  s.send(buf)

The device sees a 4150 byte tx descriptor that results in the transmission of 3
Ethernet frames with sizes of 1514, 1514, and 1230 bytes when the large send
MSS value is 1460 bytes.

Stefan Hajnoczi (3):
  rtl8139: avoid clobbering tx descriptor bits
  rtl8139: keep Tx command mode 0 and 1 separate
  rtl8139: honor large send MSS value

 hw/net/rtl8139.c | 47 ++++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 23 deletions(-)

-- 
2.38.1
Re: [PATCH for-7.2 v3 0/3] rtl8139: honor large send MSS value
Posted by Stefan Hajnoczi 1 year, 5 months ago
On Thu, Nov 17, 2022 at 11:55:51AM -0500, Stefan Hajnoczi wrote:
> v3:
> - Add Patch 1 to avoid clobbering tx descriptor bits
> - Add Patch 2 to avoid confusing tx command modes
> - Exclude IP and TCP headers from large send MSS value
> 
> The rtl8139 large send offload currently does not honor the MSS value provided
> by the driver. This is a problem especially when the MTU is small because IP
> fragmentation occurs and leads to poor performance.
> 
> These patches make use of the large send MSS value.
> 
> I have done basic testing by running the following Python code inside the
> guest:
> 
>   import socket
>   s = socket.socket()
>   s.connect(('10.0.2.2', 1234))
>   buf = b'A' * 4096
>   s.send(buf)
> 
> The device sees a 4150 byte tx descriptor that results in the transmission of 3
> Ethernet frames with sizes of 1514, 1514, and 1230 bytes when the large send
> MSS value is 1460 bytes.
> 
> Stefan Hajnoczi (3):
>   rtl8139: avoid clobbering tx descriptor bits
>   rtl8139: keep Tx command mode 0 and 1 separate
>   rtl8139: honor large send MSS value
> 
>  hw/net/rtl8139.c | 47 ++++++++++++++++++++++++-----------------------
>  1 file changed, 24 insertions(+), 23 deletions(-)
> 
> -- 
> 2.38.1
> 

Thanks, applied to qemu.git/master!

Stefan
Re: [PATCH for-7.2 v3 0/3] rtl8139: honor large send MSS value
Posted by Philippe Mathieu-Daudé 1 year, 5 months ago
On 17/11/22 17:55, Stefan Hajnoczi wrote:
> v3:
> - Add Patch 1 to avoid clobbering tx descriptor bits
> - Add Patch 2 to avoid confusing tx command modes
> - Exclude IP and TCP headers from large send MSS value

> Stefan Hajnoczi (3):
>    rtl8139: avoid clobbering tx descriptor bits
>    rtl8139: keep Tx command mode 0 and 1 separate
>    rtl8139: honor large send MSS value
> 
>   hw/net/rtl8139.c | 47 ++++++++++++++++++++++++-----------------------
>   1 file changed, 24 insertions(+), 23 deletions(-)
> 

Per 
https://lore.kernel.org/qemu-devel/014101d8fac5$2cad8420$86088c60$@fiebig.nl/:

Tested-by: Tobias Fiebig <tobias@fiebig.nl>