ethdev: add buffered Tx
authorTomasz Kulasek <tomaszx.kulasek@intel.com>
Thu, 10 Mar 2016 17:19:34 +0000 (18:19 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 11 Mar 2016 17:05:55 +0000 (18:05 +0100)
commitd6c99e62c852f607ff6efc2749a774dc0d9bbad1
treeae375f95d876ac1352c091347dbc6373ddcd8d8c
parentfd2fca6f6b5abb12a19c6338a77bff2e2780e49d
ethdev: add buffered Tx

Many sample apps include internal buffering for single-packet-at-a-time
operation. Since this is such a common paradigm, this functionality is
better suited to being implemented in the ethdev API.

The new APIs in the ethdev library are:
* rte_eth_tx_buffer_init - initialize buffer
* rte_eth_tx_buffer - buffer up a single packet for future transmission
* rte_eth_tx_buffer_flush - flush any unsent buffered packets
* rte_eth_tx_buffer_set_err_callback - set up a callback to be called in
  case transmitting a buffered burst fails. By default, we just free the
  unsent packets.

As well as these, an additional reference callbacks are provided, which
frees the packets:

* rte_eth_tx_buffer_drop_callback - silently drop packets (default
  behavior)
* rte_eth_tx_buffer_count_callback - drop and update user-provided counter
  to track the number of dropped packets

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_ether/rte_ethdev.c
lib/librte_ether/rte_ethdev.h
lib/librte_ether/rte_ether_version.map