DPDK usage discussions
 help / color / mirror / Atom feed
From: Matt Laswell <laswell@infiniteio.com>
To: "Александр Самойлов" <cidjey1991@mail.ru>
Cc: users <users@dpdk.org>
Subject: Re: [dpdk-users] A question about rte_pktmbuf_init() and alike functions
Date: Tue, 3 Nov 2015 12:53:48 -0600	[thread overview]
Message-ID: <CA+GnqArrxd5cjSMWV51ey89UWiSb0SK3Vm_LZXW69kU7JCv9fg@mail.gmail.com> (raw)
In-Reply-To: <1446572959.590162182@f422.i.mail.ru>

The init functions are called once per object at initialization time, not
at allocation time.  From a performance perspective, this is preferable,
though it leaves a dependency on the application to do subsequent
initialization when the object is allocated or when it is freed.

--
Matt Laswell
Principal Software Engineer, infinite io
laswell@infiniteio.com

On Tue, Nov 3, 2015 at 11:49 AM, Александр Самойлов <cidjey1991@mail.ru>
wrote:

>  Hi all. I'm sorry if the question is naive or stupid, but still I
> couldn't find the answer in the manual.
>
> The question is: are the element init functions called just once (with the
> mempool creation) or are they called each time we retrieve a new element
> from a pool? I'm asking because I use a mempool pool with pkt_mbuf
> structures for generating new Ethernet frames (with IP and TCP data) and it
> works just fine for a while (I reckon just as long as I'm getting a new
> pktmbuf with rte_pktmbuf_alloc and not a recycled one) and at some point my
> generated frames start to have the wrong TCP ckecksum (even though TCP
> checksum it totally OK at first). And the strange thing is that if, for
> instance, mempool has 2048 elements -  my program works for 5 seconds
> (rough estimate), and if mempool has 4096 elements - my program works for
> 10 seconds. The connection is obvious. I used to believe that init()
> functions are called each time we retrieve an element from a mempool, but
> now I'm not so sure.
>
>
> Alex Samoylov

  parent reply	other threads:[~2015-11-03 18:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 17:49 Александр Самойлов
2015-11-03 18:52 ` Wiles, Keith
2015-11-03 18:53 ` Matt Laswell [this message]
2015-11-03 19:23 Александр Самойлов
2015-11-03 19:27 ` Wiles, Keith
2015-11-03 19:44   ` Александр Самойлов

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=CA+GnqArrxd5cjSMWV51ey89UWiSb0SK3Vm_LZXW69kU7JCv9fg@mail.gmail.com \
    --to=laswell@infiniteio.com \
    --cc=cidjey1991@mail.ru \
    --cc=users@dpdk.org \
    /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).