qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Yuri Benditovich <yuri.benditovich@daynix.com>
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>,
	Dmitry Fleytman <dmitry.fleytman@gmail.com>,
	Jason Wang <jasowang@redhat.com>,
	Sriram Yagnaraman <sriram.yagnaraman@est.tech>,
	Stefan Weil <sw@weilnetz.de>,
	qemu-devel@nongnu.org, yan@daynix.com, andrew@daynix.com
Subject: Re: [PATCH 3/4] virtio-net: added USO support
Date: Thu, 20 Jul 2023 13:17:22 -0400	[thread overview]
Message-ID: <20230720131646-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAOEp5OcWzZ9+EvsE=cgfUyj11ifTjZ-Lpm_BAxPX_gqxiYMang@mail.gmail.com>

On Thu, Jul 20, 2023 at 07:05:40PM +0300, Yuri Benditovich wrote:
> 
> 
> On Thu, Jul 20, 2023 at 3:37 AM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> 
>     On 2023/07/20 0:21, Yuri Benditovich wrote:
>     > virtio-net can suggest USO features TX, RX v4 and RX v6,
>     > depending on kernel TUN ability to support them. These
>     > features require explicit enable in command-line.
> 
>     Shouldn't we enable these by default as the other offload features are?
> 
> 
> My suggestion is to add these features as disabled by default and reevaluate
> the
> possibility to enable later.
> If we enable them by default we'll also need to disable them by default in
> previous
> generations of machine types.

Yea, let's do that, that's how we always did it traditionally.

> 
> 
>     >
>     > Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
>     > ---
>     >   hw/net/virtio-net.c | 16 ++++++++++++++--
>     >   1 file changed, 14 insertions(+), 2 deletions(-)
>     >
>     > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
>     > index d2311e7d6e..e76cad923b 100644
>     > --- a/hw/net/virtio-net.c
>     > +++ b/hw/net/virtio-net.c
>     > @@ -796,6 +796,10 @@ static uint64_t virtio_net_get_features(VirtIODevice
>     *vdev, uint64_t features,
>     >           virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_TSO6);
>     >           virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_ECN);
>     >   
>     > +        virtio_clear_feature(&features, VIRTIO_NET_F_HOST_USO);
>     > +        virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_USO4);
>     > +        virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_USO6);
>     > +
>     >           virtio_clear_feature(&features, VIRTIO_NET_F_HASH_REPORT);
>     >       }
>     >   
>     > @@ -864,14 +868,16 @@ static void virtio_net_apply_guest_offloads
>     (VirtIONet *n)
>     >               !!(n->curr_guest_offloads & (1ULL <<
>     VIRTIO_NET_F_GUEST_USO6)));
>     >   }
>     >   
>     > -static uint64_t virtio_net_guest_offloads_by_features(uint32_t features)
>     > +static uint64_t virtio_net_guest_offloads_by_features(uint64_t features)
>     >   {
>     >       static const uint64_t guest_offloads_mask =
>     >           (1ULL << VIRTIO_NET_F_GUEST_CSUM) |
>     >           (1ULL << VIRTIO_NET_F_GUEST_TSO4) |
>     >           (1ULL << VIRTIO_NET_F_GUEST_TSO6) |
>     >           (1ULL << VIRTIO_NET_F_GUEST_ECN)  |
>     > -        (1ULL << VIRTIO_NET_F_GUEST_UFO);
>     > +        (1ULL << VIRTIO_NET_F_GUEST_UFO)  |
>     > +        (1ULL << VIRTIO_NET_F_GUEST_USO4) |
>     > +        (1ULL << VIRTIO_NET_F_GUEST_USO6);
>     >   
>     >       return guest_offloads_mask & features;
>     >   }
>     > @@ -3924,6 +3930,12 @@ static Property virtio_net_properties[] = {
>     >       DEFINE_PROP_INT32("speed", VirtIONet, net_conf.speed,
>     SPEED_UNKNOWN),
>     >       DEFINE_PROP_STRING("duplex", VirtIONet, net_conf.duplex_str),
>     >       DEFINE_PROP_BOOL("failover", VirtIONet, failover, false),
>     > +    DEFINE_PROP_BIT64("guest_uso4", VirtIONet, host_features,
>     > +                      VIRTIO_NET_F_GUEST_USO4, false),
>     > +    DEFINE_PROP_BIT64("guest_uso6", VirtIONet, host_features,
>     > +                      VIRTIO_NET_F_GUEST_USO6, false),
>     > +    DEFINE_PROP_BIT64("host_uso", VirtIONet, host_features,
>     > +                      VIRTIO_NET_F_HOST_USO, false),
>     >       DEFINE_PROP_END_OF_LIST(),
>     >   };
>     >   
> 



  reply	other threads:[~2023-07-20 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 15:21 [PATCH 0/4] virtio-net: add USO feature (UDP segmentation offload) Yuri Benditovich
2023-07-19 15:21 ` [PATCH 1/4] tap: Added USO support to tap device Yuri Benditovich
2023-07-20  0:31   ` Akihiko Odaki
2023-07-20 15:53     ` Yuri Benditovich
2023-07-19 15:21 ` [PATCH 2/4] virtio-net: Added USO flags to vhost support Yuri Benditovich
2023-07-19 15:21 ` [PATCH 3/4] virtio-net: added USO support Yuri Benditovich
2023-07-20  0:37   ` Akihiko Odaki
2023-07-20 16:05     ` Yuri Benditovich
2023-07-20 17:17       ` Michael S. Tsirkin [this message]
2023-07-19 15:21 ` [PATCH 4/4] virtio-net: Added uso check Yuri Benditovich
2023-07-20  0:41   ` Akihiko Odaki

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=20230720131646-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=akihiko.odaki@daynix.com \
    --cc=andrew@daynix.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sriram.yagnaraman@est.tech \
    --cc=sw@weilnetz.de \
    --cc=yan@daynix.com \
    --cc=yuri.benditovich@daynix.com \
    /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).