numam-dpdk/doc/guides/rel_notes
Yuan Wang 605975b8b3 ethdev: introduce protocol-based buffer split
Currently, Rx buffer split supports length based split. With Rx queue
offload RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT enabled and Rx packet segment
configured, PMD will be able to split the received packets into
multiple segments.

However, length based buffer split is not suitable for NICs that do split
based on protocol headers. Given an arbitrarily variable length in Rx
packet segment, it is almost impossible to pass a fixed protocol header to
driver. Besides, the existence of tunneling results in the composition of
a packet is various, which makes the situation even worse.

This patch extends current buffer split to support protocol header based
buffer split. A new proto_hdr field is introduced in the reserved field
of rte_eth_rxseg_split structure to specify protocol header. The proto_hdr
field defines the split position of packet, splitting will always happen
after the protocol header defined in the Rx packet segment. When Rx queue
offload RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT is enabled and corresponding
protocol header is configured, driver will split the ingress packets into
multiple segments.

Examples for proto_hdr field defines:
To split after ETH-IPV4-UDP, it should be defined as
proto_hdr = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN |
            RTE_PTYPE_L4_UDP

For inner ETH-IPV4-UDP, it should be defined as
proto_hdr = RTE_PTYPE_TUNNEL_GRENAT | RTE_PTYPE_INNER_L2_ETHER |
            RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_INNER_L4_UDP

If the protocol header is repeated with the previously defined one,
the repeated part should be omitted. For example, split after ETH, ETH-IPV4
and ETH-IPV4-UDP, it should be defined as
proto_hdr0 = RTE_PTYPE_L2_ETHER
proto_hdr1 = RTE_PTYPE_L3_IPV4_EXT_UNKNOWN
proto_hdr2 = RTE_PTYPE_L4_UDP

If protocol header split can be supported by a PMD, the
rte_eth_buffer_split_get_supported_hdr_ptypes function can
be used to obtain a list of these protocol headers.

For example, let's suppose we configured the Rx queue with the
following segments:
        seg0 - pool0, proto_hdr0=RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4,
               off0=2B
        seg1 - pool1, proto_hdr1=RTE_PTYPE_L4_UDP, off1=128B
        seg2 - pool2, proto_hdr2=0, off1=0B

The packet consists of ETH_IPV4_UDP_PAYLOAD will be split like
following:
        seg0 - ipv4 header @ RTE_PKTMBUF_HEADROOM + 2 in mbuf from pool0
        seg1 - udp header @ 128 in mbuf from pool1
        seg2 - payload @ 0 in mbuf from pool2

Now buffer split can be configured in two modes. User can choose length
or protocol header to configure buffer split according to NIC's
capability. For length based buffer split, the mp, length, offset field
in Rx packet segment should be configured, while the proto_hdr field
must be 0. For protocol header based buffer split, the mp, offset,
proto_hdr field in Rx packet segment should be configured, while the
length field must be 0.

Note: When protocol header split is enabled, NIC may receive packets
which do not match all the protocol headers within the Rx segments.
At this point, NIC will have two possible split behaviors according to
matching results, one is exact match, another is longest match.
The split result of NIC must belong to one of them.

The exact match means NIC only do split when the packets exactly match all
the protocol headers in the segments. Otherwise, the whole packet will be
put into the last valid mempool. The longest match means NIC will do split
until packets mismatch the protocol header in the segments. The rest will
be put into the last valid pool.

Pseudo-code for exact match:
FOR each seg in segs except last one
    IF proto_hdr is not matched THEN
        BREAK
    END IF
END FOR
IF loop breaked THEN
    put whole pkt in last seg
ELSE
    put protocol header in each seg
    put everything else in last seg
END IF

Pseudo-code for longest match:
FOR each seg in segs except last one
    IF proto_hdr is matched THEN
        put protocol header in seg
    ELSE
        BREAK
    END IF
END FOR
put everything else in last seg

Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2022-10-09 16:41:27 +02:00
..
deprecation.rst doc: clarify deprecation status for flow actions PF and VF 2022-10-09 19:36:19 +02:00
index.rst version: 22.11-rc0 2022-07-21 12:13:48 +02:00
known_issues.rst doc: fix vhost multi-queue reconnection 2022-06-01 11:50:09 +02:00
release_1_8.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
release_2_0.rst doc: remove template comments in old release notes 2021-09-23 08:38:31 +02:00
release_2_1.rst fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
release_2_2.rst fix PMD wording 2021-11-26 11:28:34 +01:00
release_16_04.rst fix PMD wording 2021-11-26 11:28:34 +01:00
release_16_07.rst fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
release_16_11.rst doc: remove template comments in old release notes 2021-09-23 08:38:31 +02:00
release_17_02.rst doc: remove template comments in old release notes 2021-09-23 08:38:31 +02:00
release_17_05.rst doc: remove template comments in old release notes 2021-09-23 08:38:31 +02:00
release_17_08.rst fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
release_17_11.rst doc: remove template comments in old release notes 2021-09-23 08:38:31 +02:00
release_18_02.rst doc: capitalise PMD 2021-11-26 11:28:34 +01:00
release_18_05.rst raw/dpaa2_qdma: remove driver 2022-06-01 08:58:27 +02:00
release_18_08.rst doc: remove template comments in old release notes 2021-09-23 08:38:31 +02:00
release_18_11.rst examples/kni: remove deprecated example 2022-10-03 18:24:24 +02:00
release_19_02.rst doc: remove template comments in old release notes 2021-09-23 08:38:31 +02:00
release_19_05.rst fix PMD wording 2021-11-26 11:28:34 +01:00
release_19_08.rst drivers: remove octeontx2 drivers 2022-01-12 15:36:32 +01:00
release_19_11.rst drivers: remove octeontx2 drivers 2022-01-12 15:36:32 +01:00
release_20_02.rst raw/octeontx2_ep: remove driver 2021-10-18 18:34:04 +02:00
release_20_05.rst doc: remove template comments in old release notes 2021-09-23 08:38:31 +02:00
release_20_08.rst doc: remove template comments in old release notes 2021-09-23 08:38:31 +02:00
release_20_11.rst regex/cn9k: use cnxk infrastructure 2022-01-12 15:33:49 +01:00
release_21_02.rst fix PMD wording 2021-11-26 11:28:34 +01:00
release_21_05.rst fix PMD wording 2021-11-26 11:28:34 +01:00
release_21_08.rst fix PMD wording 2021-11-26 11:28:34 +01:00
release_21_11.rst doc: add tested platforms with Mellanox NICs 2021-11-26 14:41:31 +01:00
release_22_03.rst doc: update release notes for 22.03 2022-03-16 20:47:11 +01:00
release_22_07.rst doc: update release notes for 22.07 2022-07-15 15:30:11 +02:00
release_22_11.rst ethdev: introduce protocol-based buffer split 2022-10-09 16:41:27 +02:00