[dpdk-dev] [PATCH v3 1/5] net/af_xdp: introduce AF XDP PMD driver

Ye Xiaolong xiaolong.ye at intel.com
Fri Mar 22 03:05:05 CET 2019


On 03/21, Stephen Hemminger wrote:
>On Thu, 21 Mar 2019 17:18:41 +0800
>Xiaolong Ye <xiaolong.ye at intel.com> wrote:
>
>> +	for (i = 0; i < rcvd; i++) {
>> +		const struct xdp_desc *desc;
>> +		uint64_t addr;
>> +		uint32_t len;
>> +		void *pkt;
>> +
>> +		desc = xsk_ring_cons__rx_desc(rx, idx_rx++);
>> +		addr = desc->addr;
>> +		len = desc->len;
>> +		pkt = xsk_umem__get_data(rxq->umem->buffer, addr);
>> +
>> +		mbuf = rte_pktmbuf_alloc(rxq->mb_pool);
>
>You could use rte_pktmbuf_alloc_bulk to get the mbufs in one call
>before doing this. It saves rcvd-1 atomic operations.

Got it, will do.


More information about the dev mailing list