DPDK usage discussions
 help / color / mirror / Atom feed
From: "Wu, Xiaoban" <Xiaoban_Wu@student.uml.edu>
To: "users@dpdk.org" <users@dpdk.org>
Subject: [dpdk-users] A question about the function __mempool_get_bulk() of dpdk-16.04
Date: Tue, 7 Jun 2016 20:52:25 +0000	[thread overview]
Message-ID: <CY1PR0201MB0827E7B199732BB8BCDE4716BC5D0@CY1PR0201MB0827.namprd02.prod.outlook.com> (raw)

Dear DPDK Users,


I have been reading the pktgen-3.0.02 source codes with dpdk-16.04.


In the pktgen.c, function pktgen_send_pkts(), line 1098, it calls function wr_pktmbuf_alloc_bulk_noreset().  Then it calls the function rte_mempool_get_bulk() which calls the function __mempool_get_bulk().


Since in the function rte_pktmbuf_pool_create(), the "flags" is set to zero in default, this leads to that when calling __mempool_get_bulk(), the input parameter"is_mc==1". Hence the function __mempool_get_bulk() will execute the line 961-992 except that when "ret" is less that 0.


My question is why at line 992, this has to return 0? In the line 941, the comment says that  ">=0: Success; number of objects supplied." I am confused by this comment, since in line 985-990, we can see that the input parameter "obj_table" is supplied by new values and the number of the new values is "n". Does this means that we need to "return n;" instead of "return 0;"?


Am I missing something here? Thank you so much for your help.


All the best,

Xiaoban

             reply	other threads:[~2016-06-07 20:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 20:52 Wu, Xiaoban [this message]
2016-06-07 22:30 ` Wiles, Keith
2016-06-08  0:12   ` Wu, Xiaoban
2016-06-10 13:00 ` Shreyansh Jain

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=CY1PR0201MB0827E7B199732BB8BCDE4716BC5D0@CY1PR0201MB0827.namprd02.prod.outlook.com \
    --to=xiaoban_wu@student.uml.edu \
    --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).