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 v2 3/3] net/vhost: vHost support to free consumed buffers
Date: Fri, 20 Jan 2017 11:00:31 -0500	[thread overview]
Message-ID: <CAKLkqD5tyi_3Gg7KazpgCsgURLg1YZ6JMKQn657xcPaSWzX2=A@mail.gmail.com> (raw)
In-Reply-To: <20170111173950.4e2c87ae@xeon-e3>

rte_eth_tx_done_cleanup(..) checks to see if .tx_done_cleanup is set, so in
that since it is optional. The reason for this function does no work and
returns 0 is to indicate to the application calling it that the mbufs are
free and the application can continue. The application needs to know if the
driver is attempting to the free the mbufs (return value >= 0) or not
implemented (return value < 0).

If return value is < 0, the application needs to take alternative action,
like make a copy of the packet in the flooding case, because the mbuf is
not going to be returned anytime soon. If return value is >= 0, keep
polling until the desired mbuf is returned (reference count decremented).

Let me know if this doesn't answer the question or I am missing your point.

Thanks,
Billy McFall

On Wed, Jan 11, 2017 at 8:39 PM, Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Wed, 11 Jan 2017 15:03:23 -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 change drivers, since this is not critical path, make
> it optional to have tx_done_cleanup.
>

      reply	other threads:[~2017-01-20 16:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 20:03 [dpdk-dev] [PATCH v2 0/3] new API to free consumed buffers in Tx ring Billy McFall
2017-01-11 20:03 ` [dpdk-dev] [PATCH v2 1/3] ethdev: " Billy McFall
2017-01-12  1:41   ` Stephen Hemminger
2017-01-11 20:03 ` [dpdk-dev] [PATCH v2 2/3] net/e1000: e1000 igb support to free consumed buffers Billy McFall
2017-01-11 20:03 ` [dpdk-dev] [PATCH v2 3/3] net/vhost: vHost " Billy McFall
2017-01-12  1:39   ` Stephen Hemminger
2017-01-20 16:00     ` 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='CAKLkqD5tyi_3Gg7KazpgCsgURLg1YZ6JMKQn657xcPaSWzX2=A@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).