Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1385019iog; Thu, 16 Jun 2022 05:24:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vNCjyXk6ndmFXurQjwanWXwcCs7NlpHLzwNugH8z1fAbbqe1Ft3hE1gssSuTsrkFw8MYaa X-Received: by 2002:a17:90b:1e0f:b0:1e3:16bd:34e9 with SMTP id pg15-20020a17090b1e0f00b001e316bd34e9mr4860936pjb.63.1655382254047; Thu, 16 Jun 2022 05:24:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655382254; cv=none; d=google.com; s=arc-20160816; b=jXZSROeVEsgXqXVCiEDfQcaMAtmvSWUqzShv1GraRCyKW38WUfK3LvejxyscIiVrJE q5DYIvXQLp8H8Vppz/mON1MoMtHphAc5Pydzc4RDNYpslGMdXaLHfMKACKz/oU49n54x zuuO2lo6ucMO1wG5laotyiP32Idzwy4wKzvJv4e4RuULffqit9zmaVS+ZlPRJZqVQ0gH sqvrRpCzuTSJFGyv0uoNEz8oI1mEAAw4paV1ZxAwnmHUOIQil/we0Frw6qPS0+K2eprU NxZrvfCVydEFKfreNz8LDf6MxOXZzqR5LpnezRQ9IKYoB06mM0GMLz02V6ROrTVbb+gw iCGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tKhLhAU1VwnhstyxXFD1uOF/c3hqPPQcj1y5Vx8V8sI=; b=WzSXdq3QmtAFkSCqzM+EEKiUZISFq1EKyDEnG0IeJd+oGB5LakI43x5+5/DCDjdYmV 7oGJspPa+WnMSEsCPCZVBOc3j83eInhoGYTGyYqb9jq4txnf2cUsWbFQI9E0Iyp6Slcx qEwAgjTR+PTgNPoAV1QdFaIodHWHea/Gv8db2wsmdK8hXh4iN0Ri14JEVUWF8BBHQmZe KAiY78XuRIrQtykhmg5tF6l+EtypfNZMwFX8gCjd98VPxWa5+Mo4Z5pjjQs/TZwwjVxY Ka1dx4w3zNY3VkJ5VL6SdklZ4NTX7zF6EqjFcdcpYxaIpkpneXggpNdk0jRLrTAGZJYS OGAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=FPNp7AlE; 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 j192-20020a638bc9000000b003fc2d55fef2si2178131pge.714.2022.06.16.05.23.48; Thu, 16 Jun 2022 05:24:14 -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=FPNp7AlE; 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 S229708AbiFPL7l (ORCPT + 99 others); Thu, 16 Jun 2022 07:59:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbiFPL7k (ORCPT ); Thu, 16 Jun 2022 07:59:40 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D31C25DD07 for ; Thu, 16 Jun 2022 04:59:39 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id v143so1572379oie.13 for ; Thu, 16 Jun 2022 04:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tKhLhAU1VwnhstyxXFD1uOF/c3hqPPQcj1y5Vx8V8sI=; b=FPNp7AlEq73YPzIn+VQs0w+sTCDNSZtdGNK6FPZOOnRz6tQLqIUmO8x3K13QLdj6Z5 0p5nDdLps78jmHX/rEKQ7uQv7kMSIlNmcnauti/kss8KH/eL6uo7WLnbNJAAhDkzVC6k Z6eQ1ZtGu6YoTrh2Wwr5cHKM3Wu6Gjujtq4ikFRqAGxPQnwA5i0s6UxRT6KyBosqZXQC IOGwceh2lXzSbYZASloqNUkNauKwA2/slJXb0K+7SyIRe4MRHNOTrxBwCmX4YK79bueL rwm3FIwM0OINR1dWM8TM1rAUk4YIKvYzrj0kg5SwkVuIW2piinJhFupsSiIQA8wVodOg ekxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tKhLhAU1VwnhstyxXFD1uOF/c3hqPPQcj1y5Vx8V8sI=; b=L2xbHdRX+7zdBV8NIaWsB5BJOTvYDkPKnqpxw+Bzs9FupNxl0wF2Bpdqt58u5eJZPb yz+vCjVLn8h0b+rhfXQOg3PfPxDEnbztC0PPxLfHft5ItOaGxisKbRgFB4F+9Yu49eDF tQ0JH9ycoZzDkQ5lcLDOvxosz7notyB64XfGZsxbYGKOaPBJRr6PfaUFSpX8LpSc2PF0 jKFU0VAFBLrYiZxVZQ7ygEQSNDdx1QKQgAIr2+ufeoLdnCq8U0i9NekK2TYJ94duUgVN 7ZgiB4JbPZ6tJPRiURQLAyYb19OpzVf0vC+50tD3SEh6WN/DL9gYabZAOwpdAAkBmgim q+FA== X-Gm-Message-State: AJIora9OXiHfNzzT9KhynvbraFnk+cpJc7Id4UJBlNjfDwRot4hPVJhr tcJvGOO69VpPlGttCQE0/RPkpEDiobUP7uwTQN6hYg== X-Received: by 2002:a05:6808:10c1:b0:331:39ca:a500 with SMTP id s1-20020a05680810c100b0033139caa500mr2341417ois.137.1655380779203; Thu, 16 Jun 2022 04:59:39 -0700 (PDT) MIME-Version: 1.0 References: <20220512112347.18717-1-andrew@daynix.com> In-Reply-To: From: Andrew Melnichenko Date: Thu, 16 Jun 2022 14:59:28 +0300 Message-ID: Subject: Re: [RFC PATCH v2 0/5] TUN/VirtioNet USO features support. To: Jason Wang Cc: davem , Eric Dumazet , Jakub Kicinski , Paolo Abeni , mst , netdev , linux-kernel , virtualization , Yan Vugenfirer , Yuri Benditovich Content-Type: text/plain; charset="UTF-8" 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 Hi, Jason Apparently, your patch should work. For now, I have an issue where segmentation between two guests on one host still occurs. Neither previous "hack" nor your patch helps. Now I'm looking what the issue may be. If you have some suggestions on where may I look, it would be helpful, thanks! On Thu, May 26, 2022 at 3:18 PM Andrew Melnichenko wrote: > > I'll check it, thank you! > > On Thu, May 26, 2022 at 9:56 AM Jason Wang wrote: > > > > On Tue, May 24, 2022 at 7:07 PM Andrew Melnichenko wrote: > > > > > > Hi all, > > > > > > The issue is that host segments packets between guests on the same host. > > > Tests show that it happens because SKB_GSO_DODGY skb offload in > > > virtio_net_hdr_from_skb(). > > > To do segmentation you need to remove SKB_GSO_DODGY or add SKB_GSO_PARTIAL > > > The solution with DODGY/PARTIAL offload looks like a dirty hack, so > > > for now, I've lived it as it is for further investigation. > > > > Ok, I managed to find the previous discussion. It looks to me the > > reason is that __udp_gso_segment will segment dodgy packets > > unconditionally. > > > > I wonder if the attached patch works? (compile test only). > > > > Thanks > > > > > > > > > > > On Tue, May 17, 2022 at 9:32 AM Jason Wang wrote: > > > > > > > > On Thu, May 12, 2022 at 7:33 PM Andrew Melnychenko wrote: > > > > > > > > > > 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. > > > > > > > > Could you explain this more? It looks like a bug. (Or any pointer to > > > > the discussion) > > > > > > > > Thanks > > > > > > > > > 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 > > > > > > > > > > > >