On 10/19/2015 12:17 PM, Stephen Hemminger wrote:
> On Sun, 18 Oct 2015 14:29:03 +0800
> Huawei Xie <huawei.xie at intel.com> wrote:
>
>> +
>> +    for (i = 1; i < VIRTIO_TX_FREE_NR; i++) {
>> +            m = (struct rte_mbuf *)vq->vq_descx[desc_idx++].cookie;
>> +            if (likely(m->pool == free[0]->pool))
>> +                    free[nb_free++] = m;
>> +            else {
>> +                    rte_mempool_put_bulk(free[0]->pool, (void **)free,
>> +                            nb_free);
>> +                    free[0] = m;
>> +                    nb_free = 1;
>> +            }
>> +    }
> This assumes all transmits are from the same pool, which is not necessarily 
> true.

Don't get you. It accumulates all the mbufs from the same pool, free all
of them until it meets one from a different pool.

        if (likely(m->pool == free[0]->pool))


>

Reply via email to