Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp940293ioo; Thu, 26 May 2022 19:51:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvfOQxE5wE3GP3D00UsquAbkFErJZFZ7nMOwEytV7DthxSydMRqB2TRygH6t5yQ9EqAA47 X-Received: by 2002:a17:907:9723:b0:6fe:f76c:8598 with SMTP id jg35-20020a170907972300b006fef76c8598mr18497344ejc.107.1653619894535; Thu, 26 May 2022 19:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653619894; cv=none; d=google.com; s=arc-20160816; b=EnrfggpjK1WenD7LpyhkbektnfwRhEkmaTrnX26p0Arsaz+GAdueDeIqYrNwWl1Cpj 0QYIjp5By30pG57Srv8P22F76ap36eWmgCFVBVC0X0HPxD6+O/RQ1WLDcreS63B+dMT/ eT7gc1/iTCuoaS5Fl4SuGPCnnIJn9eOoc+OGwgMBZZMkRhclACZAXfzx08f/IOZ/J1W6 eKVbxyqe9F/PLUdjFgr3wrgmBLbyvUG3+RvILvoKK6rG32VRF/+n0uJEmt3CTilD4bu4 pTC2OiE3YAr42WxGO8JbvQD/Oad61GuaWuK0CqUukHdIRVpv/BAm7swgEn7o4ww8QACF kJ7w== 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=6fSmWl84XotlVVnrCywqRUyajUPmOb6IaEg27dR9dGY=; b=TR/wSPHzFMZg67as7eMTSZSWH5Txoo0D8P8Qf9RO62EWfPiPwTPaHKa44Lgb1sEwnK ZUDwJ6DV+7Ojb03uG0DtrZHN316W2xVP1XTyqfhvg6uHY74Dd0FHKypkIKXSGSCR/yNk FVsAfqXJndnqUiskYY7NIpJeLOi7pVYKB5MGRESTXDkEfwRDpjrCMhZ20L/oa29xtdgF s4WkHTIQ9SWqVSoKWhKCDJ6ETpYWgoTd9UQrHDMU1GlvEBgHNJmORtvCCMnHSmqkIpqe J8y02NphkPK3EwgyzJvjxCX6uDvLRTrbd4yiM5aHj6g0ifXn2OAm2PssMz7a6MKXYeFG 1JGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="NbPPt9c/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh9-20020a0564020f8900b0042b756321f5si2588336edb.104.2022.05.26.19.50.59; Thu, 26 May 2022 19:51:34 -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=@redhat.com header.s=mimecast20190719 header.b="NbPPt9c/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233302AbiEZG4h (ORCPT + 99 others); Thu, 26 May 2022 02:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbiEZG4g (ORCPT ); Thu, 26 May 2022 02:56:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 56E577A450 for ; Wed, 25 May 2022 23:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653548194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6fSmWl84XotlVVnrCywqRUyajUPmOb6IaEg27dR9dGY=; b=NbPPt9c/6kj1qInz0vOMS5Nb0unk8GFS/dvYvK9ECOxAt1RUio8h9/nVSzKU/y32qz/J+u akUhju5jlY5LPwPEXXs/QxyUYsa5bc9oiPnlsEfO1h4XbzdcId0HT7kSUkyqznaM4LlGuU WKB2HE3ZYSaDJjVFZC17sUq9XQXpDWc= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-269-JwGZfuhvOhKArYJtd7Feaw-1; Thu, 26 May 2022 02:56:31 -0400 X-MC-Unique: JwGZfuhvOhKArYJtd7Feaw-1 Received: by mail-lf1-f69.google.com with SMTP id g11-20020a05651222cb00b0047872568226so463045lfu.3 for ; Wed, 25 May 2022 23:56:31 -0700 (PDT) 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=6fSmWl84XotlVVnrCywqRUyajUPmOb6IaEg27dR9dGY=; b=Ur8TGQYxqveTDCAz9rodDBKl/7xtP7h/BuWMfkuY3+1iNRy638HcZ9Xo+6Dxmh8r1F s4lgvcJPcd+x6Ao5UkBCgpcKvZab2Fk5ilQxqay+LRkSz0zhIU+NeCQZgypSNLhO+QEp 8o+t5gjymniRRR/dK5+3Tl26hWLwLvLciIEWoEMPaaeDXD5fQmIzjgcQgJtfP0oMs0Tz LmXjcMvVAGqI2Xa/tFqtHhCX3hgD+ZHA5vdwUf1DXnTZNYGwrsYrQoTbGbJWJ0yTHWyt bQ78uxo2Tz5d5irNSxrWenymx58TGD0b6/ijb4MU3U8hQ+aNsuikTVOldsjrFMC059F6 7P4A== X-Gm-Message-State: AOAM532l8ngLYlo6Z7CWKLt7Nu6B7mtp64T7dYz4mJM6qnnNS4RuaAsx ndD6nHZmYVH+4X5PH4vWlMBO+bYCozW0NKQRn0Lfpl7nPhj8JBM4uML2kR5OoOw3Pbzq9cok6gi f1BILz4v4R92DBLr2bwNOl0xu1Ofdwptg3MGrpmuX X-Received: by 2002:a05:6512:39d2:b0:478:5ad6:1989 with SMTP id k18-20020a05651239d200b004785ad61989mr19549569lfu.98.1653548190278; Wed, 25 May 2022 23:56:30 -0700 (PDT) X-Received: by 2002:a05:6512:39d2:b0:478:5ad6:1989 with SMTP id k18-20020a05651239d200b004785ad61989mr19549558lfu.98.1653548190070; Wed, 25 May 2022 23:56:30 -0700 (PDT) MIME-Version: 1.0 References: <20220512112347.18717-1-andrew@daynix.com> In-Reply-To: From: Jason Wang Date: Thu, 26 May 2022 14:56:18 +0800 Message-ID: Subject: Re: [RFC PATCH v2 0/5] TUN/VirtioNet USO features support. To: Andrew Melnichenko Cc: davem , Eric Dumazet , Jakub Kicinski , Paolo Abeni , mst , netdev , linux-kernel , virtualization , Yan Vugenfirer , Yuri Benditovich Content-Type: multipart/mixed; boundary="0000000000007d4a8d05dfe4b040" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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 --0000000000007d4a8d05dfe4b040 Content-Type: text/plain; charset="UTF-8" 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 > > > > > > --0000000000007d4a8d05dfe4b040 Content-Type: application/octet-stream; name="0001-udp-allow-header-check-for-dodgy-GSO_UDP_L4-packets.patch" Content-Disposition: attachment; filename="0001-udp-allow-header-check-for-dodgy-GSO_UDP_L4-packets.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l3mnw1q30 RnJvbSA0Y2VkNmZmM2E4ZWExM2IwNjlkZDMwODdhYjIyZDI1MjY5NmUxZGVmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKYXNvbiBXYW5nIDxqYXNvd2FuZ0ByZWRoYXQuY29tPgpEYXRl OiBUaHUsIDI2IE1heSAyMDIyIDE0OjI5OjE3ICswODAwClN1YmplY3Q6IFtQQVRDSF0gdWRwOiBh bGxvdyBoZWFkZXIgY2hlY2sgZm9yIGRvZGd5IEdTT19VRFBfTDQgcGFja2V0cwpDb250ZW50LXR5 cGU6IHRleHQvcGxhaW4KClNpZ25lZC1vZmYtYnk6IEphc29uIFdhbmcgPGphc293YW5nQHJlZGhh dC5jb20+Ci0tLQogbmV0L2lwdjQvdWRwX29mZmxvYWQuYyB8IDEwICsrKysrKysrKysKIDEgZmls ZSBjaGFuZ2VkLCAxMCBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvbmV0L2lwdjQvdWRwX29m ZmxvYWQuYyBiL25ldC9pcHY0L3VkcF9vZmZsb2FkLmMKaW5kZXggNmQxYTRiZWMyNjE0Li45NTc5 ODg2Y2U1NTcgMTAwNjQ0Ci0tLSBhL25ldC9pcHY0L3VkcF9vZmZsb2FkLmMKKysrIGIvbmV0L2lw djQvdWRwX29mZmxvYWQuYwpAQCAtMjgwLDYgKzI4MCwxNSBAQCBzdHJ1Y3Qgc2tfYnVmZiAqX191 ZHBfZ3NvX3NlZ21lbnQoc3RydWN0IHNrX2J1ZmYgKmdzb19za2IsCiAJaWYgKGdzb19za2ItPmxl biA8PSBzaXplb2YoK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