numam-dpdk/lib
Tomasz Kulasek 4fb7e803eb ethdev: add Tx preparation
Added API for `rte_eth_tx_prepare`

uint16_t rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id,
	struct rte_mbuf **tx_pkts, uint16_t nb_pkts)

Added fields to the `struct rte_eth_desc_lim`:

	uint16_t nb_seg_max;
		/**< Max number of segments per whole packet. */

	uint16_t nb_mtu_seg_max;
		/**< Max number of segments per one MTU */

These fields can be used to create valid packets according to the
following rules:

 * For non-TSO packet, a single transmit packet may span up to
   "nb_mtu_seg_max" buffers.

 * For TSO packet the total number of data descriptors is "nb_seg_max",
   and each segment within the TSO may span up to "nb_mtu_seg_max".

Added functions:

int
rte_validate_tx_offload(struct rte_mbuf *m)

  to validate general requirements for tx offload set in mbuf of packet
  such a flag completness. In current implementation this function is
  called optionaly when RTE_LIBRTE_ETHDEV_DEBUG is enabled.

int rte_net_intel_cksum_prepare(struct rte_mbuf *m)

  to prepare pseudo header checksum for TSO and non-TSO tcp/udp packets
  before hardware tx checksum offload.
   - for non-TSO tcp/udp packets full pseudo-header checksum is
     counted and set.
   - for TSO the IP payload length is not included.

int
rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)

  this function uses same logic as rte_net_intel_cksum_prepare, but
  allows application to choose which offloads should be taken into
  account, if full preparation is not required.

PERFORMANCE TESTS
-----------------

This feature was tested with modified csum engine from test-pmd.

The packet checksum preparation was moved from application to Tx
preparation step placed before burst.

We may expect some overhead costs caused by:
1) using additional callback before burst,
2) rescanning burst,
3) additional condition checking (packet validation),
4) worse optimization (e.g. packet data access, etc.)

We tested it using ixgbe Tx preparation implementation with some parts
disabled to have comparable information about the impact of different
parts of implementation.

IMPACT:

1) For unimplemented Tx preparation callback the performance impact is
   negligible,
2) For packet condition check without checksum modifications (nb_segs,
   available offloads, etc.) is 14626628/14252168 (~2.62% drop),
3) Full support in ixgbe driver (point 2 + packet checksum
   initialization) is 14060924/13588094 (~3.48% drop)

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2017-01-04 20:40:15 +01:00
..
librte_acl lib: use C99 syntax for zero-size arrays 2016-09-13 15:35:28 +02:00
librte_cfgfile cfgfile: fix API comments 2016-11-06 23:34:40 +01:00
librte_cmdline cmdline: add alignment constraint 2016-12-23 10:19:11 +01:00
librte_compat compat: remove unneeded macro 2015-06-29 16:41:23 +02:00
librte_cryptodev cryptodev: clarify how operations affect buffers 2016-11-07 00:22:58 +01:00
librte_distributor distributor: remove inclusion of mbuf header 2015-05-11 15:36:37 +02:00
librte_eal ethdev: decouple from PCI device 2016-12-25 23:30:19 +01:00
librte_ether ethdev: add Tx preparation 2017-01-04 20:40:15 +01:00
librte_hash hash: fix bucket size usage 2016-10-12 18:40:52 +02:00
librte_ip_frag ip_frag: fix IP reassembly regression 2016-11-07 21:27:50 +01:00
librte_jobstats jobstats: fix typo in a comment 2016-06-30 18:51:20 +02:00
librte_kni doc: fix typos 2016-11-07 21:50:27 +01:00
librte_kvargs remove unneeded tests for NULL when freeing 2016-01-27 15:34:48 +01:00
librte_lpm lpm: fix freeing memory 2016-11-06 23:46:03 +01:00
librte_mbuf ethdev: add Tx preparation 2017-01-04 20:40:15 +01:00
librte_mempool doc: fix typos in code comments 2016-12-06 15:25:01 +01:00
librte_meter meter: fix excess token bucket update in srtcm 2016-09-21 22:56:03 +02:00
librte_net ethdev: add Tx preparation 2017-01-04 20:40:15 +01:00
librte_pdump doc: add pdump library to API doxygen 2016-12-06 15:43:13 +01:00
librte_pipeline lib: work around unnamed structs/unions 2016-09-13 15:35:28 +02:00
librte_port port: support file descriptor 2016-10-13 11:42:37 +02:00
librte_power examples/vm_power_manager: remove dependency on internal header 2016-07-11 17:23:32 +02:00
librte_reorder lib: add missing include dependencies 2016-09-13 15:35:28 +02:00
librte_ring doc: fix typos in code comments 2016-12-06 15:25:01 +01:00
librte_sched sched: fix releasing enqueued packets 2016-09-23 21:14:54 +02:00
librte_table table: add cuckoo hash 2016-10-12 22:08:36 +02:00
librte_timer timer: fix lag delay 2016-10-05 12:02:53 +02:00
librte_vhost vhost: remove references to vhost-cuse 2016-11-07 15:59:21 +01:00
Makefile ivshmem: remove library and its EAL integration 2016-08-23 12:23:58 +02:00