rte_ring
關(guān)鍵點
無鎖: rte_atomic32_cmpset 直到成功(CAS)
環(huán): 總長度count應(yīng)該是2的倍數(shù),
求剩余空間: mask + tail - head(其中mask等于count-1)。(The subtraction is done between two unsigned 32bits value (the result is always modulo 32 bits even if we have prod_head > cons_tail). So 'free_entries' is always between 0 and size(ring)-1.)