On 03/21, Stephen Hemminger wrote:
>On Thu, 21 Mar 2019 17:18:41 +0800
>Xiaolong Ye <xiaolong...@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.

Reply via email to