mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Andrew Melnychenko <andrew@daynix.com>,
	davem@davemloft.net, kuba@kernel.org, mst@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Cc: yuri.benditovich@daynix.com, yan@daynix.com
Subject: Re: [RFC PATCH 1/5] uapi/linux/if_tun.h: Added new ioctl for tun/tap.
Date: Wed, 9 Feb 2022 12:25:54 +0800	[thread overview]
Message-ID: <06a90de0-57ae-9315-dc2c-03cc74b4ae0c@redhat.com> (raw)
In-Reply-To: <20220125084702.3636253-2-andrew@daynix.com>


在 2022/1/25 下午4:46, Andrew Melnychenko 写道:
> Added TUNGETSUPPORTEDOFFLOADS that should allow
> to get bits of supported offloads.


So we don't use dedicated ioctls in the past, instead, we just probing 
by checking the return value of TUNSETOFFLOADS.

E.g qemu has the following codes:

int tap_probe_has_ufo(int fd)
{
     unsigned offload;

     offload = TUN_F_CSUM | TUN_F_UFO;

     if (ioctl(fd, TUNSETOFFLOAD, offload) < 0)
         return 0;

     return 1;
}

Any reason we can't keep using that?

Thanks


> Added 2 additional offlloads for USO(IPv4 & IPv6).
> Separate offloads are required for Windows VM guests,
> g.e. Windows may set USO rx only for IPv4.
>
> Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
> ---
>   include/uapi/linux/if_tun.h | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
> index 454ae31b93c7..07680fae6e18 100644
> --- a/include/uapi/linux/if_tun.h
> +++ b/include/uapi/linux/if_tun.h
> @@ -61,6 +61,7 @@
>   #define TUNSETFILTEREBPF _IOR('T', 225, int)
>   #define TUNSETCARRIER _IOW('T', 226, int)
>   #define TUNGETDEVNETNS _IO('T', 227)
> +#define TUNGETSUPPORTEDOFFLOADS _IOR('T', 228, unsigned int)
>   
>   /* TUNSETIFF ifr flags */
>   #define IFF_TUN		0x0001
> @@ -88,6 +89,8 @@
>   #define TUN_F_TSO6	0x04	/* I can handle TSO for IPv6 packets */
>   #define TUN_F_TSO_ECN	0x08	/* I can handle TSO with ECN bits. */
>   #define TUN_F_UFO	0x10	/* I can handle UFO packets */
> +#define TUN_F_USO4	0x20	/* I can handle USO for IPv4 packets */
> +#define TUN_F_USO6	0x40	/* I can handle USO for IPv6 packets */
>   
>   /* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
>   #define TUN_PKT_STRIP	0x0001


  reply	other threads:[~2022-02-09  5:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25  8:46 [RFC PATCH 0/5] TUN/VirtioNet USO features support Andrew Melnychenko
2022-01-25  8:46 ` [RFC PATCH 1/5] uapi/linux/if_tun.h: Added new ioctl for tun/tap Andrew Melnychenko
2022-02-09  4:25   ` Jason Wang [this message]
2022-02-22 13:28     ` Andrew Melnichenko
2022-02-23  3:53       ` Jason Wang
2022-02-23 13:31         ` Yuri Benditovich
2022-02-24  3:33           ` Jason Wang
2022-01-25  8:46 ` [RFC PATCH 2/5] driver/net/tun: Added features for USO Andrew Melnychenko
2022-02-09  4:39   ` Jason Wang
2022-02-22 13:22     ` Andrew Melnichenko
2022-01-25  8:47 ` [RFC PATCH 3/5] uapi/linux/virtio_net.h: Added USO types Andrew Melnychenko
2022-02-09  4:41   ` Jason Wang
2022-02-22 13:14     ` Andrew Melnichenko
2022-01-25  8:47 ` [RFC PATCH 4/5] linux/virtio_net.h: Added Support for GSO_UDP_L4 offload Andrew Melnychenko
2022-02-09  4:42   ` Jason Wang
2022-01-25  8:47 ` [RFC PATCH 5/5] drivers/net/virtio_net.c: Added USO support Andrew Melnychenko
2022-02-09  4:44   ` Jason Wang
2022-01-26  7:52 ` [RFC PATCH 0/5] TUN/VirtioNet USO features support Xuan Zhuo
2022-01-26  8:32   ` Yuri Benditovich
2022-02-08 13:09     ` Andrew Melnichenko
2022-02-08 15:39       ` Jakub Kicinski
2022-02-09  5:41       ` Jason Wang
2022-02-22 13:05         ` Andrew Melnichenko

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=06a90de0-57ae-9315-dc2c-03cc74b4ae0c@redhat.com \
    --to=jasowang@redhat.com \
    --cc=andrew@daynix.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --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

all inboxes | Powered by JetHome®