numam-dpdk/doc/guides/nics
Viacheslav Ovsiienko 4ff702b5df ethdev: introduce Rx buffer split
The DPDK datapath in the transmit direction is very flexible.
An application can build the multi-segment packet and manages
almost all data aspects - the memory pools where segments
are allocated from, the segment lengths, the memory attributes
like external buffers, registered for DMA, etc.

In the receiving direction, the datapath is much less flexible,
an application can only specify the memory pool to configure the
receiving queue and nothing more. In order to extend receiving
datapath capabilities it is proposed to add the way to provide
extended information how to split the packets being received.

The new offload flag RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT in device
capabilities is introduced to present the way for PMD to report to
application about supporting Rx packet split to configurable
segments. Prior invoking the rte_eth_rx_queue_setup() routine
application should check RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT flag.

The following structure is introduced to specify the Rx packet
segment for RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT offload:

struct rte_eth_rxseg_split {

    struct rte_mempool *mp; /* memory pools to allocate segment from */
    uint16_t length; /* segment maximal data length,
		       	configures "split point" */
    uint16_t offset; /* data offset from beginning
		       	of mbuf data buffer */
    uint32_t reserved; /* reserved field */
};

The segment descriptions are added to the rte_eth_rxconf structure:
   rx_seg - pointer the array of segment descriptions, each element
             describes the memory pool, maximal data length, initial
             data offset from the beginning of data buffer in mbuf.
	     This array allows to specify the different settings for
	     each segment in individual fashion.
   rx_nseg - number of elements in the array

If the extended segment descriptions is provided with these new
fields the mp parameter of the rte_eth_rx_queue_setup must be
specified as NULL to avoid ambiguity.

There are two options to specify Rx buffer configuration:
- mp is not NULL, rrx_conf.rx_nseg is zero, it is compatible
  configuration, follows existing implementation, provides
  the single pool and no description for segment sizes
  and offsets.
- mp is NULL, rx_conf.rx_seg is not NULL, rx_conf.rx_nseg is not
  zero, it provides the extended configuration, individually for
  each segment.

f the Rx queue is configured with new settings the packets being
received will be split into multiple segments pushed to the mbufs
with specified attributes. The PMD will split the received packets
into multiple segments according to the specification in the
description array.

For example, let's suppose we configured the Rx queue with the
following segments:
    seg0 - pool0, len0=14B, off0=2
    seg1 - pool1, len1=20B, off1=128B
    seg2 - pool2, len2=20B, off2=0B
    seg3 - pool3, len3=512B, off3=0B

The packet 46 bytes long will look like the following:
    seg0 - 14B long @ RTE_PKTMBUF_HEADROOM + 2 in mbuf from pool0
    seg1 - 20B long @ 128 in mbuf from pool1
    seg2 - 12B long @ 0 in mbuf from pool2

The packet 1500 bytes long will look like the following:
    seg0 - 14B @ RTE_PKTMBUF_HEADROOM + 2 in mbuf from pool0
    seg1 - 20B @ 128 in mbuf from pool1
    seg2 - 20B @ 0 in mbuf from pool2
    seg3 - 512B @ 0 in mbuf from pool3
    seg4 - 512B @ 0 in mbuf from pool3
    seg5 - 422B @ 0 in mbuf from pool3

The offload RTE_ETH_RX_OFFLOAD_SCATTER must be present and
configured to support new buffer split feature (if rx_nseg
is greater than one).

The split limitations imposed by underlying PMD is reported
in the new introduced rte_eth_dev_info->rx_seg_capa field.

