DPDK usage discussions
 help / color / mirror / Atom feed
From: "Wiles, Keith" <keith.wiles@intel.com>
To: "Александр Самойлов" <cidjey1991@mail.ru>, users <users@dpdk.org>
Subject: Re: [dpdk-users] A question about rte_pktmbuf_init() and alike functions
Date: Tue, 3 Nov 2015 19:27:54 +0000	[thread overview]
Message-ID: <48648717-1A5C-4292-AA60-17A08126F89D@intel.com> (raw)
In-Reply-To: <1446578609.273825053@f418.i.mail.ru>

On 11/3/15, 1:23 PM, "users on behalf of Александр Самойлов" <users-bounces@dpdk.org on behalf of cidjey1991@mail.ru> wrote:

> An update. I decided to try this:
>
>m = rte_pktmbuf_alloc(mp);
>if(unlikely(m == NULL))
>{
>    RTE_LOG(INFO, USER1, "%s: Couldn't allocate pkt_mbuf\n", __func__);
>    return NULL;
>}
>rte_pktmbuf_init(mp, NULL, m, 0);
>rte_mbuf_refcnt_set(m, 1);
>Well, it worked out. My memory is not dirty anymore and TCP checksum is always OK. Thank you for the input.
>But this raises another question: You said that rte_pktmbuf_alloc() implies resetting the buffer to a "sane state". 
>So why this reset doesn't make my new "m" buffer "sane enough" to keep a new frame while rte_pktmbuf_init does?

You can look at the code, but the reset tries to do the least amount work in touching the mbuf header for performance.
>
>
>Alex Samoylov
>
>
>


Regards,
Keith





  reply	other threads:[~2015-11-03 19:27 UTC|newest]

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

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=48648717-1A5C-4292-AA60-17A08126F89D@intel.com \
    --to=keith.wiles@intel.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).