Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1552653ybf; Sun, 1 Mar 2020 12:06:33 -0800 (PST) X-Google-Smtp-Source: APXvYqxfOhig6E3wGsvcyaeubGaQuU1BzsP2T48ElG9FvLEVc+O8gF/iRF3xDWnbtOWxO7gQxcLr X-Received: by 2002:aca:f405:: with SMTP id s5mr9445373oih.93.1583093192838; Sun, 01 Mar 2020 12:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583093192; cv=none; d=google.com; s=arc-20160816; b=0e03C61ai0ai8OltnKUsDoX+SUl/b0aKstDuojn1VRycv7ml7JkbzjgCP0+YX/rY0t 5Gr8OiNlIu0FDAg/6PtHPQM0ec+94wcUFGhTKMG31PBCN17GKY1fUgByT3Cx5PE/CHbt E6JPMv67k5yY6HdJGcrPGD5qrrE8FELZuLdDNvTXCxKThkEIKIxrQ2BscAoMXo0lERar 5RPipPMM5DW3t/xOIaC4GDDc1Cm++CPcfh8305HxOvrXqTd/CyX0v8Fh8QA+AQ2SGz3J UnMnDjG8Ea1tKvW86+jfimskfKE9qGMms9TERYs54o2MSnuP9gNGITr653VH+Txyo2VM 8HMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ILXO2eXZPASOoI7MkLPdupz0F1Xu1tLIw+lHAxhsHxE=; b=g0kn61qSrD615VvLtd4lPuhD5Ioi/hQQ/Zi/XdugeSEbxMdiMSj8v9yshQEPxLl2G+ /rfWC7CJbUo+uZsFVFwVLkp52JoKB+ZAEEcOYrHjupBqPpodbDc14+v8IwiSKlIcF0hR +FTBIVeAtgoggG7JOsHeDlBRFkOHDRlEmQ6uUxT+yprsYQCRd6okZipVjfdIp51eaz1R Xru/HjXHvx16KFY2M/IErD5TjUmXvIP1sAn5LVBmzxnnLuitbzLG4/2Q6G6SbEm5U/0H BHINI+1Y/z/0BXnlxifLS1bWnVUGTlm0i0aogNGqB9BcP/j6fZrsUOoDM1lgIZP9knpM hJ1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AGGYvBFZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id t7si4485984oij.175.2020.03.01.12.06.19; Sun, 01 Mar 2020 12:06:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AGGYvBFZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726188AbgCAUGK (ORCPT + 99 others); Sun, 1 Mar 2020 15:06:10 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:50925 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725895AbgCAUGK (ORCPT ); Sun, 1 Mar 2020 15:06:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583093168; 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=ILXO2eXZPASOoI7MkLPdupz0F1Xu1tLIw+lHAxhsHxE=; b=AGGYvBFZjFkXF6/aG8XT5U2RtaCxQ3PQLXrFssn62fB7RCYABqOuARS+XzMvE5smmUe7oB xIgEkAE+9LBbcj15NaO8ePXJAgXrBgXaG5acM2iDNOl8Qm5GCF0Sbq0hBpSZLb57VLyvt4 lyVBZzAk0faUSOBRKJ8tK4zV7qCucFA= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-35-RLExHw3MO4eA-OId0Q0ayQ-1; Sun, 01 Mar 2020 15:06:06 -0500 X-MC-Unique: RLExHw3MO4eA-OId0Q0ayQ-1 Received: by mail-qt1-f200.google.com with SMTP id r13so7500130qtn.18 for ; Sun, 01 Mar 2020 12:06:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ILXO2eXZPASOoI7MkLPdupz0F1Xu1tLIw+lHAxhsHxE=; b=lR3bzmpxTwHYpUEZcUdHKwA0ktHilhHXgc9Qt48F3xFQDx2qLpehUL1+q3atvN6HWk jnt5Wc9UvRJgQn0zN71t1gaHKJX4UZGc+LkYmWn/K24esmx5eWyibym6InWpweKxhuf9 lIdUv0SLsw+nJP34F3z+SZs2QKaFep1ocnb+fRMdj3HoG76m+QK96/A/S1ZUtgRvkyXh QVdogAAdTY8XzwIcrn+svb6ETNuL462TNzOENSxHIMNWoi0OkV63rFR3c2xhWgnOmVzR P2pxCVUFhZAf4Nd0dXKtZ/kSPXzPAyRFz+rf7+/XBWuyPCp79iFkqTs8WbqEeQoiVYL2 ZZ6w== X-Gm-Message-State: ANhLgQ0Idt8jmSnLqTrgd1Pv5iCK9c+SkQhxOsxfe+Za5NoRNPfm8Cfy 1ztW+djAy2kd80r29oFO9Zx/HT50jNsQALzeyfmrxppWNWOcSzNB7gRZHYtaxaC85WBkoNjqT7z /ZWeiKiv3IM+CUC7es/ZYipnY X-Received: by 2002:a0c:cdc7:: with SMTP id a7mr3159173qvn.33.1583093166038; Sun, 01 Mar 2020 12:06:06 -0800 (PST) X-Received: by 2002:a0c:cdc7:: with SMTP id a7mr3159160qvn.33.1583093165836; Sun, 01 Mar 2020 12:06:05 -0800 (PST) Received: from redhat.com (bzq-79-180-48-224.red.bezeqint.net. [79.180.48.224]) by smtp.gmail.com with ESMTPSA id x34sm4591428qta.82.2020.03.01.12.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 12:06:04 -0800 (PST) Date: Sun, 1 Mar 2020 15:06:00 -0500 From: "Michael S. Tsirkin" To: Yuri Benditovich Cc: jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, yan@daynix.com, virtio-dev@lists.oasis-open.org Subject: Re: [PATCH v3 1/3] virtio-net: Introduce extended RSC feature Message-ID: <20200301145828-mutt-send-email-mst@kernel.org> References: <20200301143302.8556-1-yuri.benditovich@daynix.com> <20200301143302.8556-2-yuri.benditovich@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200301143302.8556-2-yuri.benditovich@daynix.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 01, 2020 at 04:33:00PM +0200, Yuri Benditovich wrote: > VIRTIO_NET_F_RSC_EXT feature bit indicates that the device > is able to provide extended RSC information. When the feature > is negotiatede and 'gso_type' field in received packet is not > GSO_NONE, the device reports number of coalesced packets in > 'csum_start' field and number of duplicated acks in 'csum_offset' > field and sets VIRTIO_NET_HDR_F_RSC_INFO in 'flags' field. > > Signed-off-by: Yuri Benditovich > --- > include/uapi/linux/virtio_net.h | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h > index a3715a3224c1..19e76b3e3a64 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_RSC_EXT 61 /* extended coalescing info */ > #define VIRTIO_NET_F_STANDBY 62 /* Act as standby for another device > * with the same MAC. > */ > @@ -104,6 +105,7 @@ struct virtio_net_config { > struct virtio_net_hdr_v1 { > #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 /* Use csum_start, csum_offset */ > #define VIRTIO_NET_HDR_F_DATA_VALID 2 /* Csum is valid */ > +#define VIRTIO_NET_HDR_F_RSC_INFO 4 /* rsc info in csum_ fields */ > __u8 flags; > #define VIRTIO_NET_HDR_GSO_NONE 0 /* Not a GSO frame */ > #define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */ > @@ -113,8 +115,24 @@ struct virtio_net_hdr_v1 { > __u8 gso_type; > __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ > __virtio16 gso_size; /* Bytes to append to hdr_len per frame */ > - __virtio16 csum_start; /* Position to start checksumming from */ > - __virtio16 csum_offset; /* Offset after that to place checksum */ > + union { > + struct { > + __virtio16 csum_start; > + __virtio16 csum_offset; > + }; Pls add comments for this one as well. > + struct { > + /* Position to start checksumming from */ > + __virtio16 start; > + /* Offset after that to place checksum */ > + __virtio16 offset; > + } csum; Can we add a comment for csum field pls? E.g. /* Checksum calculation */ > + struct { > + /* num of coalesced packets */ num -> Number? Don't abbreviate and upper case for consistency. > + __le16 packets; packets -> coalesced_packets? Or is coalesced segments in fact better? > + /* num of duplicated acks */ num -> Number? Don't abbreviate and upper case for consistency. > + __le16 dup_acks; > + } rsc; /* Receive Segment Coalescing report */ > + }; > __virtio16 num_buffers; /* Number of merged rx buffers */ > }; > > -- > 2.17.1