From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org
Cc: "Willem de Bruijn" <willemdebruijn.kernel@gmail.com>,
"Jason Wang" <jasowang@redhat.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>
Subject: Re: [PATCH net-next 6/8] virtio_net: enable gso over UDP tunnel support.
Date: Thu, 22 May 2025 18:33:41 -0400 [thread overview]
Message-ID: <682fa6453d18f_13d837294ac@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <239bacdac9febd6f604f43fa8571aa2c44fd0f0b.1747822866.git.pabeni@redhat.com>
Paolo Abeni wrote:
> If the related virtio feature is set, enable transmission and reception
> of gso over UDP tunnel packets.
>
> Most of the work is done by the previously introduced helper, just need
> to determine the UDP tunnel features inside the virtio_net_hdr and
> update accordingly the virtio net hdr size.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
> drivers/net/virtio_net.c | 78 +++++++++++++++++++++++++++++++---------
> 1 file changed, 62 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 71a972f20f19b..3ca275ab887fe 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -46,11 +46,6 @@ static bool virtio_is_mapped_offload(unsigned int obit)
> obit <= VIRTIO_OFFLOAD_MAP_MAX;
> }
>
> -#define VIRTIO_FEATURE_TO_OFFLOAD(fbit) \
> - ({ \
> - unsigned int __f = fbit; \
> - __f >= VIRTIO_FEATURES_MAP_MIN ? __f - VIRTIO_O2F_DELTA : __f; \
> - })
This was introduced two patches ago. Never used. Remove entirely from the series.
> #define VIRTIO_OFFLOAD_TO_FEATURE(obit) \
> ({ \
> unsigned int __o = obit; \
> @@ -85,16 +80,30 @@ static const unsigned long guest_offloads[] = {
> VIRTIO_NET_F_GUEST_CSUM,
> VIRTIO_NET_F_GUEST_USO4,
> VIRTIO_NET_F_GUEST_USO6,
> - VIRTIO_NET_F_GUEST_HDRLEN
> + VIRTIO_NET_F_GUEST_HDRLEN,
> +#ifdef VIRTIO_HAS_EXTENDED_FEATURES
> + VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED,
> + VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED,
> +#endif
> };
>
> -#define GUEST_OFFLOAD_GRO_HW_MASK ((1ULL << VIRTIO_NET_F_GUEST_TSO4) | \
> +#define __GUEST_OFFLOAD_GRO_HW_MASK ((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_USO4) | \
> (1ULL << VIRTIO_NET_F_GUEST_USO6))
>
> +#ifdef VIRTIO_HAS_EXTENDED_FEATURES
> +
> +#define GUEST_OFFLOAD_GRO_HW_MASK (__GUEST_OFFLOAD_GRO_HW_MASK | \
> + (1ULL << VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED) | \
> + (1ULL << VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED))
> +#else
> +
> +#define GUEST_OFFLOAD_GRO_HW_MASK __GUEST_OFFLOAD_GRO_HW_MASK
> +#endif
> +
> struct virtnet_stat_desc {
> char desc[ETH_GSTRING_LEN];
> size_t offset;
> @@ -443,9 +452,14 @@ struct virtnet_info {
> /* Packet virtio header size */
> u8 hdr_len;
>
> + /* UDP tunnel support*/
space before closing asterisk
> + u8 tnl_offset;
> +
> /* Work struct for delayed refilling if we run low on memory. */
> struct delayed_work refill;
>
> + bool rx_tnl_csum;
> +
There are an awful lot of non consecutive bools here. Probably would
be a nice cleanup to conver to an integer bitfield. Maybe not for this
series.
> /* Is delayed refill enabled? */
> bool refill_enabled;
>
next prev parent reply other threads:[~2025-05-22 22:33 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-21 10:32 [PATCH net-next 0/8] virtio: introduce GSO over UDP tunnel Paolo Abeni
2025-05-21 10:32 ` [PATCH net-next 1/8] virtio: introduce virtio_features_t Paolo Abeni
2025-05-21 16:02 ` Michael S. Tsirkin
2025-05-22 7:29 ` Paolo Abeni
2025-05-22 15:26 ` Paolo Abeni
2025-05-23 19:50 ` Michael S. Tsirkin
2025-05-22 8:17 ` kernel test robot
2025-05-26 0:43 ` Jason Wang
2025-05-26 7:20 ` Paolo Abeni
2025-05-27 3:51 ` Jason Wang
2025-05-28 15:47 ` Paolo Abeni
2025-05-28 15:52 ` Michael S. Tsirkin
2025-05-29 2:15 ` Jason Wang
2025-05-27 14:14 ` Michael S. Tsirkin
2025-05-21 10:32 ` [PATCH net-next 2/8] virtio_pci_modern: allow setting configuring extended features Paolo Abeni
2025-05-26 0:49 ` Jason Wang
2025-05-26 10:53 ` Paolo Abeni
2025-05-27 3:04 ` Jason Wang
2025-05-28 16:02 ` Paolo Abeni
2025-05-29 2:22 ` Jason Wang
2025-05-29 11:07 ` Paolo Abeni
2025-05-29 14:28 ` Michael S. Tsirkin
2025-06-03 2:11 ` Jason Wang
2025-05-29 14:28 ` Michael S. Tsirkin
2025-05-21 10:32 ` [PATCH net-next 3/8] vhost-net: allow " Paolo Abeni
2025-05-26 0:47 ` Jason Wang
2025-05-26 10:57 ` Paolo Abeni
2025-05-27 3:56 ` Jason Wang
2025-05-29 11:10 ` Paolo Abeni
2025-06-03 2:11 ` Jason Wang
2025-05-21 10:32 ` [PATCH net-next 4/8] virtio_net: add supports for extended offloads Paolo Abeni
2025-05-26 1:01 ` Jason Wang
2025-05-21 10:32 ` [PATCH net-next 5/8] net: implement virtio helpers to handle UDP GSO tunneling Paolo Abeni
2025-05-22 22:29 ` Willem de Bruijn
2025-05-23 6:09 ` Paolo Abeni
2025-05-23 6:44 ` Paolo Abeni
2025-05-23 13:42 ` Willem de Bruijn
2025-05-23 14:00 ` Paolo Abeni
2025-05-26 4:40 ` Jason Wang
2025-05-29 11:55 ` Paolo Abeni
2025-05-30 8:43 ` Paolo Abeni
2025-06-03 2:11 ` Jason Wang
2025-05-29 15:30 ` Paolo Abeni
2025-06-03 2:11 ` Jason Wang
2025-05-21 10:32 ` [PATCH net-next 6/8] virtio_net: enable gso over UDP tunnel support Paolo Abeni
2025-05-22 8:38 ` kernel test robot
2025-05-22 22:33 ` Willem de Bruijn [this message]
2025-05-21 10:32 ` [PATCH net-next 7/8] tun: " Paolo Abeni
2025-05-26 4:40 ` Jason Wang
2025-05-26 11:20 ` Paolo Abeni
2025-05-27 4:19 ` Jason Wang
2025-05-29 16:17 ` Paolo Abeni
2025-06-03 2:11 ` Jason Wang
2025-05-21 10:32 ` [PATCH net-next 8/8] vhost/net: " Paolo Abeni
2025-05-22 6:43 ` kernel test robot
2025-05-23 19:54 ` Michael S. Tsirkin
2025-05-26 4:40 ` Jason Wang
2025-05-21 11:38 ` [PATCH net-next 0/8] virtio: introduce GSO over UDP tunnel Paolo Abeni
2025-05-21 15:52 ` Michael S. Tsirkin
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=682fa6453d18f_13d837294ac@willemb.c.googlers.com.notmuch \
--to=willemdebruijn.kernel@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=xuanzhuo@linux.alibaba.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).