The new approach would allow splitting the ingress packets into
multiple parts pushed to the memory with different attributes.
For example, the packet headers can be pushed to the embedded
data buffers within mbufs and the application data into
the external buffers attached to mbufs allocated from the
different memory pools. The memory attributes for the split
parts may differ either - for example the application data
may be pushed into the external memory located on the dedicated
physical device, say GPU or NVMe. This would improve the DPDK
receiving datapath flexibility with preserving compatibility
with existing API.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2020-10-16 22:26:40 +02:00
..
features net/bnxt: support fast mbuf free 2020-10-09 13:17:42 +02:00
img net/ice: add DCF hardware initialization 2020-04-21 13:57:05 +02:00
af_packet.rst doc: fix spelling reported by aspell in guides 2019-05-03 00:37:13 +02:00
af_xdp.rst net/af_xdp: forbid umem sharing for xsks with same context 2020-10-16 19:48:17 +02:00
ark.rst net/ark: remove Tx padding configuration macro 2020-09-18 18:55:08 +02:00
atlantic.rst doc: fix spelling reported by aspell in guides 2019-05-03 00:37:13 +02:00
avp.rst doc: fix copyright notice in AVP guide 2019-11-28 03:12:55 +01:00
axgbe.rst doc: fix spelling in PMD guides 2018-10-26 22:14:05 +02:00
bnx2x.rst net/bnx2x: add Rx descriptor MTU segment limitation 2020-05-11 22:27:39 +02:00
bnxt.rst net/bnxt: support runtime EM selection 2020-10-16 19:47:58 +02:00
build_and_test.rst kernel/linux: remove igb_uio 2020-10-06 14:50:13 +02:00
cxgbe.rst net/cxgbe: add devargs to control filtermode and filtermask 2020-03-18 15:29:39 +01:00
dpaa2.rst doc: fix diagram in dpaa2 guide 2020-10-12 22:52:48 +02:00
dpaa.rst net/dpaa: support VSP in fmlib 2020-09-18 18:55:07 +02:00
e1000em.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
ena.rst kernel/linux: remove igb_uio 2020-10-06 14:50:13 +02:00
enetc.rst doc: fix spelling reported by aspell in guides 2019-05-03 00:37:13 +02:00
enic.rst doc: prefer https when pointing to dpdk.org 2020-05-24 23:42:36 +02:00
fail_safe.rst doc: remove trailing white space 2020-10-06 00:42:21 +02:00
features.rst ethdev: introduce Rx buffer split 2020-10-16 22:26:40 +02:00
fm10k.rst doc/guides: clean repeated words 2019-11-15 11:36:27 +01:00
hinic.rst doc: remove flow director feature from hinic 2019-11-08 23:15:05 +01:00
hns3.rst doc: update feature list in hns3 guide 2020-07-07 23:38:28 +02:00
i40e.rst net/i40e: fix byte counters 2020-09-30 19:19:09 +02:00
ice.rst net/ice: remove devargs for flow mark 2020-09-18 18:55:11 +02:00
igb.rst doc: add igb guide 2018-02-08 18:42:14 +01:00
igc.rst net/igc: support flow API 2020-04-21 13:57:08 +02:00
index.rst net/igc: add skeleton 2020-04-21 13:57:07 +02:00
intel_vf.rst mk: use linux and freebsd in config names 2019-03-12 23:05:06 +01:00
ionic.rst net/ionic: add skeleton 2020-01-20 18:02:17 +01:00
ipn3ke.rst net/ipn3ke: add new driver 2019-04-19 14:51:54 +02:00
ixgbe.rst net/ixgbe: remove vector config 2020-01-17 19:59:18 +01:00
kni.rst remove blank lines at end of file 2019-11-26 00:12:08 +01:00
liquidio.rst doc: fix a common typo in NIC guides 2019-10-23 16:43:10 +02:00
memif.rst net/memif: use abstract socket address 2020-10-16 19:47:58 +02:00
mlx4.rst doc: fix references to removed guide 2020-10-01 16:41:15 +02:00
mlx5.rst doc: add sample flow limitation in mlx5 guide 2020-10-16 19:48:18 +02:00
mvneta.rst mk: use linux and freebsd in config names 2019-03-12 23:05:06 +01:00
mvpp2.rst doc: replace license text with SPDX tag 2019-07-29 22:57:28 +02:00
netvsc.rst doc: fix spelling reported by aspell in guides 2019-05-03 00:37:13 +02:00
nfb.rst net/nfb: support timestamp 2019-07-23 14:31:34 +02:00
nfp.rst doc: improve multiport PF in nfp guide 2020-09-18 18:55:12 +02:00
null.rst net/null: add argument for no Rx 2020-04-21 13:57:07 +02:00
octeontx2.rst net/octeontx2: support VLAN insert and strip actions 2020-09-30 19:19:11 +02:00
octeontx.rst net/octeontx: support VLAN filter offload 2020-04-21 13:57:06 +02:00
overview.rst use SPDX tag for 6WIND copyrighted files 2018-05-25 10:47:06 +02:00
pcap_ring.rst doc: fix typo in pcap guide 2020-10-16 19:48:18 +02:00
pfe.rst net/pfe: add link status update 2019-10-23 16:43:08 +02:00
qede.rst net/qede: support VF FLR 2020-09-30 19:19:11 +02:00
sfc_efx.rst doc: advertise Alveo SN1000 SmartNICs family support 2020-10-16 19:48:18 +02:00
softnic.rst app/testpmd: remove softnic forward mode 2020-07-11 06:18:53 +02:00
szedata2.rst net/szedata2: support Silicom Mango card 2019-07-03 12:57:30 +02:00
tap.rst doc: fix tap guide 2019-11-26 18:05:15 +01:00
thunderx.rst doc: refer to default directory for hugepages 2020-07-31 01:32:54 +02:00
vdev_netvsc.rst doc: fix typo in vdev_netvsc guide 2018-07-26 22:56:51 +02:00
vhost.rst net/vhost: add options for linear and external buffer 2020-04-21 13:57:07 +02:00
virtio.rst doc: remove references to python 2 2020-10-05 10:24:12 +02:00
vmxnet3.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00