Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2790807pxb; Mon, 1 Nov 2021 01:46:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxJvdCgem8I6T0wfmUadv5Zk3ZWtD/NMnlcHUEFKDFzktiroqs14geTJAAcQNWQ3yDKpVk X-Received: by 2002:aa7:da10:: with SMTP id r16mr16542161eds.56.1635756406610; Mon, 01 Nov 2021 01:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635756406; cv=none; d=google.com; s=arc-20160816; b=q6vctz2gQ0opLooJ2pS6a60gRLK+bXFf6dkJfqK0My3onNLAd6LiVkOZB+DIbbR1Ar ogO2AoMltyQJ6ihofIovDsWUlSefGlvPOWjZt+kLaTmZiBbj+lSZnNHs+jVzeQ26OgnP WtSzD9SMx1St+OOXe600yB1ryzW+GzzXAGODwVKzqIufDC1s85CMCQMrqwhfrIGd1PNd SS6jICNT/E9nec5Ey5MAKkLCIcOX1FW652pGrTkknhlFcorLABgwENRIEl0WjT62J5/e nIRGTkiBhtUh+BwNctXVNGDrUs2kgirWeJzH3WKkruoQM2GT5ue5eGKAiS/u1JQyG+da oV5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2Ad4v/ujl0t03/UsIys5jLvOTiR3MOz3oTeEO3GUsRw=; b=0aIWtViINrwX50DrxH27oK3irvmNLBFEzJ/N+zTcmbv89Fdrj1AiCKy5wWVkGJeMEs mwZp1UY3WNeS8PG+uGfwatx3hwlJ42v8lcdEv0HL+f00/HZU57rn7ixveBS0QlA/Mjm2 ejzjuEaWOGQJhP+tJToQRxTmNva6I47j+TPB+V19qyZ1QxLiWFgx8xsKwGv2r69gpCvu s18PNEV/hChj71lYMzI+lbstOekycvA3xYopy/CSPg9zUJ9sUs5QzbBlUcQiGd0P9852 hL/Eph5nwpQbkhAU3LHbw5Xh3Z/XKsRnMnN2wfZWyp9oTdFDwQoHyIIc1hRr8TWt/OQI 98zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UdxHmith; 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 b10si26119061edd.241.2021.11.01.01.46.23; Mon, 01 Nov 2021 01:46:46 -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=UdxHmith; 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 S231625AbhKAIqq (ORCPT + 99 others); Mon, 1 Nov 2021 04:46:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42273 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231676AbhKAIql (ORCPT ); Mon, 1 Nov 2021 04:46:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635756248; 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=2Ad4v/ujl0t03/UsIys5jLvOTiR3MOz3oTeEO3GUsRw=; b=UdxHmithQu3Z860J0B8MI1vr1m86BAPBmp43ufKVyqUVGkICbWxGZlwLsin8SKjYD9/Sku XFf0QJpRk81zhLDw/2XM6AmkpFX8RfZdSMgMd2u9Magq2o3/pTSboijJZGZmsxpD6Vynw0 pN2JdQDPQtGgP5CBl9FEvJ1U5qUWDNs= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-244-yDk5umCFNgWH-YQWD4bZLw-1; Mon, 01 Nov 2021 04:44:07 -0400 X-MC-Unique: yDk5umCFNgWH-YQWD4bZLw-1 Received: by mail-ed1-f70.google.com with SMTP id s12-20020a50dacc000000b003dbf7a78e88so14934034edj.2 for ; Mon, 01 Nov 2021 01:44:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2Ad4v/ujl0t03/UsIys5jLvOTiR3MOz3oTeEO3GUsRw=; b=mgN8cygbSkHewPVxStaGvPZtDD+ihjDW167fGixJyr1H2dBAvCxw8NVxiVxwmfoZJX CkG7c0osl5eyiaHsjcqJvUm9nVIzg1uUq9yJC8W0N34bZy2Xy+Y9BcZN1SIEsrGDn+YZ gfw6D3KNmyfyI5xjBHj/73SSI7u0C2m60pphcVaUIEIT7p3NfJCC/o6yw9bt+rCwM44V dcpdENFKa4CwcriXZq7SXtsIFvJOnITwUUXNK8UaaSCwRmbLn30MuyX1rwa1X3EQ7bQH UjVcNNgtQngpUREhImqh9Bkgri5MyuaSrFvsqzh+ehiQww/NIK59L1ADZvcDhMY524HE MOig== X-Gm-Message-State: AOAM5315pxcpvFBrmNZASbTI+A3TUQ4iny8uuBQyH7ogBS38b6lGOB10 Wb4U7ZnXSME17eZJNh9Nxo3FbNx5riz79Cmu0LGwqX9lqQdmyuqytZd0biGgOSGhhVa9gYk7OPF /minN8mPA128XbZIBrfUwnNZw X-Received: by 2002:a17:906:6a08:: with SMTP id qw8mr16861436ejc.200.1635756246077; Mon, 01 Nov 2021 01:44:06 -0700 (PDT) X-Received: by 2002:a17:906:6a08:: with SMTP id qw8mr16861416ejc.200.1635756245941; Mon, 01 Nov 2021 01:44:05 -0700 (PDT) Received: from redhat.com ([176.12.204.186]) by smtp.gmail.com with ESMTPSA id ho17sm1128483ejc.111.2021.11.01.01.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 01:44:05 -0700 (PDT) Date: Mon, 1 Nov 2021 04:44:00 -0400 From: "Michael S. Tsirkin" To: Andrew Melnychenko Cc: jasowang@redhat.com, davem@davemloft.net, kuba@kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yuri.benditovich@daynix.com, yan@daynix.com Subject: Re: [RFC PATCH 2/4] drivers/net/virtio_net: Changed mergeable buffer length calculation. Message-ID: <20211101044051-mutt-send-email-mst@kernel.org> References: <20211031045959.143001-1-andrew@daynix.com> <20211031045959.143001-3-andrew@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211031045959.143001-3-andrew@daynix.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 31, 2021 at 06:59:57AM +0200, Andrew Melnychenko wrote: > Now minimal virtual header length is may include the entire v1 header > if the hash report were populated. > > Signed-off-by: Andrew Melnychenko subject isn't really descriptive. changed it how? And I couldn't really decypher what this log entry means either. > --- > drivers/net/virtio_net.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index b72b21ac8ebd..abca2e93355d 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -393,7 +393,9 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi, > hdr_p = p; > > hdr_len = vi->hdr_len; > - if (vi->mergeable_rx_bufs) > + if (vi->has_rss_hash_report) > + hdr_padded_len = sizeof(struct virtio_net_hdr_v1_hash); > + else if (vi->mergeable_rx_bufs) > hdr_padded_len = sizeof(*hdr); > else > hdr_padded_len = sizeof(struct padded_vnet_hdr); > @@ -1252,7 +1254,7 @@ static unsigned int get_mergeable_buf_len(struct receive_queue *rq, > struct ewma_pkt_len *avg_pkt_len, > unsigned int room) > { > - const size_t hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf); > + const size_t hdr_len = ((struct virtnet_info *)(rq->vq->vdev->priv))->hdr_len; > unsigned int len; > > if (room) Is this pointer chasing the best we can do? > @@ -2817,7 +2819,7 @@ static void virtnet_del_vqs(struct virtnet_info *vi) > */ > static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq) > { > - const unsigned int hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf); > + const unsigned int hdr_len = vi->hdr_len; > unsigned int rq_size = virtqueue_get_vring_size(vq); > unsigned int packet_len = vi->big_packets ? IP_MAX_MTU : vi->dev->max_mtu; > unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len; > -- > 2.33.1