Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3319113pxj; Tue, 11 May 2021 01:33:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCybjDWcFb/cVmroM5iy5/aWjsRJGQDIfDoZkZpSZvdtvv7mcqnsf3ZukcrsQ4MKiEtteA X-Received: by 2002:a05:6e02:154d:: with SMTP id j13mr23792579ilu.46.1620722006155; Tue, 11 May 2021 01:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620722006; cv=none; d=google.com; s=arc-20160816; b=dfbxRZgLDQNPoKYcHvDLbA6A9S+sbJ/G3TPqKYiaG+TdkUjsZg32TYKhV6sB7le8NN 7JNlsHHWTT5sbPyaBoy3Z75gtYxNeCOVpPg6Zfz5dL2NT4U7fitKVAnT8FfNnPNZRHfH tCsdas41HMlsW75VKmV1no1kaczAN5RJhKUzoIeJ4mRIzryZAe3YElhePZtjzZBHYfhb 8jM1hFtWXvQC0x3XzvGY7JQuAQsHxQJIoj3CVh/MSmpF7215fOfyY2H0vtS9j8VNfX0c cU0y4Wv8/zbMhhyx+AkUnucmXyWg9ZioPjrc5GIohtzHt20XCz9QbRRtyfU8oE/TNw2X Bj4w== 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=L03rSJtnAgFGyBancVHdJ/m6c98PSwpvaqqILqNedlU=; b=uuilCF2Q/CEZiCMvHvvuTz2F2u9mjBrM0xyEBkatnQqTTxIucsYXq9H6aL3SxQRTex /9oOyCY4DZXTtkLL9n9NH68kjPabm1lHG3axtVA4OTKVwHztpR5Gk/r9cB1okD8W+j4+ omtnKwCeZFf/sQhUThW/+OzpT7M+iPo+3DdsXSZxOVZIuUwBnRH9eZ6HlcTG2x3Y7vvc xJ+m5B7hR/sODk/x79L/F3+xNmWfGj5L6klNIhthJSJCJTUSeCfjv/t36OCZbHO7AGkL /bEPJQ0o7Gipxe8WqyVkcbvWQlG8gHpE0Zx4IQz9Y8fR8UaPmkUHYPq6verZ91HXhVwH IE6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RlaU0GA0; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s24si19769231ioc.50.2021.05.11.01.33.14; Tue, 11 May 2021 01:33:26 -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=@redhat.com header.s=mimecast20190719 header.b=RlaU0GA0; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230427AbhEKIch (ORCPT + 99 others); Tue, 11 May 2021 04:32:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22687 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbhEKIcf (ORCPT ); Tue, 11 May 2021 04:32:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620721889; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L03rSJtnAgFGyBancVHdJ/m6c98PSwpvaqqILqNedlU=; b=RlaU0GA0oUn0fmp5YNWmyLXWQ35SHuQwHReCOXA8ggQnQ3qnk26WdGTyhEHXKoXqzu0r/h 9e2nWbRvk1Ht/3Q6aXQn+jwvCXHgWiX4H3M8BbosIUEbCkbtJWCEov8Ye+4nvCnXoiF0UJ HLKzSbwSK6ndiW3xP4fpLbpeuBW2GEY= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-B38zmp3DNUOMrnFx2_L-eQ-1; Tue, 11 May 2021 04:31:27 -0400 X-MC-Unique: B38zmp3DNUOMrnFx2_L-eQ-1 Received: by mail-lf1-f72.google.com with SMTP id l27-20020a056512333bb02901d2b8c62620so4037234lfe.8 for ; Tue, 11 May 2021 01:31:27 -0700 (PDT) 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=L03rSJtnAgFGyBancVHdJ/m6c98PSwpvaqqILqNedlU=; b=Wc9ZiJgSetzGpc754MxFuIFpQ4UiUB73lpaaROhQrYnk2v7djUK1lIfMW1TdIcSFEd 7vk0Enc/QXgdNPqj0dHp95kYmKkgfsjNDRNF6oKYgUPraCopv67LzvijPJX3sDz2fg1k OuGxcI8p4PS6ZLI3dGAXw2rtczAxSGNwS15FEt4U3csmkFz2xIc/4vMghtKHt+lRsrbV hZmwtbzTx3/rLaP1ho+JKEM3Ma+JCDM5AUZroFekDj8hW1XeMyKvIJRihf9E3XkD9Yqm Ko8FzzKMe4UDyu2wszgXEZdEWxe4vGjV0Dkh1hf00eTIjGdTn/+vEzk7SeDfeQAbrR5J J6AQ== X-Gm-Message-State: AOAM530kB8YPNfL1zS4TX55wtV8/z7ufyyEIjB7ajborU8mNrOZD8RCj z9yjxBkGyI34UDQWSn+8hSwhSjqrrNyJGpU4s/FE08yysUGKxmSph/uLDx1nLyZAkd/R9MB24wH F0Cd7sPWwvmEzXbfcEHud2njudTCTlzPUdeJTig7E X-Received: by 2002:a05:651c:3cf:: with SMTP id f15mr6277313ljp.404.1620721885566; Tue, 11 May 2021 01:31:25 -0700 (PDT) X-Received: by 2002:a05:651c:3cf:: with SMTP id f15mr6277299ljp.404.1620721885330; Tue, 11 May 2021 01:31:25 -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: From: Jason Wang Date: Tue, 11 May 2021 16:31:10 +0800 Message-ID: Subject: Re: [PATCH 2/4] virtio-net: add support of UDP segmentation (USO) on the host To: Yuri Benditovich Cc: "David S. Miller" , Jakub Kicinski , "Michael S . Tsirkin" , Network Development , LKML , virtualization , 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 4:24 PM Yuri Benditovich wrote: > > 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_= buff *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. So virtio_net_hdr_to_skb() can be called by all the followings: 1) receive_buf() which is guest RX. 2) tun_get_user() which is guest TX 3) tap_get_user() which is guest TX 4) {t}packet_send() which is userspace TX So it touches for both RX and TX. > Guest RX is a different thing, this is actually coalescing of > segmented UDP packets into a large one. Another case, the packet could be sent from another VM (like the UFO case). Supporting that for both TX and RX and greatly improve the performance of VM2VM traffic. Thanks > 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 = and 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; > > > } > > >