Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3307183pxj; Tue, 11 May 2021 01:13:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxdYcSGBfBAPfgwprQC2afgtSVGDQwvmnbxNlSpjvVamndfmxqm92O/rQUQ6Sr8C0y8gps X-Received: by 2002:a05:6602:34a:: with SMTP id w10mr4357236iou.208.1620720796223; Tue, 11 May 2021 01:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620720796; cv=none; d=google.com; s=arc-20160816; b=TixbwbfiApUzo/yT4pjz2UMwje+M1qZcCH7M6fiMOLadbJeCamnW0Qn9U1ZX5uz8Di iOq6WBhYlhvyfPZWWBlDKZA5dExU3nmwRUgAfIPGV+sI7+CzRLnQHJop9G6EEkqDKSsR BldWTfZQAPDofQ+fa4/A0OLSrq1HPHdrbB0e4MYkLLQxNmUryRS3aNB3rCW54KRovsyK KvgQqa/M3m1Qqwf2boeJXiNpcmchRuS2fC4roAWlysPpyys8sYyfp8r7a+F57TQCAzlD kqjbf6+Q5LmtKrCsMpf7H9ExCbRD+pBdRdipjXDquHoDXr4s9UZ9mnFGYtRXZkd8ouFK k2iA== 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=V4OvBsGlOboDMJilacIfX93BeArUzpCix7At3EOUarw=; b=OkjnH+jzxybcyrzaK3derFPWpJ4WZxmslJhPyoqrO1YQyOtRBLkvOK4F0oq7pAPVmH ObHgpx+eFSzotzF50qRNVApTkAJfjiUabaUVeEkR7TGmohwsRJe+jKh8nT5xXX/9EuZp K7KxWXRiYkojk407fiwqilfU+w8wGgQmpq3DhR1xaoBNV2/Y1e2tZ/mZ2JWymbKCHcSX hCF+gdX4mGkZ/pZDBt5qYWO/Kg8OHewBmhDRyrr1paVnxpZHpcH9QR4MPTC4awcSEZEc YykYQ8Blbbb6TkHQk5boiqOJBfJBKtop7gw8JLKh1zrzzzdn7DL9QbcaOYP48hLM/a72 uu+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20150623.gappssmtp.com header.s=20150623 header.b=lmkuZ7aD; 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 w135si2175230jaw.24.2021.05.11.01.13.03; Tue, 11 May 2021 01:13:16 -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=lmkuZ7aD; 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 S230410AbhEKINh (ORCPT + 99 others); Tue, 11 May 2021 04:13:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230126AbhEKINg (ORCPT ); Tue, 11 May 2021 04:13:36 -0400 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03786C06175F for ; Tue, 11 May 2021 01:12:30 -0700 (PDT) Received: by mail-ot1-x336.google.com with SMTP id c8-20020a9d78480000b0290289e9d1b7bcso16823810otm.4 for ; Tue, 11 May 2021 01:12:29 -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=V4OvBsGlOboDMJilacIfX93BeArUzpCix7At3EOUarw=; b=lmkuZ7aDqLoygz/VlHzMEKZGrl/9XcMQTxU2tuT9mZhq0XTw/tD6YTyLFhazQMDYt9 8zsBDzeJyVE1UpLyZiCRDTZVlbriSASCZMNryZutMDr0D8mzpX2ADN4ZeBdz4X3bHN0N WCNkGFc4CTnoBVv5uGBz3kfd6ybzBH+9lmTS8pokT0di2GHzk6YjGFIJcDXc5CcxCW7T nFKPhaBXRKMSlkC2NpFgBMsLmdcDWCyKtqzIWxh5lf2Epzpng2D79dYA/7zAsvWaHbge wNiOLhXNwKKOrSBYWgY0RzM/2pjxJqJJDxNHPuCWLsllM2LRf3Fzoi/svD1xstkjNrYg Q3Uw== 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=V4OvBsGlOboDMJilacIfX93BeArUzpCix7At3EOUarw=; b=jnBHPZ0Da5babV+KKnCIazoBe/fy73zyjBTN+nLXpxan7vy0GwUCwFCHBUSyWLIFdC 6q7OYXQiSoXGR4++qMcEoqywrcKT0qkdxK3g4EVF+RSrI3MLxYhCCbQs/7FgnfbNF5LV ciDfuYjLgzpKskut2yJRsq2Zm5AXRGGFnc1FjOPOtvuRKlGqSMWyeePKSye/FfDRy8o6 EQK6lrFSUomH0ELNgyOIkU38X0OkhOhrZmsPZ12FRgMX7i2hCHsox5bp0pBB6ZCIzGyr ZnmRe03VA6vnUuHVhCSwZd/3fJjbOXxCHIKDcJBDyF+L3Sxze1BKo1r9RmzPSTLjvdGt /IPw== X-Gm-Message-State: AOAM531bo7uQHwXCj1rIB1LBqOkM02JmO3R8c3UD35UQHB7Mn25f1VLL V/hubN3BU/UqijDdpQTAubl10J9mbPfZCGEHF7RtXg== X-Received: by 2002:a05:6830:4103:: with SMTP id w3mr20651835ott.27.1620720749398; Tue, 11 May 2021 01:12:29 -0700 (PDT) MIME-Version: 1.0 References: <20210511044253.469034-1-yuri.benditovich@daynix.com> <20210511044253.469034-2-yuri.benditovich@daynix.com> <40938c20-5851-089b-c3c0-074bbd636970@redhat.com> In-Reply-To: <40938c20-5851-089b-c3c0-074bbd636970@redhat.com> From: Yuri Benditovich Date: Tue, 11 May 2021 11:12:16 +0300 Message-ID: Subject: Re: [PATCH 1/4] virtio-net: add definitions for host USO feature 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: > > Define feature bit and GSO type according to the VIRTIO > > specification. > > > > Signed-off-by: Yuri Benditovich > > --- > > include/uapi/linux/virtio_net.h | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virti= o_net.h > > index 3f55a4215f11..a556ac735d7f 100644 > > --- a/include/uapi/linux/virtio_net.h > > +++ b/include/uapi/linux/virtio_net.h > > @@ -57,6 +57,7 @@ > > * Steering */ > > #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ > > > > +#define VIRTIO_NET_F_HOST_USO 56 /* Host can handle USO packets */ This is the virtio-net feature > > #define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report *= / > > #define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */ > > #define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing in= fo */ > > @@ -130,6 +131,7 @@ struct virtio_net_hdr_v1 { > > #define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (T= SO) */ > > #define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv= 4 UDP (UFO) */ > > #define VIRTIO_NET_HDR_GSO_TCPV6 4 /* GSO frame, IPv6 TCP */ > > +#define VIRTIO_NET_HDR_GSO_UDP_L4 5 /* GSO frame, IPv4 UDP (U= SO) */ This is respective GSO type > > > This is the gso_type not the feature actually. > > I wonder what's the reason for not > > 1) introducing a dedicated virtio-net feature bit for this > (VIRTIO_NET_F_GUEST_GSO_UDP_L4. This series is not for GUEST's feature, it is only for host feature. > 2) toggle the NETIF_F_GSO_UDP_L4 feature for tuntap based on the > negotiated feature. The NETIF_F_GSO_UDP_L4 would be required for the guest RX path. The guest TX path does not require any flags to be propagated, it only allows the guest to transmit large UDP packets and have them automatically splitted. (This is similar to HOST_UFO but does packet segmentation instead of fragmentation. GUEST_UFO indeed requires a respective NETIF flag, as it is unclear whether the guest is capable of receiving such packets). > > Thanks > > > > #define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN se= t */ > > __u8 gso_type; > > __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ >