numam-dpdk/lib/librte_net
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
..
Makefile net: remove mempool dependency 2016-11-06 23:25:20 +01:00
rte_arp.h net: change arp header struct declaration 2015-02-20 22:10:52 +01:00
rte_ether.h net: support QinQ in software packet type parser 2016-10-11 18:17:12 +02:00
rte_gre.h net: add GRE header structure 2016-10-11 18:17:13 +02:00
rte_icmp.h app/testpmd: add engine that replies to ARP and ICMP echo requests 2014-05-16 13:25:16 +02:00
rte_ip.h net: add function to calculate checksum in mbuf 2016-10-13 20:44:18 +02:00
rte_net_version.map net: add function to get packet type from data 2016-10-11 18:17:09 +02:00
rte_net.c net: get packet type for the first layers only 2016-10-11 18:17:13 +02:00
rte_net.h ethdev: add Tx preparation 2017-01-04 20:40:15 +01:00
rte_sctp.h remove trailing whitespaces 2014-06-11 00:29:34 +02:00
rte_tcp.h remove trailing whitespaces 2014-06-11 00:29:34 +02:00
rte_udp.h remove trailing whitespaces 2014-06-11 00:29:34 +02:00