From patchwork Wed Sep 7 12:50:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Melnichenko X-Patchwork-Id: 12968942 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6256AC6FA8B for ; Wed, 7 Sep 2022 12:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbiIGMvZ (ORCPT ); Wed, 7 Sep 2022 08:51:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbiIGMvY (ORCPT ); Wed, 7 Sep 2022 08:51:24 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D7B75FC3 for ; Wed, 7 Sep 2022 05:51:21 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id bz13so16822351wrb.2 for ; Wed, 07 Sep 2022 05:51:21 -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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=K10uAJSt1u89AHdHDm3QcGmANMSoQ/8HY7X6zX3XZWE=; b=zebyzyv5uKr+UqsozuiNEURIYqvNSEMx/k5mlK+LX3bAhdI2PaQP2VCIgM9lmXtdeo JkMS58BTcZhx+QgoTSa9bOMHDIujGKqs6m3ZQKBtUJDMNicEjA07WZN/Qh0PJA9TYhpd 3fcOrWd2LJJY/CeIk+4iQRL3yQ4nz7ws8FLReQL++JjQuPsCoS83B8l6ZERbys591+XP NC6/iLKXCGyqblLuTPfA/r/cjJFcoavZ/Gj6P1w4ROG8A8ZzO2dl3COIE1A/XUjRwMGD wZuy80hJFk+2Pq1ZHJc7wbkRe7TCJY9uN933qBYe0FGW8IxV/hOy93L43ghqQBxlx1sU mo/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=K10uAJSt1u89AHdHDm3QcGmANMSoQ/8HY7X6zX3XZWE=; b=rIQiAO/EXFKcwKJS3wH567SxqW/PG66ytKwpVwY3gmfMc39JUu743KppMtJSV/X0iH AMhmxrj+hM+cORVl42mUoOoZVfmpDU/3Ya8F57gcwQALL6gUh19h1RlZVhzQtB/J4Yjj +4Hz0LGJhYoOlQqAb9/T1WlpNGSdU/EF0zO7r+Lwl4aS+mkhk8DqsW+mLlEd3+lB4Ngp tk7Q1pDpLe1dSFj7eD/AyKs0wWKaaXHqwFKZEZz/Lc+bli06OP2TPj3XXc9HA8oaADuA OlsRdmqFyn1SeS6maD4UwK1ZUeM4dFlLuZlOEKtORv7tCj4GfTFaEBSH3xgwJf8CpuF/ 5gOg== X-Gm-Message-State: ACgBeo3xruGxsWFGThLvBX76NgHLH19hKND1SVNyyjJt73Vuf12sOulK wiopBrNJz0jFVUNgcMXcHHcPuw== X-Google-Smtp-Source: AA6agR6xJNUBhe9XopgqmLTZOld7yTF3ZPNZlh6fC1ETvTmQOaZ4LXyB4dTCOss9jZ/lXbavFtgZQw== X-Received: by 2002:a5d:588b:0:b0:227:1c28:f470 with SMTP id n11-20020a5d588b000000b002271c28f470mr2105741wrf.331.1662555079421; Wed, 07 Sep 2022 05:51:19 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 05:51:19 -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 1/6] udp: allow header check for dodgy GSO_UDP_L4 packets. Date: Wed, 7 Sep 2022 15:50:43 +0300 Message-Id: <20220907125048.396126-2-andrew@daynix.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907125048.396126-1-andrew@daynix.com> References: <20220907125048.396126-1-andrew@daynix.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Packets from TAP devices with USO offload converts to GSO_UDP_L4 & GSO_DODGY sk buffers. Added changes allow skipping segmentation for DODGY/ROBUST packets. Signed-off-by: Jason Wang Signed-off-by: Andrew Melnychenko --- net/ipv4/udp_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index 6d1a4bec2614..8e002419b4d5 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -387,7 +387,7 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, if (!pskb_may_pull(skb, sizeof(struct udphdr))) goto out; - if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) + if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4 && !skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) return __udp_gso_segment(skb, features, false); mss = skb_shinfo(skb)->gso_size; From patchwork Wed Sep 7 12:50:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Melnichenko X-Patchwork-Id: 12968943 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A12EDC38145 for ; Wed, 7 Sep 2022 12:51:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbiIGMvy (ORCPT ); Wed, 7 Sep 2022 08:51:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbiIGMva (ORCPT ); Wed, 7 Sep 2022 08:51:30 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 849EA7C1F7 for ; Wed, 7 Sep 2022 05:51:27 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id bz13so16822862wrb.2 for ; Wed, 07 Sep 2022 05:51:27 -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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=7KvsrxzdRu/1ZCcF3FvQUHupf11TCZFlO9FQE3i8fVg=; b=byTk1PERy1xg8uduZ/vlGwafyPhLGvoY7pXynSWyML06wLvc6XPLmaRqEC2aMIwacV tUoup1Y1MKEfke2ZQCnVfXA7ynGh9tD6fmFJ2NeosScvDVyofRNGWL1q9VsTZpKi3MZM G0rbog7IRrNI2AYyjOephBJ52e1JOLDh+X2Uw7hRy8ac1WLy7tCU0d4TsHTg4GNkSTRE e9yTAgfQzSAllIDau9CnUscSa9dC0nCASyLiFgKN8CFAVW2l5NjyXTK6x47MJJDU5nKt +POxsjxxGx9AL/Jl81pq1OyBQD7x4jYpWTvIlhJ9wvr/iv7LMLfbVlVMpy4KjJFiFJiA MS0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=7KvsrxzdRu/1ZCcF3FvQUHupf11TCZFlO9FQE3i8fVg=; b=Uktw0Kc30TvpoSF5NflDLVWwVCFKEytiwShQied0ICKDEX8guQdqWCUmSZCoznqULq uaMtsBW+FIUYe8E02fbEX8t8haqWMAoG1ysPcHpFrBhnjZ1hLqBNuZMoGZ/YE7a9KPWf 31Hsvin+RXqyiveVEwuw+Ie2lN+9GzDofiwJJg5NacJkaUHYDCIW/20L09MgUu3EFQon sivvI19P1w8qSRywHNEdGoCy4zNfk2yerRC+F7ANwd55pm8Z/2JZ+T+Fp+K1hiElh1Na u5yyzoKK19q+gQf9+WAvVctl6pqFTmECAUdMWgeXKcUhUQ4yONItdGZqreGH+SaPHEwc QATw== X-Gm-Message-State: ACgBeo3BF3VNaOaPMPh6gN4DlOaqDj/tlIlg42M43woPwfgqrzcYOE8v zWp9d059m4rVrf1bwXQhErlWnA== X-Google-Smtp-Source: AA6agR59YwUbyyqlrFljRm41GE4qM9ZwcVQYqqOyOqKMX0/S32LliZKD5iDf+UMvGzsxfRdrxJHjKg== X-Received: by 2002:a5d:47ce:0:b0:228:5769:489e with SMTP id o14-20020a5d47ce000000b002285769489emr1946894wrc.188.1662555086828; Wed, 07 Sep 2022 05:51:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 05:51:26 -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 2/6] uapi/linux/if_tun.h: Added new offload types for USO4/6. Date: Wed, 7 Sep 2022 15:50:44 +0300 Message-Id: <20220907125048.396126-3-andrew@daynix.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907125048.396126-1-andrew@daynix.com> References: <20220907125048.396126-1-andrew@daynix.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 --- include/uapi/linux/if_tun.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h index 2ec07de1d73b..65b58fbec335 100644 --- a/include/uapi/linux/if_tun.h +++ b/include/uapi/linux/if_tun.h @@ -88,6 +88,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 From patchwork Wed Sep 7 12:50:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Melnichenko X-Patchwork-Id: 12968946 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C94DC6FA89 for ; Wed, 7 Sep 2022 12:52:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229960AbiIGMv6 (ORCPT ); Wed, 7 Sep 2022 08:51:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbiIGMvm (ORCPT ); Wed, 7 Sep 2022 08:51:42 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8235AA4FA for ; Wed, 7 Sep 2022 05:51:35 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id az27so20244647wrb.6 for ; Wed, 07 Sep 2022 05:51:35 -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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=nGlu+O6PlfW3f4AqMN8ylp1+LKCaEOK0oFUo4L9z4xA=; b=ueJxzkN3eJNlAg+GMZs26h6REziEHQI3HWXre9RJs19XnQoBTzWRjuFazwWX3JOHMj t87i0l4mhR594c89dLs4LSfdPQsFiQzdtVKQ+nol8t7zDmcQ7wqGvA6wim/isjUzyyaD vM+MmvfLQA/jZ0SpdhtWFnyxTdiQ1GJ7yYqU0R7wsTm3CVqb3Fc+B2ZupB37ZUrGBRCL aSNWbFn72P35KeoiGctujICZrrNelp0EVbOJQa9r6PqO4YXqpiVq9KYGCSxpakiYJtL6 OPBVcyQEOJEGvNYBrvGpPuv15mkiuTStd7LZoYTF0qYE8JQU1WGPEN9ic53zGYuQ1F4E mJ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=nGlu+O6PlfW3f4AqMN8ylp1+LKCaEOK0oFUo4L9z4xA=; b=ih6//7y0WwG1FhVCZprrR3usYJSIhXKzvBkrfcKcCwkXJAx4L5egpD/FRAVcEukpiY IjFqda9MGdJFCtwheO1V7p0C2ZmwUWWDZZGmyW5SGOAv2QSe94kuO8lvB9hs7utQroH0 hs56hjuIV8o6rAbBi5a5GV3BpH6NsT1p0pLw1yRPVhaflLrcjcFsbXpcSflIdj81+9bh 2Ve1QcpojkV46q3BRbn2PoRKqY3irgtIKowB045ksR5N0B7AvQhAgBAp0TsXHK+34G4P qsyu+48lgaP3Wo3nmq+wqC0y8SAXL5JLkHpKtd7cGOJ8RwUaNoWDeyBlJ5Nrmg3zVzLn e+/Q== X-Gm-Message-State: ACgBeo1UkaFHIliLc84iCR5WRNDuhh2ULlc8eFNqYn8XjE5j3KydE3vK EA/03HB1bKAgpCbzJ8s7zKGJ6w== X-Google-Smtp-Source: AA6agR5ZEuRdm/1QAOIGaAcNDlwntn9DuFUT138xlWy0ZrQWQV31HT8C2Kgpx41gGSCq6ES6au8o0A== X-Received: by 2002:a5d:6245:0:b0:225:3e24:e5b1 with SMTP id m5-20020a5d6245000000b002253e24e5b1mr2089702wrv.698.1662555093607; Wed, 07 Sep 2022 05:51:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 05:51:33 -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 3/6] driver/net/tun: Added features for USO. Date: Wed, 7 Sep 2022 15:50:45 +0300 Message-Id: <20220907125048.396126-4-andrew@daynix.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907125048.396126-1-andrew@daynix.com> References: <20220907125048.396126-1-andrew@daynix.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Added support for USO4 and USO6. For now, to "enable" USO, it's required to set both USO4 and USO6 simultaneously. USO enables NETIF_F_GSO_UDP_L4. Signed-off-by: Andrew Melnychenko --- drivers/net/tap.c | 10 ++++++++-- drivers/net/tun.c | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 9e75ed3f08ce..a2be1994b389 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c @@ -957,6 +957,10 @@ static int set_offload(struct tap_queue *q, unsigned long arg) if (arg & TUN_F_TSO6) feature_mask |= NETIF_F_TSO6; } + + /* TODO: for now USO4 and USO6 should work simultaneously */ + if ((arg & (TUN_F_USO4 | TUN_F_USO6)) == (TUN_F_USO4 | TUN_F_USO6)) + features |= NETIF_F_GSO_UDP_L4; } /* tun/tap driver inverts the usage for TSO offloads, where @@ -967,7 +971,8 @@ static int set_offload(struct tap_queue *q, unsigned long arg) * When user space turns off TSO, we turn off GSO/LRO so that * user-space will not receive TSO frames. */ - if (feature_mask & (NETIF_F_TSO | NETIF_F_TSO6)) + if (feature_mask & (NETIF_F_TSO | NETIF_F_TSO6) || + (feature_mask & (TUN_F_USO4 | TUN_F_USO6)) == (TUN_F_USO4 | TUN_F_USO6)) features |= RX_OFFLOADS; else features &= ~RX_OFFLOADS; @@ -1091,7 +1096,8 @@ static long tap_ioctl(struct file *file, unsigned int cmd, case TUNSETOFFLOAD: /* let the user check for future flags */ if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | - TUN_F_TSO_ECN | TUN_F_UFO)) + TUN_F_TSO_ECN | TUN_F_UFO | + TUN_F_USO4 | TUN_F_USO6)) return -EINVAL; rtnl_lock(); diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 259b2b84b2b3..f0e674e1c45e 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -185,7 +185,7 @@ struct tun_struct { struct net_device *dev; netdev_features_t set_features; #define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \ - NETIF_F_TSO6) + NETIF_F_TSO6 | NETIF_F_GSO_UDP_L4) int align; int vnet_hdr_sz; @@ -2871,6 +2871,12 @@ static int set_offload(struct tun_struct *tun, unsigned long arg) } arg &= ~TUN_F_UFO; + + /* TODO: for now USO4 and USO6 should work simultaneously */ + if (arg & TUN_F_USO4 && arg & TUN_F_USO6) { + features |= NETIF_F_GSO_UDP_L4; + arg &= ~(TUN_F_USO4 | TUN_F_USO6); + } } /* This gives the user a way to test for new features in future by From patchwork Wed Sep 7 12:50:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Melnichenko X-Patchwork-Id: 12968945 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 949EBC54EE9 for ; Wed, 7 Sep 2022 12:51:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbiIGMv5 (ORCPT ); Wed, 7 Sep 2022 08:51:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230042AbiIGMvn (ORCPT ); Wed, 7 Sep 2022 08:51:43 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A75B47EFC1 for ; Wed, 7 Sep 2022 05:51:38 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id c11so16011610wrp.11 for ; Wed, 07 Sep 2022 05:51:38 -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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=d8usAzUq61FHCkycIEkOgq4s+Z72vQd7Ep2+wzeLNx0=; b=tc0mdEtni7/nOq0fIaWQgH+uEG30vyB66b9/WsPVyH+gpue1NXrm7kTQX6pgN44qpZ xWjgVI7c8uWhnA8ZQF+pgyRHzV7La780nYJuaDQMjcD901EyChb/dkNRdd/j5D/Yj2IO 3PZV4/iBDOXKb7/dWHm75vyV1yfH4WYWLKJ6mi1LUMobFHRNNOup1DdYZhwzAgpXWATi FDDFX4A0//QRgbyT0kSt91Rx+u7zIEg/B7j0gvI3Secnir2M4KWuebK2vCq0Pp16+9DB s3OallXrqWazBet592eeqOHspb5iokojsQO1b99z03rbYc6kghqFqQ733GH+HcGfr3ul MEJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=d8usAzUq61FHCkycIEkOgq4s+Z72vQd7Ep2+wzeLNx0=; b=uikZpltXk5NivXcY3dwk0Kb3Sr20moAPGEJyLeLN74eiJngADCTo/Mp/k0bYUyWGpH eHnQkTHXD+GYJoySgKeL33oB/AH/s9er+3YcgjcSsEjkoayPuPMzdwn2AmXa7aFienvj vKeLGVyhjC6z9G1lEm6W7S9+j4ErkkblSrM/cDGUGuSJDwMjKsS/HKuRhdW9sV9Dehsf FvPZzWbixFiCmNok4SmmYv7tA4eRir51nuHPF+pBLTKhtPb9m5FBZLA7OS4WXui1MuQc jtjKUm/ZbID2hZvzxxfOngmmf1qKiJ1FyGNg3ZToOFAiGGd/qhc4AVUCWbsijpgnstB4 eYwQ== X-Gm-Message-State: ACgBeo1jBWtFsRRYzMfxdepqFCjzVK7YRPchhvlz2yQTr5XlFw9uRCnn q7JGusUmxp2/L0z3rC6fq4v+Pg== X-Google-Smtp-Source: AA6agR59wHMg1sPtOCvnjt0/QqpolL8iqEduFZMHwOY1R/xf2tHBzq16FwMtqjvJ7fJ6vbfLc3TvYQ== X-Received: by 2002:adf:f6cf:0:b0:228:9b2f:c305 with SMTP id y15-20020adff6cf000000b002289b2fc305mr1971325wrp.427.1662555096441; Wed, 07 Sep 2022 05:51:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 05:51:36 -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 4/6] uapi/linux/virtio_net.h: Added USO types. Date: Wed, 7 Sep 2022 15:50:46 +0300 Message-Id: <20220907125048.396126-5-andrew@daynix.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907125048.396126-1-andrew@daynix.com> References: <20220907125048.396126-1-andrew@daynix.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Added new GSO type for USO: VIRTIO_NET_HDR_GSO_UDP_L4. Feature VIRTIO_NET_F_HOST_USO allows to enable NETIF_F_GSO_UDP_L4. Separated VIRTIO_NET_F_GUEST_USO4 & VIRTIO_NET_F_GUEST_USO6 features required for Windows guests. Signed-off-by: Andrew Melnychenko --- include/uapi/linux/virtio_net.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index 29ced55514d4..5156a420564f 100644 --- a/include/uapi/linux/virtio_net.h +++ b/include/uapi/linux/virtio_net.h @@ -57,6 +57,10 @@ * Steering */ #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ #define VIRTIO_NET_F_NOTF_COAL 53 /* Guest can handle notifications coalescing */ +#define VIRTIO_NET_F_GUEST_USO4 54 /* Guest can handle USOv4 in. */ +#define VIRTIO_NET_F_GUEST_USO6 55 /* Guest can handle USOv6 in. */ +#define VIRTIO_NET_F_HOST_USO 56 /* Host can handle USO in. */ + #define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */ #define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */ #define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */ @@ -130,6 +134,7 @@ struct virtio_net_hdr_v1 { #define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */ #define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv4 UDP (UFO) */ #define VIRTIO_NET_HDR_GSO_TCPV6 4 /* GSO frame, IPv6 TCP */ +#define VIRTIO_NET_HDR_GSO_UDP_L4 5 /* GSO frame, IPv4& IPv6 UDP (USO) */ #define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN set */ __u8 gso_type; __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ From patchwork Wed Sep 7 12:50:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Melnichenko X-Patchwork-Id: 12968944 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63B78C6FA82 for ; Wed, 7 Sep 2022 12:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbiIGMv4 (ORCPT ); Wed, 7 Sep 2022 08:51:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbiIGMvn (ORCPT ); Wed, 7 Sep 2022 08:51:43 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C1D679687 for ; Wed, 7 Sep 2022 05:51:40 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id bz13so16823835wrb.2 for ; Wed, 07 Sep 2022 05:51:40 -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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=1lVpjtDlaF+5VhIEURmZCQn6FL6I+O+1d6YHDApNOVo=; b=5UQNPtqdkHpPWN0N9/VEPYYyYNwtNnwe+9/3G7MdlNAfG8WjcMeWVFb/Wr9BBND3Ti FL5Ek2A+ZXash4w/mb7J1X863Ol65gpFzJYJ3QOfWJZlFFbxYHbDOgTCvOpvj4r3zfjz q7wJzkYmJo1kyBvDKsJkO70q+OCp1qgJYhJTeaceKscLPyvkGgbjZsvZY+uzXF6IKRrB DWPpbNWp4dg+fikIcudCObxMyfECnE+fYdf4+EoYudL7scDufpWTpMSDQdiWADquaNfy DoaqqzahRz+M50gl0MmrgCEz4OMswO469LBZKsc4MEJMIo/6mMUjPeqemPnFdlMpDGOU 2eLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=1lVpjtDlaF+5VhIEURmZCQn6FL6I+O+1d6YHDApNOVo=; b=w9/fEf+jrbLaIPeAfUWQjykFstCCPf23Hs6r2iAnVLkEuTcQHYFk++3xNRPrZYqG6A oPVl4omlbhNCJ89aMzySbhEyfJD+cZviA6R8d0wcPwyESoEzO6k9UevCRCgNfMdI+C0f 44chrPsaEp1NrIayxtN86UxsAMieeHuMCEBBNSNlHQMoiQoW2fTm2SkFBtYr8oqxVfLv FdK8tU0iWh5PnWg2yc6lDYYWl0+cQeHauf0q16lWZsOWhp24bbud1Fsn6vLyEXVclnSB Lte52G8oUtLq4f3gpI45lFUY8U3zy1OzH7UAoBtQkAcqSLcPak4Bj747Ct+3w1yLQkOC o6kg== X-Gm-Message-State: ACgBeo1ZOPnElqT9iXp1S/cQMStJhPUlBsRwxkEVTLQjNrMjpQJRlAiK 7EFmIl6kwpRSzw35tjVVJwBwyNbdvGlYMSQZ X-Google-Smtp-Source: AA6agR7E7ieAZs6ZSxlc170nzW3ZuxPMzwS5U8xxx/8UBWzcJrILidBN+RNwFSraQHtxHJDkCS7XLA== X-Received: by 2002:a5d:588b:0:b0:227:1c28:f470 with SMTP id n11-20020a5d588b000000b002271c28f470mr2106538wrf.331.1662555099965; Wed, 07 Sep 2022 05:51:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 05:51:39 -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 5/6] linux/virtio_net.h: Support USO offload in vnet header. Date: Wed, 7 Sep 2022 15:50:47 +0300 Message-Id: <20220907125048.396126-6-andrew@daynix.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907125048.396126-1-andrew@daynix.com> References: <20220907125048.396126-1-andrew@daynix.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now, it's possible to convert USO vnet packets from/to skb. Added support for GSO_UDP_L4 offload. Signed-off-by: Andrew Melnychenko --- include/linux/virtio_net.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index a960de68ac69..bdf8de2cdd93 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -15,6 +15,7 @@ static inline bool virtio_net_hdr_match_proto(__be16 protocol, __u8 gso_type) case VIRTIO_NET_HDR_GSO_TCPV6: return protocol == cpu_to_be16(ETH_P_IPV6); case VIRTIO_NET_HDR_GSO_UDP: + case VIRTIO_NET_HDR_GSO_UDP_L4: return protocol == cpu_to_be16(ETH_P_IP) || protocol == cpu_to_be16(ETH_P_IPV6); default: @@ -31,6 +32,7 @@ static inline int virtio_net_hdr_set_proto(struct sk_buff *skb, switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { case VIRTIO_NET_HDR_GSO_TCPV4: case VIRTIO_NET_HDR_GSO_UDP: + case VIRTIO_NET_HDR_GSO_UDP_L4: skb->protocol = cpu_to_be16(ETH_P_IP); break; case VIRTIO_NET_HDR_GSO_TCPV6: @@ -69,6 +71,11 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, ip_proto = IPPROTO_UDP; thlen = sizeof(struct udphdr); break; + case VIRTIO_NET_HDR_GSO_UDP_L4: + gso_type = SKB_GSO_UDP_L4; + ip_proto = IPPROTO_UDP; + thlen = sizeof(struct udphdr); + break; default: return -EINVAL; } @@ -182,6 +189,8 @@ static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb, hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; else if (sinfo->gso_type & SKB_GSO_TCPV6) hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6; + else if (sinfo->gso_type & SKB_GSO_UDP_L4) + hdr->gso_type = VIRTIO_NET_HDR_GSO_UDP_L4; else return -EINVAL; if (sinfo->gso_type & SKB_GSO_TCP_ECN) From patchwork Wed Sep 7 12:50:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Melnichenko X-Patchwork-Id: 12968949 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5853BC54EE9 for ; Wed, 7 Sep 2022 12:52:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbiIGMw1 (ORCPT ); Wed, 7 Sep 2022 08:52:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230009AbiIGMwJ (ORCPT ); Wed, 7 Sep 2022 08:52:09 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8DBCBA17F for ; Wed, 7 Sep 2022 05:51:51 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id bd26-20020a05600c1f1a00b003a5e82a6474so9435807wmb.4 for ; Wed, 07 Sep 2022 05:51:51 -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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=ywbHx8uPG8BROy2AsLXbenY9pZ4XxIgdV+TM84PqKY0=; b=EagLoc7mgqRqmMzrCNlH+G2xp1vLIBxFZpHuINYqAaumHZ5H6eRgyj9jQkR+IweVbV 39/X7EcIhisZOWCcX99rev3RzuR0Z5HJaj3+wQAUXm535kF0A1RfVKTqAJAiTObxR+Mm CDQRl21UIwabggLm4/1v+zNTDMTrgNi05NoyI2fnarXAqnjrBbLJZanxQg3g47AYjuoc WMS175FGz90fjq++UTLU5R/HgAlRC0PzyRvwGqiKRjkVBjlLcM+bK28OYzjsRLka9yJH XnzKZi+FhkaF6KaKMHiNaCnBOqH4QocSuyaVjY3i+qr40tmxu4lSoms05JVpoT1yViBB o1Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=ywbHx8uPG8BROy2AsLXbenY9pZ4XxIgdV+TM84PqKY0=; b=D+cZO9VD6h9s49qCkBmN+4hz/kceUvWhrlwwNGUl581lvu/x8WEEFLRfuuTsPJQBVa m1pAuixK2U8iIayEqOgeV12dKtFVbTt97PpHTc3wRVv/FOXG4PU1kSGX+KQ3j37T4HdF bH7I64/VOikoqhYVYqnVfeGmnl0fzNSix0p2kGEYhHju8FqJF9uTN/4YgPKyknTaY7tm DtToC78NGQrN4F9IyVtzbvmAvoGzKdkbV/D0p6LySUcoGAjkgl/B+4SQGkd8XtHSxe1F 9BLHe5NegIXwroO4dHO/ES0IbpovMjSk7kBC0yE1DIycl6LgXj//+HkFBbXpxLwAGLJI Lrqw== X-Gm-Message-State: ACgBeo1dbhalLq2fk+Olavdo1H/6DlGjJZun1cMJWcUwWSTCMg0+9o1t AKzHJqjeJzzdtJygBVFmHeaivQ== X-Google-Smtp-Source: AA6agR5TISsCqM1wwAjvQMCYn+H4fwJF0mxPK90BuOZ14oHjdYbfn6F/Q47rCCiVb3TXt5olnSbtVg== X-Received: by 2002:a7b:c848:0:b0:3a5:41f6:4d37 with SMTP id c8-20020a7bc848000000b003a541f64d37mr1987590wml.23.1662555103607; Wed, 07 Sep 2022 05:51:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 05:51:43 -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 6/6] drivers/net/virtio_net.c: Added USO support. Date: Wed, 7 Sep 2022 15:50:48 +0300 Message-Id: <20220907125048.396126-7-andrew@daynix.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907125048.396126-1-andrew@daynix.com> References: <20220907125048.396126-1-andrew@daynix.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now, it possible to enable GSO_UDP_L4("tx-udp-segmentation") for VirtioNet. Signed-off-by: Andrew Melnychenko --- drivers/net/virtio_net.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 9cce7dec7366..0f70110957eb 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -60,13 +60,17 @@ static const unsigned long guest_offloads[] = { VIRTIO_NET_F_GUEST_TSO6, VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, - VIRTIO_NET_F_GUEST_CSUM + VIRTIO_NET_F_GUEST_CSUM, + VIRTIO_NET_F_GUEST_USO4, + VIRTIO_NET_F_GUEST_USO6 }; #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_UFO) | \ + (1ULL << VIRTIO_NET_F_GUEST_USO4) | \ + (1ULL << VIRTIO_NET_F_GUEST_USO6)) struct virtnet_stat_desc { char desc[ETH_GSTRING_LEN]; @@ -3082,7 +3086,9 @@ static int virtnet_xdp_set(struct net_device *dev, struct bpf_prog *prog, virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) || - virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM))) { + virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM) || + virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_USO4) || + virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_USO6))) { NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing GRO_HW/CSUM, disable GRO_HW/CSUM first"); return -EOPNOTSUPP; } @@ -3734,6 +3740,8 @@ static int virtnet_probe(struct virtio_device *vdev) dev->hw_features |= NETIF_F_TSO6; if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN)) dev->hw_features |= NETIF_F_TSO_ECN; + if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_USO)) + dev->hw_features |= NETIF_F_GSO_UDP_L4; dev->features |= NETIF_F_GSO_ROBUST; @@ -3780,7 +3788,9 @@ static int virtnet_probe(struct virtio_device *vdev) if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN) || - virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_UFO)) + virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_UFO) || + (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_USO4) && + virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_USO6))) vi->big_packets = true; if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) @@ -4021,6 +4031,7 @@ static struct virtio_device_id id_table[] = { VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \ VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \ VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, \ + VIRTIO_NET_F_HOST_USO, VIRTIO_NET_F_GUEST_USO4, VIRTIO_NET_F_GUEST_USO6, \ VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \ VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \ VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \