DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier MATZ <olivier.matz@6wind.com>
To: Konstantin Ananyev <konstantin.ananyev@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] test-pmd fix default mbuf size
Date: Wed, 29 Apr 2015 11:54:47 +0200	[thread overview]
Message-ID: <5540AA67.5050809@6wind.com> (raw)
In-Reply-To: <1430226150-30057-1-git-send-email-konstantin.ananyev@intel.com>

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 <konstantin.ananyev@intel.com>
> ---
>   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 <olivier.matz@6wind.com>

Regards,
Olivier

  reply	other threads:[~2015-04-29  9:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 13:02 Konstantin Ananyev
2015-04-29  9:54 ` Olivier MATZ [this message]
2015-04-29 10:39   ` Ananyev, Konstantin
2015-04-29 10:45     ` Olivier MATZ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5540AA67.5050809@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).