DPDK usage discussions
 help / color / Atom feed
* [dpdk-users] ojectes from the mempool are disorderd by rte_mempool_generic_get
@ 2020-03-24  5:16 宋捷
  2020-03-24 10:54 ` Van Haaren, Harry
  0 siblings, 1 reply; 2+ messages in thread
From: 宋捷 @ 2020-03-24  5:16 UTC (permalink / raw)
  To: users, Stephen Hemminger, Van Haaren, Harry

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

 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-users] ojectes from the mempool are disorderd by rte_mempool_generic_get
  2020-03-24  5:16 [dpdk-users] ojectes from the mempool are disorderd by rte_mempool_generic_get 宋捷
@ 2020-03-24 10:54 ` Van Haaren, Harry
  0 siblings, 0 replies; 2+ messages in thread
From: Van Haaren, Harry @ 2020-03-24 10:54 UTC (permalink / raw)
  To: 宋捷, users, Stephen Hemminger

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: ^[$BAW>9^[(B <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^[$B!G^[(Bs any other way for can get objects from the mempool orderly

I used DPDK18.05

Thanks

Jie


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24  5:16 [dpdk-users] ojectes from the mempool are disorderd by rte_mempool_generic_get 宋捷
2020-03-24 10:54 ` Van Haaren, Harry

DPDK usage discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox