Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5657077rwb; Wed, 7 Sep 2022 06:15:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR6kozqA8uOR5dzZKL/e+3UcZXs2xe6WqNvjtvl+iv0n0+82D3RZgqGNkN2iKBHLHCuJ4ndf X-Received: by 2002:a05:6a00:1145:b0:52b:78c:fa26 with SMTP id b5-20020a056a00114500b0052b078cfa26mr3855198pfm.27.1662556533756; Wed, 07 Sep 2022 06:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662556533; cv=none; d=google.com; s=arc-20160816; b=mcfMM694iTKegGFC6DQYwHVDcl2k6R12ckyYvvKFqKtqJjmo8tnnvcEmoh7J514+aw MKX9erXpmEpgDCQWU8INKZrmRyVKi+UWJVT0BcS8FFAgabYP0MU8H4EFRniAQHd/AP84 5ZnlbLRYUD1vfLgnsVMy0X/b9DS0TAy1XU5fTnAAEkAZWpcZL3TvqXoanTofDLnjO4/P DQjR0ubC0/FaLfKkbrINtP+/GuyhVjNzCl9Tbt+QRgDFaSRYzazmy1/avXq5qjbXvAcE +HJMuLrwTmCBGM4GZ/S9CNiZujFnhH1PLwru9LfMTzikAar7eVOrHURTJ2uaCB6X19OY OUFg== 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=Eixd0LQlH9rFcFjWqY+uzWCg74XW8uX92B343SAZfdI=; b=coDjtse5MN43GByDcLS7XPREJAy/GQiYyXNSjk3QzfYVqr+fZoMWqdwSE/sWmuJRVZ qEdxVIpsN4QcZgTB5TzIUm8KxBYE83m0cgzlsyPGS6qKzPfAjGFWwt1oa6SZiyVBJcCz wWnSZfDrZIvd+7ZQ+hqCiOrp78EzPNXTJhWblwjlUh3gAvbg9Sk3YUPzZrlvMXJ0LaZ2 x1aH4qcQlP18+POsdfmnVoXicz2stU9uEg9C2EqYp1CuYI5e5Lfi2VgF8gZzkfZRrWIM JsaG59ExUwva2/XkTK9YXw5GeE1wp8kJjkPQmuDUCJlVwcol0enc4HIy/hCy7UHqUHMo 7Zaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b="Ua/cyoxQ"; 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 j189-20020a6380c6000000b00429a629f070si15875297pgd.560.2022.09.07.06.15.21; Wed, 07 Sep 2022 06:15:33 -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="Ua/cyoxQ"; 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 S229912AbiIGMv1 (ORCPT + 99 others); Wed, 7 Sep 2022 08:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbiIGMvO (ORCPT ); Wed, 7 Sep 2022 08:51:14 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9838F75CE9 for ; Wed, 7 Sep 2022 05:51:13 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id az24-20020a05600c601800b003a842e4983cso9461634wmb.0 for ; Wed, 07 Sep 2022 05:51:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=Eixd0LQlH9rFcFjWqY+uzWCg74XW8uX92B343SAZfdI=; b=Ua/cyoxQXRqo0RqGtbjFqvKgM9vCY0kNMhEbEbPQnYmskVEQSSAs2UjliwH+aDY92z Dm0deZY0cQBo7YmcaodkWAg4uwigGImN3kqL5BRQ0Cdv59fRCz/630LrjITA2g3MBcTJ Orqz3NW40BVAgBUkcsjP+R42xeriW2nsEMBC61s+eqWcqcWxK4b8D06d0FAC7g0B/nua RsgHocu5HNwvpRdN1fkrZCQfJLwtmv9sv0x0Aq2Lggd6uRsqyXpjbVC2g8YFusAHVSew y0bUUr/rvmnvu3T7f8Um+fYaVTLUZWPczhNY0OYatwtsUBocMr07kWIT/zy7yKyTAe4/ 7h7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=Eixd0LQlH9rFcFjWqY+uzWCg74XW8uX92B343SAZfdI=; b=xfC3g7J2MsrXEG7EMeYj7/Z8o5PT/erHtTNcvgXcL0lSbHoenuxCskvbNFCeRzMqA1 eWsfcLoCFb2vaVSDXxBfdfM/yHqBxhOL4IDsRZBhlcKBVDpHAZ63H+2AGTaS8NnV5UvZ yEUev7T6s+jygr3t9Fa3AJ9Ef3alYT3RQyrIDaznxy4ltTgMDSJzusOhNz+bVWqsGs34 B0FoW6nipvGivTswa/S40pG62TxDrgmOjdU4Fx00dDAACFmeobAcuhJV9ogRHcUdnM49 unEebZn1yE1Yk6yvEBfHfFp1KyYhaQ3KGqZc9BvVOHIslBEGdss6gtTS1YGgGu6S0rkc r9Fw== X-Gm-Message-State: ACgBeo3d93mUzz2sigQKxwIl/psz9ZZ0AjEKBse/GcGhQM5dUsD5+HU+ Hs287nPoRJRaxzn1eQB9jdK/Bw== X-Received: by 2002:a05:600c:22cd:b0:3a6:7b62:3778 with SMTP id 13-20020a05600c22cd00b003a67b623778mr1937379wmg.45.1662555072169; Wed, 07 Sep 2022 05:51:12 -0700 (PDT) Received: from navi.cosmonova.net.ua ([95.67.24.131]) by smtp.gmail.com with ESMTPSA id e27-20020adf9bdb000000b0021f0ff1bc6csm11480001wrc.41.2022.09.07.05.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 05:51:11 -0700 (PDT) From: Andrew Melnychenko To: edumazet@google.com, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, jasowang@redhat.com, mst@redhat.com, pabeni@redhat.com, yoshfuji@linux-ipv6.org, dsahern@kernel.org Cc: yan@daynix.com, yuri.benditovich@daynix.com Subject: [PATCH v3 0/6] TUN/VirtioNet USO features support. Date: Wed, 7 Sep 2022 15:50:42 +0300 Message-Id: <20220907125048.396126-1-andrew@daynix.com> X-Mailer: git-send-email 2.37.2 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=unavailable 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 the 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. New types for virtio-net already in virtio-net specification: https://github.com/oasis-tcs/virtio-spec/issues/120 Test it WIP Qemu https://github.com/daynix/qemu/tree/USOv3 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. Andrew Melnychenko (1): udp: allow header check for dodgy GSO_UDP_L4 packets. 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 | 5 +++++ net/ipv4/udp_offload.c | 2 +- 7 files changed, 47 insertions(+), 8 deletions(-) -- 2.37.2