DPDK usage discussions
 help / color / mirror / Atom feed
From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: 宋捷 <songj@zctt.com>, 'users' <users@dpdk.org>,
	"'Stephen Hemminger'" <stephen@networkplumber.org>
Subject: Re: [dpdk-users] ojectes from the mempool are disorderd by rte_mempool_generic_get
Date: Tue, 24 Mar 2020 10:54:30 +0000	[thread overview]
Message-ID: <BYAPR11MB3143A238424806D7E1785160D7F10@BYAPR11MB3143.namprd11.prod.outlook.com> (raw)
In-Reply-To: <000001d6019b$519bec20$f4d3c460$@zctt.com>+C7981C25CE3229DA

Hi Jie,

Mempools don't provide any promise of dequeuing objects in a specific order. The mempool data-structure actually has a per-lcore cache which allows recycling buffers on a per-lcore basis, providing better performance (and certainly breaking your ordering hopes).

If you need strict I/O ordering from a datastructure, I suggest using a rte_ring. The ring datastructure is a FIFO, so the first packets you enqueue will be the first to dequeue too. Regardless of the rte_ring_dequeue_burst() size parameter, calling 1x 10 times, or 10x calls with 1 packet, the mbufs returned will be in the same order.

Hope that helps, -Harry

From: 宋捷 <songj@zctt.com>
Sent: Tuesday, March 24, 2020 5:16 AM
To: 'users' <users@dpdk.org>; 'Stephen Hemminger' <stephen@networkplumber.org>; Van Haaren, Harry <harry.van.haaren@intel.com>
Subject: ojectes from the mempool are disorderd by rte_mempool_generic_get

Hi all,


I created a packet mbuf pool (rte_pktmbuf_pool_create) for saving some packets, And using rte_mempool_obj_iter for put hundreds of packets (from a pcap file) into the packet pool.

Finally I need to get ten packets from the packet pool.
If I call rte_mempool_generic_get for one packet each time, and try 10 times, then I can get ten packets in correct order;
But if call rte_mempool_generic_get for ten packets one time, then these ten packets are disordered.

So using rte_mempool_generic_get for getting multi objects, it will return disorder objects from the mbuf pool?
If there’s any other way for can get objects from the mempool orderly

I used DPDK18.05

Thanks

Jie


      reply	other threads:[~2020-03-24 10:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  5:16 宋捷
2020-03-24 10:54 ` Van Haaren, Harry [this message]

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=BYAPR11MB3143A238424806D7E1785160D7F10@BYAPR11MB3143.namprd11.prod.outlook.com \
    --to=harry.van.haaren@intel.com \
    --cc=songj@zctt.com \
    --cc=stephen@networkplumber.org \
    --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).