Re: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-17 Thread Jason Wang
Hajnoczi Sent: Thursday, 17 November 2022 12:16 To: Tobias Fiebig Cc: Jason Wang ; Stefan Hajnoczi ; qemu-devel@nongnu.org; qemu-sta...@nongnu.org; Russell King - ARM Linux Subject: Re: [PATCH for-7.2] rtl8139: honor large send MSS value After looking more closely at txdw0 it seems that the

Re: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-17 Thread Stefan Hajnoczi
On Thu, Nov 17, 2022, 15:42 Tobias Fiebig wrote: > Heho, > I gave v3 a shot and it performs as expected; For a requested MSS of 1320, > TSO consistently uses a 1308 MSS. So for me, this patch works. Thanks for > fixing this. :-) > > Sadly, I do not have boxes to test with .1q around; If none of y

RE: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-17 Thread Tobias Fiebig
Heho, I gave v3 a shot and it performs as expected; For a requested MSS of 1320, TSO consistently uses a 1308 MSS. So for me, this patch works. Thanks for fixing this. :-) Sadly, I do not have boxes to test with .1q around; If none of you has either, and that should be tested as well, I can giv

RE: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-17 Thread Tobias Fiebig
Subject: Re: [PATCH for-7.2] rtl8139: honor large send MSS value Hi Tobias, My initial patch was broken. I did some cleanup and sent a v3. Stefan

Re: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-17 Thread Stefan Hajnoczi
Hi Tobias, My initial patch was broken. I did some cleanup and sent a v3. Stefan

RE: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-17 Thread Tobias Fiebig
: [PATCH for-7.2] rtl8139: honor large send MSS value After looking more closely at txdw0 it seems that the code mixes "Tx command mode 0", "Tx command mode 1", and "Tx status mode". The bits have different meanings in each mode, so this leads to confusion :). Stefan

Re: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-17 Thread Stefan Hajnoczi
After looking more closely at txdw0 it seems that the code mixes "Tx command mode 0", "Tx command mode 1", and "Tx status mode". The bits have different meanings in each mode, so this leads to confusion :). Stefan

Re: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-17 Thread Stefan Hajnoczi
On Wed, 16 Nov 2022 at 21:49, Tobias Fiebig wrote: > > Heho, > Ok, I just learned more C than I ever wanted to. There is a bit more amiss > here (ll from 7d7238c72b983cff5064734349d2d45be9c6282c): > > In line 1916 of rtl8139.c we set txdw0; If we calculate the MSS at this > point, it is consiste

RE: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-16 Thread Tobias Fiebig
Heho, Ok, I just learned more C than I ever wanted to. There is a bit more amiss here (ll from 7d7238c72b983cff5064734349d2d45be9c6282c): In line 1916 of rtl8139.c we set txdw0; If we calculate the MSS at this point, it is consistently 12 below requested, but generally accurate. The bits that f

Re: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-16 Thread Stefan Hajnoczi
I have sent a v2 with a fixed MSS mask constant but haven't tested it. Thanks, Stefan

RE: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-16 Thread Tobias Fiebig
Heho, Quick follow-up; Applied the change you suggested, but there are still some things to test. While this now works (mostly), MSS values are still off; Especially the behavior below <=1036 is difficult, as for v4 the minimum MTU is 576 and minimum MSS is 536: RequestedDPRINT 1320

RE: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-16 Thread Tobias Fiebig
Heho, > Ok, I think I found at least one issue: > > /* large send MSS mask, bits 16...25 */ > #define CP_TC_LGSEN_MSS_MASK ((1 << 12) - 1) > > First, MSS occupies 11 bits from 16 to 26 Second, the mask is wrong it should > be ((1 << 11) - 1) Awesome, thanks, will give this a shot later on and le

Re: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-15 Thread Jason Wang
On Wed, Nov 16, 2022 at 10:59 AM Tobias Fiebig wrote: > > Heho, > I just tested around with the patch; > Good news: Certainly my builds are being executed. Also, if I patch the old > code to have a MAX_MTU <= the max MTU on my path, throughput is ok. > > Bad news: Something is wrong with getting

Re: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-15 Thread Jason Wang
from 1500. Thanks > > -Original Message- > From: Stefan Hajnoczi > Sent: Tuesday, 15 November 2022 17:37 > To: qemu-devel@nongnu.org > Cc: jasow...@redhat.com; qemu-sta...@nongnu.org; Stefan Hajnoczi > ; Russell King - ARM Linux ; > Tobias Fiebig > Subject: [

Re: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-15 Thread Jason Wang
On Wed, Nov 16, 2022 at 12:37 AM Stefan Hajnoczi wrote: > > The Large-Send Task Offload Tx Descriptor (9.2.1 Transmit) has a > Large-Send MSS value where the driver specifies the MSS. See the > datasheet here: > http://realtek.info/pdf/rtl8139cp.pdf > > The code ignores this value and uses a hardc

RE: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-15 Thread Tobias Fiebig
Heho, I just tested around with the patch; Good news: Certainly my builds are being executed. Also, if I patch the old code to have a MAX_MTU <= the max MTU on my path, throughput is ok. Bad news: Something is wrong with getting the MSS in the patch you shared. When enabling DPRINT, values are o

RE: [PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-15 Thread Tobias Fiebig
RM Linux ; Tobias Fiebig Subject: [PATCH for-7.2] rtl8139: honor large send MSS value The Large-Send Task Offload Tx Descriptor (9.2.1 Transmit) has a Large-Send MSS value where the driver specifies the MSS. See the datasheet here: http://realtek.info/pdf/rtl8139cp.pdf The code ignores this value an

[PATCH for-7.2] rtl8139: honor large send MSS value

2022-11-15 Thread Stefan Hajnoczi
The Large-Send Task Offload Tx Descriptor (9.2.1 Transmit) has a Large-Send MSS value where the driver specifies the MSS. See the datasheet here: http://realtek.info/pdf/rtl8139cp.pdf The code ignores this value and uses a hardcoded MSS of 1500 bytes instead. When the MTU is less than 1500 bytes t