aboutsummaryrefslogtreecommitdiff
path: root/net/tap-linux.c
diff options
context:
space:
mode:
authorYuri Benditovich <yuri.benditovich@daynix.com>2023-08-01 01:31:46 +0300
committerJason Wang <jasowang@redhat.com>2023-09-18 14:36:13 +0800
commitf03e0cf63b97a2f98d3b642ee5e7b3bb4379b4b1 (patch)
treec79205f8ff2f632b9670b5f354fd3397f7713988 /net/tap-linux.c
parent2ab0ec31215e68f7af6b21b62e49141eb7c083e2 (diff)
downloadqemu-f03e0cf63b97a2f98d3b642ee5e7b3bb4379b4b1.zip
qemu-f03e0cf63b97a2f98d3b642ee5e7b3bb4379b4b1.tar.gz
qemu-f03e0cf63b97a2f98d3b642ee5e7b3bb4379b4b1.tar.bz2
tap: Add check for USO features
Tap indicates support for USO features according to capabilities of current kernel module. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by: Andrew Melnychecnko <andrew@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/tap-linux.c')
-rw-r--r--net/tap-linux.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/tap-linux.c b/net/tap-linux.c
index 30fcca1..c7e514e 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -173,6 +173,18 @@ int tap_probe_has_ufo(int fd)
return 1;
}
+int tap_probe_has_uso(int fd)
+{
+ unsigned offload;
+
+ offload = TUN_F_CSUM | TUN_F_USO4 | TUN_F_USO6;
+
+ if (ioctl(fd, TUNSETOFFLOAD, offload) < 0) {
+ return 0;
+ }
+ return 1;
+}
+
/* Verify that we can assign given length */
int tap_probe_vnet_hdr_len(int fd, int len)
{