DPDK patches and discussions
 help / color / mirror / Atom feed
From: Billy McFall <bmcfall@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: thomas.monjalon@6wind.com, wenzhuo.lu@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 3/3] driver: vHost support to free consumed buffers
Date: Wed, 11 Jan 2017 14:54:11 -0500	[thread overview]
Message-ID: <CAKLkqD7v8-jeBqgyT0ZGR1UBfQHiwy1q+BEUxUinmic7Mc_kVg@mail.gmail.com> (raw)
In-Reply-To: <20161216082404.3377bfc6@xeon-e3>

This new API is attempting to address two scenarios:
1) Application wants to reuse existing mbuf to avoid a packet copy
(example: Flooding a packet to multiple ports). The application increments
the reference count of the packet and then polls new API until the reference
count for the given mbuf is decremented.
2) Application runs out of mbufs, or some application like pktgen finishes
a run and is preparing for an additional run, calls API to free consumed
packets so processing can continue.

With the current design, the application calls the new API, if rval >= 0,
assume mubfs are being freed and can call multiple times if need be (to
either get enough mbufs to continue or to get the specific one freed). If
rval < 0, take some other action, like make a copy of packet in the
flooding case or whatever is currently done in the application today.

If the default behavior is to return 0, the application can't take any
additional actions.

Submitting V2 of the patch with the rte_eth_tx_buffer_flush() call and
associated parameters removed and to continue the discussion on new API or
not.

Thanks,
Billy McFall


On Fri, Dec 16, 2016 at 11:24 AM, Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Fri, 16 Dec 2016 07:48:51 -0500
> Billy McFall <bmcfall@redhat.com> wrote:
>
> > Add support to the vHostdriver for the new API to force free consumed
> > buffers on TX ring. vHost does not cache the mbufs so there is no work
> > to do.
> >
> > Signed-off-by: Billy McFall <bmcfall@redhat.com>
> > ---
> >  drivers/net/vhost/rte_eth_vhost.c | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/net/vhost/rte_eth_vhost.c
> b/drivers/net/vhost/rte_eth_vhost.c
> > index 766d4ef..6493d56 100644
> > --- a/drivers/net/vhost/rte_eth_vhost.c
> > +++ b/drivers/net/vhost/rte_eth_vhost.c
> > @@ -939,6 +939,16 @@ eth_queue_release(void *q)
> >  }
> >
> >  static int
> > +eth_tx_done_cleanup(void *txq __rte_unused, uint32_t free_cnt
> __rte_unused)
> > +{
> > +     /*
> > +      * vHost does not hang onto mbuf. eth_vhost_tx() copies packet data
> > +      * and releases mbuf, so nothing to cleanup.
> > +      */
> > +     return 0;
> > +}
> > +
> > +static int
> >  eth_link_update(struct rte_eth_dev *dev __rte_unused,
> >               int wait_to_complete __rte_unused)
> >  {
> > @@ -979,6 +989,7 @@ static const struct eth_dev_ops ops = {
> >       .tx_queue_setup = eth_tx_queue_setup,
> >       .rx_queue_release = eth_queue_release,
> >       .tx_queue_release = eth_queue_release,
> > +     .tx_done_cleanup = eth_tx_done_cleanup,
> >       .link_update = eth_link_update,
> >       .stats_get = eth_stats_get,
> >       .stats_reset = eth_stats_reset,
>
> Rather than having to change every drive, why not make this the default
> behavior?
>

      reply	other threads:[~2017-01-11 19:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 12:48 [dpdk-dev] [PATCH 0/3] New API to free consumed buffers in TX ring Billy McFall
2016-12-16 12:48 ` [dpdk-dev] [PATCH 1/3] ethdev: " Billy McFall
2016-12-16 16:28   ` Stephen Hemminger
2016-12-20 11:27   ` Adrien Mazarguil
2016-12-20 12:17     ` Ananyev, Konstantin
2016-12-20 12:58       ` Adrien Mazarguil
2016-12-20 14:15         ` Billy McFall
2016-12-23  9:45           ` Adrien Mazarguil
2016-12-16 12:48 ` [dpdk-dev] [PATCH 2/3] driver: e1000 igb support to free consumed buffers Billy McFall
2016-12-16 12:48 ` [dpdk-dev] [PATCH 3/3] driver: vHost " Billy McFall
2016-12-16 16:24   ` Stephen Hemminger
2017-01-11 19:54     ` Billy McFall [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=CAKLkqD7v8-jeBqgyT0ZGR1UBfQHiwy1q+BEUxUinmic7Mc_kVg@mail.gmail.com \
    --to=bmcfall@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas.monjalon@6wind.com \
    --cc=wenzhuo.lu@intel.com \
    /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).