Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1042639iob; Thu, 12 May 2022 09:52:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBtSLiY7mNzJ8CnPBvQTBSFFOtCK1L2LlkvAKoL8hXW8rRlSVqSBWFlON6+eTO9ZSRjK7m X-Received: by 2002:a17:906:eb82:b0:6f3:9044:5fba with SMTP id mh2-20020a170906eb8200b006f390445fbamr682879ejb.715.1652374347675; Thu, 12 May 2022 09:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652374347; cv=none; d=google.com; s=arc-20160816; b=qiDcFAf6AQFspX7Aqz3Skm+KZyJeiwk9NXrtg/mLfSasgZmU10wzNVw1xdZHat/UU+ IuXxCNh9hMA0EWJNAQ6DTZ0vTmkmHkhF3yeQBhWRAfuhXElKZnJkQ8TD+rjwMwEcYFFx NAtEdcQcKPq4mnbjPt6NilGQabD+Ih9DTM6GnGalsG0JqlaeYp0s6sGqSyAmD7US7UG2 EFaIEgBXHA8RgGPCEZU1CVpcgkWhrRcYbGkzmKBQEjyvrZjE8Xr77mJBEYdbWkUmgtAc 556kZgvdyj+lBmq7l0gnp249MLOvEQjPRyXE2rQWCbNWlYr5sbldWEw9IoRr27t50Hgm P3OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tAEF+dbAnD48BnBbAU0BUAa+dO/2WAcVo20DYQ9S6dE=; b=EbCQ1suCTOvz2gX0nALOOv18bmo3kYmeXkqDDvEPqWhz6FFX3TDn5fNexk+kXXeljW zNm3v1LJ8An0V3Zd+X3Cuz4FkPgWi6X0g7bjhl0InAdCiMy1zokPDzgYnfR4++gOckYD YpN7iIErYf2ogFrtp9ZeeqjMJJzeOBBFLCO6N9FLifjf6nK/79d5n+L9sDq3jGEyPm7y NuvClIb5VUhyW/g1K1Vdbc1w2ofNJUqaLhXl2SUjn2DntgKDt5DCpllckKBb70Lu+Q62 2Jsojef2imeWAfR69T4tkBHUxlgyIZnA2zs4DPZyh9m3CdveeN10gzyEoSUq7osp5wG3 +Nhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=UECWek23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a056402514300b00425f7237b06si6538758edd.73.2022.05.12.09.52.01; Thu, 12 May 2022 09:52:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=UECWek23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353318AbiELLdj (ORCPT + 99 others); Thu, 12 May 2022 07:33:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353244AbiELLdZ (ORCPT ); Thu, 12 May 2022 07:33:25 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ECF41CEEDE for ; Thu, 12 May 2022 04:33:21 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id o22so5207479ljp.8 for ; Thu, 12 May 2022 04:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tAEF+dbAnD48BnBbAU0BUAa+dO/2WAcVo20DYQ9S6dE=; b=UECWek238lb5RAmbHwzkIpgTNSdQ11Yfb8ASl/tP0D+HQl0Nqfix/MsfOtRNoHmEoS pYBiTFYwqDnkFF343Jlt3myrxbowelTAS5vAFp0X7RR2jW5QCI2kbGW96q+UKMSumJNJ PEJfOawrzMY/t1idHbgtWH70hLVne5s81XWksgpHJcGY3C9FjeD67VdEw6HQFbr+WXH0 xSf6hh+TNj7Dn0ymg9FSV7zWtFdX4X4bqBplo0p+zej1/q35zQV5l9nrAfOLPIslbS8J XNFEy2vMChSbY1nrUdDWMiOuZ/0wXzvOBejBKQ9CHEY++XqhZiqizqEV4u8BCPclfeW+ beMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tAEF+dbAnD48BnBbAU0BUAa+dO/2WAcVo20DYQ9S6dE=; b=JxP2DJBlglEIoCMyzGWoNntaK1VvIFokK42U/IiBDk1ZeGczq3vArjtvSZThlwexWv d6Tcgrdg0ys5uoR36Ejk/anLXDTHwaqsjGHkekGtnld22NYOfUsv2QYW3UjtMsGTWY0R aEGXCkR7AR62pMrdMyzLqmd3ML1InRcaQ1VutuScK64lRqMPnW+47ytseX2Ed0kRYmXl pf2ECfYl6Ro1H/OiEtdkhf2LRR9rL4MsZYryzx23yrVeQmWVsBBdSUWecg0yHArXVBZ2 zXdCXyEDBGRNqRQODh0VHZ949tNJDbdNQZieXPTUUre+bkkh4K8j9yyXw4yDUljSgGi2 LFcw== X-Gm-Message-State: AOAM531hVSMzDbgIi4lUHnvCJkpTNt/Tz5hKYpaT5dHHgYeLjAtw1Pj1 uOyUMS/fzAI73V7K6t7zB+9mZA== X-Received: by 2002:a2e:9645:0:b0:24f:2e6f:f931 with SMTP id z5-20020a2e9645000000b0024f2e6ff931mr20426742ljh.466.1652355198391; Thu, 12 May 2022 04:33:18 -0700 (PDT) Received: from localhost.localdomain (host-188-190-49-235.la.net.ua. [188.190.49.235]) by smtp.gmail.com with ESMTPSA id r29-20020ac25a5d000000b0047255d211a6sm741758lfn.213.2022.05.12.04.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 04:33:17 -0700 (PDT) From: Andrew Melnychenko To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mst@redhat.com, jasowang@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Cc: yan@daynix.com, yuri.benditovich@daynix.com Subject: [RFC PATCH v2 0/5] TUN/VirtioNet USO features support. Date: Thu, 12 May 2022 14:23:42 +0300 Message-Id: <20220512112347.18717-1-andrew@daynix.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Added new offloads for TUN devices TUN_F_USO4 and TUN_F_USO6. Technically they enable NETIF_F_GSO_UDP_L4 (and only if USO4 & USO6 are set simultaneously). It allows to transmission of large UDP packets. Different features USO4 and USO6 are required for qemu where Windows guests can enable disable USO receives for IPv4 and IPv6 separately. On the other side, Linux can't really differentiate USO4 and USO6, for now. For now, to enable USO for TUN it requires enabling USO4 and USO6 together. In the future, there would be a mechanism to control UDP_L4 GSO separately. Test it WIP Qemu https://github.com/daynix/qemu/tree/Dev_USOv2 New types for VirtioNet already on mailing: https://lists.oasis-open.org/archives/virtio-comment/202110/msg00010.html Also, there is a known issue with transmitting packages between two guests. Without hacks with skb's GSO - packages are still segmented on the host's postrouting. Andrew (5): uapi/linux/if_tun.h: Added new offload types for USO4/6. driver/net/tun: Added features for USO. uapi/linux/virtio_net.h: Added USO types. linux/virtio_net.h: Support USO offload in vnet header. drivers/net/virtio_net.c: Added USO support. drivers/net/tap.c | 10 ++++++++-- drivers/net/tun.c | 8 +++++++- drivers/net/virtio_net.c | 19 +++++++++++++++---- include/linux/virtio_net.h | 9 +++++++++ include/uapi/linux/if_tun.h | 2 ++ include/uapi/linux/virtio_net.h | 4 ++++ 6 files changed, 45 insertions(+), 7 deletions(-) -- 2.35.1