[dpdk-dev] Getting started - sanity check

Clark, Gilbert gc355804 at ohio.edu
Sat May 9 18:27:12 CEST 2015


Hi folks:

I'm brand new to DPDK.  Read about it off and on occasionally, but never had the chance to sit down and play with things until now.  It's been fun so far: just been working on a few toy applications to get myself started.

I have run into a question, though: when calling rte_eth_tx_burst with a ring-backed PMD I've set up, the mbufs I've sent never seem to be freed.  This seems to make some degree of sense, but ... since I'm new, and because the documentation says rte_eth_tx_burst should eventually free mbufs that are sent [1], I wanted to make sure I'm on track and not just misunderstanding the way something works [2].

Thanks,
Gilbert Clark

[1] From http://dpdk.org/doc/api/rte__ethdev_8h.html :

It is the responsibility of the rte_eth_tx_burst() function to transparently free the memory buffers of packets previously sent

[2] From lib/librte_pmd_ring.c:

static uint16_t
eth_ring_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
{
    void **ptrs = (void *)&bufs[0];
    struct ring_queue *r = q;
    const uint16_t nb_tx = (uint16_t)rte_ring_enqueue_burst(r->rng,
            ptrs, nb_bufs);
    if (r->rng->flags & RING_F_SP_ENQ) {
        r->tx_pkts.cnt += nb_tx;
        r->err_pkts.cnt += nb_bufs - nb_tx;
    } else {
        rte_atomic64_add(&(r->tx_pkts), nb_tx);
        rte_atomic64_add(&(r->err_pkts), nb_bufs - nb_tx);
    }
    return nb_tx;
}

This doesn't ever appear to free a transmitted mbuf ... unless there's code to do that somewhere else that I'm missing?


More information about the dev mailing list