[dpdk-dev] A question of DPDK ring buffer

2013-08-24 Thread Beef
cv ? 2013-8-20?12:37?"Bob Chen" ??? > Hi folks, > > Is there anyone who has researched the mechanism of DPDK ring buffer by any > chance? I was trying to understand the multi-producer and muti-consumer > scenario, the CAS(compare and swap) operation is not an obstacle to me, and > from what

[dpdk-dev] A question of DPDK ring buffer

2013-08-21 Thread Olivier MATZ
Hi Bob, > do { > prod_head = r->prod.head; > cons_tail = r->cons.tail; > prod_next = prod_head + n; > success = rte_atomic32_cmpset(&r->prod.head, prod_head, > prod_next); > > /* > * Why no

[dpdk-dev] A question of DPDK ring buffer

2013-08-20 Thread Bob Chen
Hi folks, Is there anyone who has researched the mechanism of DPDK ring buffer by any chance? I was trying to understand the multi-producer and muti-consumer scenario, the CAS(compare and swap) operation is not an obstacle to me, and from what I can tell, the method which DPDK adopts is basica

[dpdk-dev] A question of DPDK ring buffer

2013-08-20 Thread Bob Chen
Hi folks, Is there anyone who has researched the mechanism of DPDK ring buffer by any chance? I was trying to understand the multi-producer and muti-consumer scenario, the CAS(compare and swap) operation is not an obstacle to me, and from what I can tell, the method which DPDK adopts is basica

[dpdk-dev] A question of DPDK ring buffer

2013-08-20 Thread Olivier MATZ
Hello Ben, > OK, here is the question: Why DPDK has to maintain that public prod_tail > structure? Is it really necessary to endure a while loop here? If you remove this wait loop, you can trigger an issue. Imagine a case where core 0 wants to add an object in the ring: it does the CAS, modifying

[dpdk-dev] A question of DPDK ring buffer

2013-08-20 Thread Chen, Bo D
Bob -Original Message- From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Olivier MATZ Sent: Tuesday, August 20, 2013 4:22 PM To: Bob Chen Cc: dev Subject: Re: [dpdk-dev] A question of DPDK ring buffer Hello Ben, > OK, here is the question: Why DPDK has to maintain that public > p