Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3314786pxj; Tue, 11 May 2021 01:25:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7Az1NycHwY/a1luDkTG+IHwEN+rA2nam3xR6CsRgVrYlkR33Gdnw80fLC9GENQuvWj6+x X-Received: by 2002:a05:6402:26d6:: with SMTP id x22mr9202688edd.88.1620721553224; Tue, 11 May 2021 01:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620721553; cv=none; d=google.com; s=arc-20160816; b=DCq47xvdWLqv/z3elzEZrIzY2ZDfwfGHtceZEtzOmCynZPMKo4wfl8PXvmA5HE3yAy AMRHslzpN2rCZpJvAWisQQtEbAsDMa7FQ8oTF7uBsBnkIpcxTJcoUzsIHuebLgtAUdzJ 6AQ+f5/objeojrMC/FyIuHok5ixfsKfcobbZaeFoLVL9r90IpzCI3wXbx2dEh2CHZ9zs +qYvnd5evxMHXNDutH5SB61cCCGci3tRWwFbcVK/tytYEB/HIDXp3dJkdPezmPsS2uWI WrMvi6AfdnjX9TfYCCnQ9Q1NgaNCFO7yCp5gFV/hy0ARPt7hQVVshmGa7H2NaeDgLMqC 1rcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8c3iY9QRs+Fk/AUUgLxZIXmDXwT2HDilLt2LH9nAQ6U=; b=gfj180fXBFw8xqIYWU3bHaHZPu8jK5+bnth2wS6LLuDdDK7ZVqkcx33v1j+irwMqfr KS2VR6YB+c0QVorxJN+QF7HUOfi5tL1358L+zaudnExFGKoGtuIyCK1VTHaispN6ykPy 3gyuZCOIqrLMUtfoZX1mZlmmKl5rHZwE8g5kzmzZZqVf5TGa1c06V4CXyIphpNuBRmvA 09/iT7byBni30ih4Kc3z6NS+vJlOTGN3RjiyCAerA+W8sYqfhvx5HvTQdkwU6aIg07t8 s4VM/LT4ZacTx0fFa3rOJd581XaIaotOzv6eoSw4/SoypVR3Ob7nvtnrsSMo/iWuePLl 69RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20150623.gappssmtp.com header.s=20150623 header.b="SqBwnwM/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si16269347edd.565.2021.05.11.01.25.28; Tue, 11 May 2021 01:25:53 -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=@daynix-com.20150623.gappssmtp.com header.s=20150623 header.b="SqBwnwM/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230442AbhEKIZK (ORCPT + 99 others); Tue, 11 May 2021 04:25:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbhEKIZJ (ORCPT ); Tue, 11 May 2021 04:25:09 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84EB4C06175F for ; Tue, 11 May 2021 01:24:03 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id 36-20020a9d0ba70000b02902e0a0a8fe36so10520309oth.8 for ; Tue, 11 May 2021 01:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=8c3iY9QRs+Fk/AUUgLxZIXmDXwT2HDilLt2LH9nAQ6U=; b=SqBwnwM/kJAFlwEGwiDXj9c7Ma91fjZu8ayYoELqm6GAIraQZAPdhEQs9Hoyl60W7M 9Ce+tx+Gq0OFiKUjBDFbh8nmAsNk3mVX8aqVUZ/0OUYvPd6aP9FxVuD8qcxKLUJqcJFj puE3BNalWBDmjJhF+s/HUDKh2qdbsPyxeVVBrifg/Hfyf/Ctj6UoSwML0EHIFaxkD+QY gm+xTm6+/oSes6XIfdyECwuy1wC3CzjtM0nDX3ec/4ay5/DjTSzzkuiH7noGXBu/Z66t 4Pbpacn7kC8sS5PNmMjh0yzrPmqbjG8KPdHgYw9ca0CNg+In5D9zM8//YMnN6E18QQmV TvGA== 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:content-transfer-encoding; bh=8c3iY9QRs+Fk/AUUgLxZIXmDXwT2HDilLt2LH9nAQ6U=; b=CupYGJhN48Wy3Vdwvmq9dyZ4vurKZ7IKvfSGP6JwSmE2MjDZZS872Ra98uI9t7n1zS V97FpmZMYaMZ5fgRATQ+rMD4SbCpeeucL+4prqFCNk0MIkdzw+WiIQ43glg0Qyl7H/Ev z9LtR/S0M5cK0pmsrnTsJCR+QISuO1CqgvhDLqah08cTaHuAFD1Dm0hJu+zhiPDePdeL vXutyL/vrSFAkI4VVnctokszUou4cE1lf8nwoPHU/aLWM6LHvB7/Gh5TEmsMVSMRnrgb xRdCvjVnFb+eLo15p6grv/qAe4MT/qWOGeEi0uFrQHOsYpghqEMTMPoc0e/dO4w6GD63 jaow== X-Gm-Message-State: AOAM5330SgKGG6FKcF3UaY7yTxGMTyhyH0/uL4Ph/i47RPDvpqmpA8tg 6gki9Op6g3yimmO6V5iIGbxZk05Zs2eNLQ2kxlgM8Q== X-Received: by 2002:a05:6830:4103:: with SMTP id w3mr20687928ott.27.1620721442871; Tue, 11 May 2021 01:24:02 -0700 (PDT) MIME-Version: 1.0 References: <20210511044253.469034-1-yuri.benditovich@daynix.com> <20210511044253.469034-3-yuri.benditovich@daynix.com> <0e31ea70-f12a-070e-c72b-6e1d337a89bc@redhat.com> In-Reply-To: <0e31ea70-f12a-070e-c72b-6e1d337a89bc@redhat.com> From: Yuri Benditovich Date: Tue, 11 May 2021 11:23:50 +0300 Message-ID: Subject: Re: [PATCH 2/4] virtio-net: add support of UDP segmentation (USO) on the host To: Jason Wang Cc: "David S. Miller" , Jakub Kicinski , "Michael S . Tsirkin" , Network Development , LKML , virtualization@lists.linux-foundation.org, Yan Vugenfirer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 9:47 AM Jason Wang wrote: > > > =E5=9C=A8 2021/5/11 =E4=B8=8B=E5=8D=8812:42, Yuri Benditovich =E5=86=99= =E9=81=93: > > 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_bu= ff *skb, > > ip_proto =3D IPPROTO_UDP; > > thlen =3D sizeof(struct udphdr); > > break; > > + case VIRTIO_NET_HDR_GSO_UDP_L4: > > + gso_type =3D SKB_GSO_UDP_L4; > > + ip_proto =3D IPPROTO_UDP; > > + thlen =3D sizeof(struct udphdr); > > + break; > > > This is only for rx, how about tx? In terms of the guest this is only for TX. Guest RX is a different thing, this is actually coalescing of segmented UDP packets into a large one. This feature is not defined in the virtio spec yet and the support of it first of all depends on the OS. For example: TCP LSO (guest TX) is supported almost by all the versions of Windows. TCP RSC (coalescing of TCP segments) is supported by Win 8 / Server 2012 an= d up. UDP segmentation is supported by Windows kernels 1903+ UDP coalescing is defined by Windows kernels 2004+ and not supported by the driver yet. > > Thanks > > > > > default: > > return -EINVAL; > > } >