qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Tobias Fiebig <tobias+git@fiebig.nl>,
	Jason Wang <jasowang@redhat.com>,
	qemu-stable@nongnu.org,
	Russell King - ARM Linux <linux@armlinux.org.uk>
Subject: Re: [PATCH for-7.2 v3 3/3] rtl8139: honor large send MSS value
Date: Fri, 18 Nov 2022 08:24:53 +0100	[thread overview]
Message-ID: <b6ea97e5-5b27-2765-cbb8-70a54fb1d268@linaro.org> (raw)
In-Reply-To: <20221117165554.1773409-4-stefanha@redhat.com>

On 17/11/22 17:55, 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 hardcoded MSS of 1500 bytes
> instead. When the MTU is less than 1500 bytes the hardcoded value
> results in IP fragmentation and poor performance.
> 
> Use the Large-Send MSS value to correctly size Large-Send packets.
> 
> Jason Wang <jasowang@redhat.com> noticed that the Large-Send MSS value
> mask was incorrect so it is adjusted to match the datasheet and Linux
> 8139cp driver.
> 
> This issue was discussed in the past here:
> https://lore.kernel.org/all/20161114162505.GD26664@stefanha-x1.localdomain/
> 
> Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
> Reported-by: Tobias Fiebig <tobias+git@fiebig.nl>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1312
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>   hw/net/rtl8139.c | 26 ++++++++++++--------------
>   1 file changed, 12 insertions(+), 14 deletions(-)

>   /* IP checksum offload flag */
>   #define CP_TX_IPCS (1<<18)
> @@ -2152,10 +2152,11 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
>                       goto skip_offload;
>                   }
>   
> -                int large_send_mss = (txdw0 >> 16) & CP_TC_LGSEN_MSS_MASK;
> +                int large_send_mss = (txdw0 >> CP_TC_LGSEN_MSS_SHIFT) &
> +                                     CP_TC_LGSEN_MSS_MASK;

Nitpicking/matter of style, the '&' is harder to miss if moved on the 
next line just before the mask.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  parent reply	other threads:[~2022-11-18  7:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 16:55 [PATCH for-7.2 v3 0/3] rtl8139: honor large send MSS value Stefan Hajnoczi
2022-11-17 16:55 ` [PATCH for-7.2 v3 1/3] rtl8139: avoid clobbering tx descriptor bits Stefan Hajnoczi
2022-11-18  7:18   ` Philippe Mathieu-Daudé
2022-11-21  4:16   ` Jason Wang
2022-11-21 12:31     ` Stefan Hajnoczi
2022-11-17 16:55 ` [PATCH for-7.2 v3 2/3] rtl8139: keep Tx command mode 0 and 1 separate Stefan Hajnoczi
2022-11-18  7:25   ` Philippe Mathieu-Daudé
2022-11-21  4:16   ` Jason Wang
2022-11-17 16:55 ` [PATCH for-7.2 v3 3/3] rtl8139: honor large send MSS value Stefan Hajnoczi
2022-11-17 17:51   ` Russell King (Oracle)
2022-11-17 18:05     ` Stefan Hajnoczi
2022-11-18  7:24   ` Philippe Mathieu-Daudé [this message]
2022-11-21  4:16   ` Jason Wang
2023-04-13 15:38   ` Peter Maydell
2023-04-13 17:24     ` Stefan Hajnoczi
2022-11-18  7:27 ` [PATCH for-7.2 v3 0/3] " Philippe Mathieu-Daudé
2022-11-21 15:55 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6ea97e5-5b27-2765-cbb8-70a54fb1d268@linaro.org \
    --to=philmd@linaro.org \
    --cc=jasowang@redhat.com \
    --cc=linux@armlinux.org.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=tobias+git@fiebig.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).