From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752751AbdC3EDq (ORCPT ); Thu, 30 Mar 2017 00:03:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54948 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750890AbdC3EDp (ORCPT ); Thu, 30 Mar 2017 00:03:45 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E9C3CC04BD59 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E9C3CC04BD59 Subject: Re: [PATCH] virtio_net: enable big packets for large MTU values To: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org References: <1490791079-22108-1-git-send-email-mst@redhat.com> Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org From: Jason Wang Message-ID: <5304103e-5a0b-230b-6bd0-1b33ab546889@redhat.com> Date: Thu, 30 Mar 2017 12:03:36 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1490791079-22108-1-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 30 Mar 2017 04:03:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017年03月29日 20:38, Michael S. Tsirkin wrote: > If one enables e.g. jumbo frames without mergeable > buffers, packets won't fit in 1500 byte buffers > we use. Switch to big packet mode instead. > TODO: make sizing more exact, possibly extend small > packet mode to use larger pages. > > Signed-off-by: Michael S. Tsirkin > --- > drivers/net/virtio_net.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index e0fb3707..9dc31dc 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -2428,6 +2428,10 @@ static int virtnet_probe(struct virtio_device *vdev) > dev->mtu = mtu; > dev->max_mtu = mtu; > } > + > + /* TODO: size buffers correctly in this case. */ > + if (dev->mtu > ETH_DATA_LEN) > + vi->big_packets = true; > } > > if (vi->any_header_sg) Ok, I think maybe we should fail the probe of small buffer in this case and decrease the max_mtu to ETH_DATA_LEN if small buffer is used (since user are allowed to increase the mtu). Thanks