DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Billy McFall <bmcfall@redhat.com>
Cc: thomas.monjalon@6wind.com, wenzhuo.lu@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/3] ethdev: New API to free consumed buffers in TX ring
Date: Fri, 16 Dec 2016 08:28:54 -0800	[thread overview]
Message-ID: <20161216082854.48238355@xeon-e3> (raw)
In-Reply-To: <20161216124851.2640-2-bmcfall@redhat.com>

On Fri, 16 Dec 2016 07:48:49 -0500
Billy McFall <bmcfall@redhat.com> wrote:

> /**
> + * Request the driver to free mbufs currently cached by the driver. The
> + * driver will only free the mbuf if it is no longer in use.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param queue_id
> + *   The index of the transmit queue through which output packets must be
> + *   sent.
> + *   The value must be in the range [0, nb_tx_queue - 1] previously supplied
> + *   to rte_eth_dev_configure().
> + * @param free_cnt
> + *   Maximum number of packets to free. Use 0 to indicate all possible packets
> + *   should be freed. Note that a packet may be using multiple mbufs.
> + * @param buffer
> + *   Buffer used to collect packets to be sent. If provided, the buffer will
> + *   be flushed, even if the current length is less than buffer->size. Pass NULL
> + *   if buffer has already been flushed.
> + * @param sent
> + *   Pointer to return number of packets sent if buffer has packets to be sent.
> + *   If *buffer is supplied, *sent must also be supplied.
> + * @return
> + *   Failure: < 0
> + *     -ENODEV: Invalid interface
> + *     -ENOTSUP: Driver does not support function
> + *   Success: >= 0
> + *     0-n: Number of packets freed. More packets may still remain in ring that
> + *     are in use.
> + */
> +
> +static inline int
> +rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id,  uint32_t free_cnt,
> +		struct rte_eth_dev_tx_buffer *buffer, uint16_t *sent)


This API is more complex than it needs to be.
For the typical use case of OOM kind of cleanup, this is overkill.
There is no need for:
  free_cnt - device driver should just free all
  buffer/param - the application should not care.

The DPDK model is that once mbuf's are passed to device, the device "owns"
the mbuf. I think changing that model is just going to break things for
no gain.  It does make sense to have a "please cleanup your mbufs" call.
If application is using special mbuf's then it can use the normal callback
on done model.

  reply	other threads:[~2016-12-16 16:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 12:48 [dpdk-dev] [PATCH 0/3] " Billy McFall
2016-12-16 12:48 ` [dpdk-dev] [PATCH 1/3] ethdev: " Billy McFall
2016-12-16 16:28   ` Stephen Hemminger [this message]
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

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=20161216082854.48238355@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=bmcfall@redhat.com \
    --cc=dev@dpdk.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).