Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3738555pxj; Tue, 11 May 2021 10:49:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxiPZtquFNr9Ndttv1mzf9pmudhClGA+vEhBa1L92N0ZxmYRKx9S6A35TpXgfaISloD5xL X-Received: by 2002:a17:907:3342:: with SMTP id yr2mr33382644ejb.325.1620755372114; Tue, 11 May 2021 10:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620755372; cv=none; d=google.com; s=arc-20160816; b=LpFOh4HOd0TrhDh0wgsmhS/hXhrAhf3QqaG4qW8XOwfwMTpeuZKSg0vwqwdPOanMle IxulUPfiwwoJC6HdtCARRbfD9FOze3QTU5c5eGNGCdk0YlLuEJpAGWDTIyP26kjl32rC SLS3chpn1GQEalimXpuq4QDgs8eHhkhdTaOb4TTRNyL7xs+NlczOgXjAfvifUGX8LBRk ZAVX/f1nS1csFbNQysopAWoRQnvCEjHXgmIzq6ouvCmaoWDvQoOGj5dBr/HIpzof674W hmbreE7IxhoG9VOsHN/fcqjW1GORU+lLbeBhrfI2jAknu9mHpDO8PPCBWQAeA3Rb3Mbl U9gw== 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=tXU/u/oI0c/X+zEdSbjxSjUwDdEq6XptIKJISi7rLG4=; b=1EWfUJtw76jbl9UmxIShp344FHrYCoDL1vXC00PnPYUWqKzo/kS5rmwTy6cs/ibc7e 5I7Mn3vDjCtvMf/FBkr9TCLf1Me9Vb0bUSKrAnRGQNbee7sVfnWQexxsg2UfT9g1Fugd ITVLars3n18LX/Y57zpah09TO/91vYwfsNn8Trq273kccagQBHRJpsnbnvxJzISXHyZI uMQ32yPK/i/lnQqVAlfZV3WwHLR23l2vsFkXgZpdsGLxgPSLhvJXDffohDjHM8JtMOP/ Qp6CUtoRWEhb2n10rHzgfeXSuQy5Gh666xKz1cwBDGooO3Jj5ESz4CVEumSnNUim6uFQ Wh6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MW+jnvnJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn20si2600519ejc.549.2021.05.11.10.49.07; Tue, 11 May 2021 10:49:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MW+jnvnJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231587AbhEKRtO (ORCPT + 99 others); Tue, 11 May 2021 13:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231329AbhEKRtO (ORCPT ); Tue, 11 May 2021 13:49:14 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C6E5C061574 for ; Tue, 11 May 2021 10:48:06 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id c22so2906384ejd.12 for ; Tue, 11 May 2021 10:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tXU/u/oI0c/X+zEdSbjxSjUwDdEq6XptIKJISi7rLG4=; b=MW+jnvnJIKnOGEtUwz3fsZFljt3ifuyz+WcJOv9QbqR3U2V0/NEvqymsIPF5umUnPa n33vPvd5/pV04hDrPogIfeHSHw3/5t/Tw18SowZjV5KRFhEqo53ycPeWzNXZJK0vrygI 2vdof3xPopC/8A3cK/cyPI92FtKVLjcJgCgI92yRKI3fSL1MbWf7DXTC5nmlSh7k7bKT xKx/RDXI2UpE63LVp7qr+/fbudVqiymDhuwPb2LQOgahSE9OAOqxqh/qSlAecMo9Niyv flgWhOIljYicY1kR15yAy7mDnLQkVAaueQyvWsVLdf5nBNIQKWydzX3qygCukvXMZKnR i3sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tXU/u/oI0c/X+zEdSbjxSjUwDdEq6XptIKJISi7rLG4=; b=ehLi0YikOs6gEeYWrnOCzemlNXetCrObYZG8azSnEPPyXNF9/J5PF2mrdY/IkI6YLN eFk+fG/ztm1ZRSwrJ1oSMjb7P/aXwUxEZBrs5fpufK5H1kx3lyaUJWSLqRV2LqfXal9r nKHNpv5DEnhsHir9hEfm0RtiEuODQ8h0WX4WX4HgzFWQU3NtMY3ZW2dVM+ID0L3TmPnu +heZ9bx7ZyaXg7J/UsTxQSogwy1cUJa2Ixb9YvOE7McAv+roisJKEid09kw+rcjxh8TE C8Mt4A0V/X9SazMNCDgRszLzrFaBrCioCILLqcFSolPE+8xjV3AI5abifAalH1SQmJlN LM+w== X-Gm-Message-State: AOAM530ioJemRE5U84c6LjoM00A08wxshK2nFBdvIdBcN2J8wLgXC4bf IJSFoMxavWs0PjW7qkaOvIocN3wnEjk= X-Received: by 2002:a17:906:8a51:: with SMTP id gx17mr32743866ejc.549.1620755284410; Tue, 11 May 2021 10:48:04 -0700 (PDT) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com. [209.85.221.52]) by smtp.gmail.com with ESMTPSA id y20sm15060236edw.45.2021.05.11.10.48.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 May 2021 10:48:03 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id l14so21002771wrx.5 for ; Tue, 11 May 2021 10:48:03 -0700 (PDT) X-Received: by 2002:a5d:6285:: with SMTP id k5mr4589508wru.50.1620755283209; Tue, 11 May 2021 10:48:03 -0700 (PDT) MIME-Version: 1.0 References: <20210511044253.469034-1-yuri.benditovich@daynix.com> <20210511044253.469034-3-yuri.benditovich@daynix.com> In-Reply-To: <20210511044253.469034-3-yuri.benditovich@daynix.com> From: Willem de Bruijn Date: Tue, 11 May 2021 13:47:26 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/4] virtio-net: add support of UDP segmentation (USO) on the host To: Yuri Benditovich Cc: David Miller , Jakub Kicinski , "Michael S. Tsirkin" , Jason Wang , Network Development , linux-kernel , virtualization@lists.linux-foundation.org, Yan Vugenfirer Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 12:43 AM Yuri Benditovich wrote: > > Large UDP packet provided by the guest with GSO type set to > VIRTIO_NET_HDR_GSO_UDP_L4 will be divided to several UDP > packets according to the gso_size field. > > Signed-off-by: Yuri Benditovich > --- > include/linux/virtio_net.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h > index b465f8f3e554..4ecf9a1ca912 100644 > --- a/include/linux/virtio_net.h > +++ b/include/linux/virtio_net.h > @@ -51,6 +51,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; If adding a new VIRTIO_NET_HDR type I suggest adding separate IPv4 and IPv6 variants, analogous to VIRTIO_NET_HDR_GSO_TCPV[46]. To avoid having to infer protocol again, as for UDP fragmentation offload (the retry case below this code).