numam-dpdk/doc/guides/rel_notes
Ori Kam b10a421a1f ethdev: add packet integrity check flow rules
Currently, DPDK application can offload the checksum check,
and report it in the mbuf.

However, as more and more applications are offloading some or all
logic and action to the HW, there is a need to check the packet
integrity so the right decision can be taken.

The application logic can be positive meaning if the packet is
valid jump / do  actions, or negative if packet is not valid
jump to SW / do actions (like drop) and add default flow
(match all in low priority) that will direct the miss packet
to the miss path.

Since currently rte_flow works in positive way the assumption is
that the positive way will be the common way in this case also.

When thinking what is the best API to implement such feature,
we need to consider the following (in no specific order):
1. API breakage.
2. Simplicity.
3. Performance.
4. HW capabilities.
5. rte_flow limitation.
6. Flexibility.

First option: Add integrity flags to each of the items.
For example add checksum_ok to IPv4 item.

Pros:
1. No new rte_flow item.
2. Simple in the way that on each item the app can see
what checks are available.

Cons:
1. API breakage.
2. Increase number of flows, since app can't add global rule and must
   have dedicated flow for each of the flow combinations, for example
   matching on ICMP traffic or UDP/TCP  traffic with IPv4 / IPv6 will
   result in 5 flows.

Second option: dedicated item

Pros:
1. No API breakage, and there will be no for some time due to having
   extra space. (by using bits)
2. Just one flow to support the ICMP or UDP/TCP traffic with IPv4 /
   IPv6.
3. Simplicity application can just look at one place to see all possible
   checks.
4. Allow future support for more tests.

Cons:
1. New item, that holds number of fields from different items.

For starter the following bits are suggested:
1. packet_ok - means that all HW checks depending on packet layer have
   passed. This may mean that in some HW such flow should be split to
   number of flows or fail.
2. l2_ok - all check for layer 2 have passed.
3. l3_ok - all check for layer 3 have passed. If packet doesn't have
   L3 layer this check should fail.
4. l4_ok - all check for layer 4 have passed. If packet doesn't
   have L4 layer this check should fail.
5. l2_crc_ok - the layer 2 CRC is O.K.
6. ipv4_csum_ok - IPv4 checksum is O.K. It is possible that the
   IPv4 checksum will be O.K. but the l3_ok will be 0. It is not
   possible that checksum will be 0 and the l3_ok will be 1.
7. l4_csum_ok - layer 4 checksum is O.K.
8. l3_len_OK - check that the reported layer 3 length is smaller than the
   frame length.

Example of usage:
1. Check packets from all possible layers for integrity.
   flow create integrity spec packet_ok = 1 mask packet_ok = 1 .....

2. Check only packet with layer 4 (UDP / TCP)
   flow create integrity spec l3_ok = 1, l4_ok = 1 mask l3_ok = 1
   l4_ok = 1

Signed-off-by: Ori Kam <orika@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2021-04-19 19:05:17 +02:00
..
deprecation.rst doc: announce event Rx adapter config changes 2021-04-12 09:23:34 +02:00
index.rst version: 21.05-rc0 2021-02-15 11:08:19 +01:00
known_issues.rst lib: remove librte_ prefix from directory names 2021-04-21 14:04: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: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
release_2_1.rst mk: use linux and freebsd in config names 2019-03-12 23:05:06 +01:00
release_2_2.rst doc: add SPDX and copyright to release notes 2018-08-09 22:48:10 +02:00
release_16_04.rst doc: add SPDX and copyright to release notes 2018-08-09 22:48:10 +02:00
release_16_07.rst remove blank lines at end of file 2019-11-26 00:12:08 +01:00
release_16_11.rst doc: add SPDX and copyright to release notes 2018-08-09 22:48:10 +02:00
release_17_02.rst doc: remove useless anchor for flow API guide 2019-01-31 18:41:07 +01:00
release_17_05.rst doc: add SPDX and copyright to release notes 2018-08-09 22:48:10 +02:00
release_17_08.rst doc: add SPDX and copyright to release notes 2018-08-09 22:48:10 +02:00
release_17_11.rst doc/guides: clean repeated words 2019-11-15 11:36:27 +01:00
release_18_02.rst doc/guides: clean repeated words 2019-11-15 11:36:27 +01:00
release_18_05.rst doc: fix link in release notes 2019-08-02 21:58:59 +02:00
release_18_08.rst doc: fix naming of Mellanox devices 2020-02-25 15:55:54 +01:00
release_18_11.rst doc: update release notes for 18.11 2018-11-27 00:26:07 +01:00
release_19_02.rst doc: fix naming of Mellanox devices 2020-02-25 15:55:54 +01:00
release_19_05.rst doc: update release notes for 19.05 2019-05-13 21:50:14 +02:00
release_19_08.rst doc: update release notes for i40e MARK+RSS 2019-08-06 11:39:55 +02:00
release_19_11.rst common/qat: fix GEN3 marketing name 2020-04-05 18:26:04 +02:00
release_20_02.rst doc: add reason for three-part ABI versioning 2020-05-18 19:46:25 +02:00
release_20_05.rst doc: update release notes for 20.05 2020-05-25 23:36:16 +02:00
release_20_08.rst doc: update release notes for 20.08 2020-08-08 00:21:21 +02:00
release_20_11.rst event/dlb: remove driver 2021-04-12 09:21:30 +02:00
release_21_02.rst doc: update release notes for 21.02 2021-02-12 16:18:31 +01:00
release_21_05.rst ethdev: add packet integrity check flow rules 2021-04-19 19:05:17 +02:00