From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id B002DC7C2 for ; Wed, 29 Apr 2015 11:54:51 +0200 (CEST) Received: by wizk4 with SMTP id k4so173176405wiz.1 for ; Wed, 29 Apr 2015 02:54:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=lVOfI4zJfN16ZZ3tQ9HI69uI9z1MGzGAyqYWBDi199I=; b=EcadHiM0dr6YczeYYBKRyT3E3R+smmghoOM4vntlPis+LVCjFz1oNCT+3aWt7eZeDf j2vLfu+fRIIiXJVRiIgjDlbck83CB6VjLJW7ocyfCdffQ9nwnmFM9wOIV3MvmtxJOw+x m7gnoy0whE1sfmw3ctCpGbcZcW9eRSeM+ZCor7z9P0K6blQLRMgj6K8ao24lxgSJKpQK Y7702EwRHOC8E4RDuTNnp1LHWD0Gq8AbQTFl6NDM50U3T/EIeIaAyWynFX95BIXIos4S WBp3quwY9wHupulQF1O2zntICgFPO7ate7lLecvg1oFXphaHVdmRCYgzpHUWGLSWLRjF t+aA== X-Gm-Message-State: ALoCoQmivUMGDytB0Hzee0Oe0UrsW5iWBr4hTtK465Iu6QVfemgD+qPPmhSLXrtfytBFP7slq7VM X-Received: by 10.194.205.225 with SMTP id lj1mr40791652wjc.138.1430301291479; Wed, 29 Apr 2015 02:54:51 -0700 (PDT) Received: from [10.16.0.195] (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id fm8sm20417145wib.9.2015.04.29.02.54.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 02:54:50 -0700 (PDT) Message-ID: <5540AA67.5050809@6wind.com> Date: Wed, 29 Apr 2015 11:54:47 +0200 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Konstantin Ananyev , dev@dpdk.org References: <1430226150-30057-1-git-send-email-konstantin.ananyev@intel.com> In-Reply-To: <1430226150-30057-1-git-send-email-konstantin.ananyev@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] test-pmd fix default mbuf size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 09:54:52 -0000 Hi Konstantin, On 04/28/2015 03:02 PM, Konstantin Ananyev wrote: > Latest mbuf changes (priv_size addition and related fixes) > exposed small problem with testpmd default config: > testpmd default mbuf size is exaclty 2KB, that causes > ixgbe PMD to select scattered RX even for configs with 'normal' > max packet length (max_rx_pkt_len == ETHER_MAX_LEN). > > Signed-off-by: Konstantin Ananyev > --- > app/test-pmd/testpmd.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > index 389fc24..037e7ec 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -48,7 +48,8 @@ > * Default size of the mbuf data buffer to receive standard 1518-byte > * Ethernet frames in a mono-segment memory buffer. > */ > -#define DEFAULT_MBUF_DATA_SIZE 2048 /**< Default size of mbuf data buffer. */ > +#define DEFAULT_MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM) > +/**< Default size of mbuf data buffer. */ > > /* > * The maximum number of segments per packet is used when creating > Indeed, this regression is introduced by one of my recent patch: http://dpdk.org/browse/dpdk/commit/?id=dfb03bbe2b39156f0e42e7f29e09c1e6b6def265 Before, m->buf_len was initialized to RTE_PKTMBUF_HEADROOM + 2048. Now it is set to 2048. Maybe a line like this should be added in the commit log: Fixes: dfb03bbe2b ("app/testpmd: use standard functions to initialize mbufs and mbuf pool") Just one question Konstantin: could you just confirm that the reason of the bug? From what I understand: - buf_len is 2048 - the rx data size when receiving a packet is 2048 - hdroom = 1920 - at init, the ixgbe driver configures the hw to set the max rx data size, but it has to be a power of 2, so 1024 is chosen - then the initialization code check if a packet of ETHER_MAX_LEN fits in max rx size, and if not, it selects the scatter mode. It makes me wondering 2 things: - should we add a comment in the test-pmd to explain that? (maybe not, as it is driver-specific, and it is just an optimization) - should we check the other examples to see if the same problem exists? If my understanding is correct, Acked-by: Olivier Matz Regards, Olivier