Re: [PATCH v6 1/2] mbuf: provide rte_pktmbuf_alloc_bulk API
From: Olivier MATZ <hidden>
Date: 2016-02-26 08:45:34
On 02/26/2016 08:39 AM, Xie, Huawei wrote:
quoted
quoted
quoted
With 8 mbufs allocated, there is about 6% performance increase using inline. With 16 mbufs allocated, we could still observe obvious performance difference, though only 1%-2%
On 2/24/2016 9:23 PM, Ananyev, Konstantin wrote:quoted
As you can see right now we have all mbuf alloc/free routines as static inline. And I think we would like to keep it like that. So why that particular function should be different? After all that function is nothing more than a wrapper around rte_mempool_get_bulk() unrolled by 4 loop {rte_pktmbuf_reset()} So unless mempool get/put API would change, I can hardly see there could be any ABI breakages in future. About 'real world' performance gain - it was a 'real world' performance problem, that we tried to solve by introducing that function: http://dpdk.org/ml/archives/dev/2015-May/017633.html And according to the user feedback, it does help: http://dpdk.org/ml/archives/dev/2016-February/033203.html
For me, there's no doubt this function will help in real world use cases. That's also true that today most (oh no, all) datapath mbuf functions are inline. Although I understand Panu's point of view about the use of inline functions, trying to de-inline some functions of the mbuf API (and others APIs like mempool or ring) would require a deep analysis first to check the performance impact. And I think there would be an impact for most of them. In this particular case, as the function does bulk allocations, it probably tempers the cost of the function call, and that's why I was curious of any comparison with/without inlining. But I'm not sure having this only function as non-inline makes a lot of sense. So: Acked-by: Olivier Matz <redacted>