From: "Wiles, Keith" <keith.wiles@intel.com>
To: "Clark, Gilbert" <gc355804@ohio.edu>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Getting started - sanity check
Date: Sat, 9 May 2015 16:41:06 +0000 [thread overview]
Message-ID: <BC6D6B3C-423F-4F9E-8C68-518FD93B6CD6@intel.com> (raw)
In-Reply-To: <1431188832058.4524@ohio.edu>
Sent from my iPhone
> On May 9, 2015, at 9:27 AM, Clark, Gilbert <gc355804@ohio.edu> wrote:
>
>
> 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].
The mbufs are free as needed or when a watermark is hit in the driver. One other thing I found is you need to send enough packets to hit the water mark for the tx mbufs start to get freed. Also you have to have enough mbufs allocated to hit these watermarks. I just pick two times the ring size just to be safe.
Hope that helps.
>
> 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?
next prev parent reply other threads:[~2015-05-09 16:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-09 16:27 Clark, Gilbert
2015-05-09 16:41 ` Wiles, Keith [this message]
2015-05-10 1:29 ` Clark, Gilbert
2015-05-11 10:12 ` Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BC6D6B3C-423F-4F9E-8C68-518FD93B6CD6@intel.com \
--to=keith.wiles@intel.com \
--cc=dev@dpdk.org \
--cc=gc355804@ohio.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).