DPDK usage discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Alan Beadle <ab.beadle@gmail.com>
Cc: users@dpdk.org
Subject: Re: Force driver to free sent buffers?
Date: Mon, 7 Oct 2024 08:52:38 +0200	[thread overview]
Message-ID: <CAJFAV8xF+-3Ji9=koH-CsCSNWBSK=WxF0YL8onX83oR+bPHhjg@mail.gmail.com> (raw)
In-Reply-To: <CANTAOdxvF7H+ncXwDEXP43Ge7VYMhPQ6Rqx=iZJUqOKxQFokCA@mail.gmail.com>

On Sun, Oct 6, 2024 at 6:39 PM Alan Beadle <ab.beadle@gmail.com> wrote:
>
> Hi everyone,
>
> Based on my thread from last week, I am using rte_mbuf_refcnt_update()
> to increment the mbuf refcnts so that the driver will not free buffers
> before my local readers are done with them.
> I am also maintaining a queue of mbufs that local readers are finished
> with, and periodically using rte_mbuf_refcnt_read() to see if the
> refcnt is 1 yet, so that they can be freed or reused.
>
> An aside: Is there any problem with reuse of mbufs? Without actually
> freeing and re-allocating it, that is? I plan to do this in order to
> avoid having to link new mbufs to other reused data structures in my
> application.
>
> The current problem is as follows: My application has a separate
> unrelated heap (special purpose and bounded in size) and this heap
> runs out of memory after a brief time because of having to track so
> many unfreed mbufs. It appears that none of the mbufs are being freed

Would it help to store this per-mbuf tracking context into a private area?

You can ask for a per-mbuf private area at the mempool creation, see priv_size.
https://doc.dpdk.org/api/rte__mbuf_8h.html#a593921f13307803b94bbb4e0932db962


> by the driver after being sent, and it looks like it won't free them
> until it runs out of descriptors, which is too long for my situation.
>
> I have confirmed that the packets are being sent (received on other PC
> with wireshark) and should be freeable. Is there a way to force the
> driver to free sent mbufs earlier than when it runs out of
> descriptors?


-- 
David Marchand


      parent reply	other threads:[~2024-10-07  6:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-06 16:38 Alan Beadle
2024-10-06 22:18 ` Stephen Hemminger
2024-10-10 14:12   ` Alan Beadle
2024-10-10 15:17     ` Alan Beadle
2024-10-07  6:52 ` David Marchand [this message]

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='CAJFAV8xF+-3Ji9=koH-CsCSNWBSK=WxF0YL8onX83oR+bPHhjg@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=ab.beadle@gmail.com \
    --cc=users@dpdk.org \
    /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).