numam-dpdk/doc/guides/prog_guide
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
..
img hash: add predictable RSS 2021-04-20 23:13:23 +02:00
bbdev.rst doc: update bbdev guide 2020-10-14 21:32:11 +02:00
bpf_lib.rst bpf: support packet data load instructions 2020-06-24 23:42:04 +02:00
build_app.rst build: remove makefiles 2020-09-08 00:09:50 +02:00
build-sdk-meson.rst doc: add links for build requirements per OS 2021-04-17 12:37:38 +02:00
compressdev.rst eal: replace blacklist/whitelist options 2020-11-16 00:11:22 +01:00
cryptodev_lib.rst cryptodev: add enqueue and dequeue callbacks 2021-01-19 18:05:44 +01:00
efd_lib.rst doc: fix spelling reported by aspell in guides 2019-05-03 00:37:13 +02:00
env_abstraction_layer.rst eal: replace blacklist/whitelist options 2020-11-16 00:11:22 +01:00
event_crypto_adapter.rst eventdev: introduce crypto adapter enqueue API 2021-04-17 18:49:52 +02:00
event_ethernet_rx_adapter.rst eventdev: support Rx adapter event vector 2021-04-12 09:23:34 +02:00
event_ethernet_tx_adapter.rst eventdev: introduce event vector Tx capability 2021-04-12 09:23:34 +02:00
event_timer_adapter.rst lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
eventdev.rst eventdev: introduce event vector capability 2021-04-12 09:23:34 +02:00
flow_classify_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
generic_receive_offload_lib.rst gro: support VXLAN UDP/IPv4 2020-10-06 21:51:03 +02:00
generic_segmentation_offload_lib.rst gso: support VXLAN UDP/IPv4 2021-01-15 11:31:28 +01:00
glossary.rst eal: rename lcore master and slave 2020-10-20 13:17:08 +02:00
graph_lib.rst doc: fix figure numbering in graph guide 2021-01-15 12:28:19 +01:00
hash_lib.rst hash: implement RCU resources reclamation 2020-10-24 09:25:13 +02:00
index.rst doc: add Toeplitz hash guide 2021-04-20 23:12:47 +02:00
intro.rst build: remove makefiles 2020-09-08 00:09:50 +02:00
ip_fragment_reassembly_lib.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
ipsec_lib.rst ipsec: support CPU crypto mode 2020-02-05 15:29:59 +01:00
kernel_nic_interface.rst doc: fix typo in KNI guide 2020-11-04 21:08:30 +01:00
link_bonding_poll_mode_drv_lib.rst doc: fix driver names 2020-11-03 16:23:03 +01:00
lpm6_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
lpm_lib.rst lpm: implement RCU rule reclamation 2020-07-10 13:41:29 +02:00
lto.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
mbuf_lib.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
member_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
mempool_lib.rst doc: add stack mempool guide 2020-10-08 09:34:58 +02:00
meson_ut.rst doc: add a guide to run unit tests with meson 2020-02-16 11:30:30 +01:00
metrics_lib.rst metrics: add function to deinitialise library 2019-07-16 12:45:30 +02:00
multi_proc_support.rst doc: fix grammar 2020-11-26 16:03:16 +01:00
overview.rst build: remove makefiles 2020-09-08 00:09:50 +02:00
packet_classif_access_ctrl.rst acl: check max SIMD bitwidth 2020-10-19 16:45:02 +02:00
packet_distrib_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
packet_framework.rst doc: describe the SWX pipeline type 2020-11-13 13:55:07 +01:00
pdump_lib.rst doc: clarify multi-process roles for pdump 2020-11-26 16:32:11 +01:00
perf_opt_guidelines.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
poll_mode_drv.rst ethdev: support PF index in representor 2021-03-16 20:15:29 +01:00
power_man.rst power: add ethdev power management 2021-01-29 15:29:48 +01:00
profile_app.rst doc: add vtune profiling config to prog guide 2021-01-13 21:25:13 +01:00
qos_framework.rst lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rawdev.rst lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rcu_lib.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
regexdev.rst eal: replace blacklist/whitelist options 2020-11-16 00:11:22 +01:00
reorder_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
ring_lib.rst ring: add zero copy API 2020-10-29 14:13:31 +01:00
rte_flow.rst ethdev: add packet integrity check flow rules 2021-04-19 19:05:17 +02:00
rte_security.rst security: switch metadata to dynamic mbuf field 2020-10-31 16:13:11 +01:00
service_cores.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
source_org.rst doc: fix driver names 2020-11-03 16:23:03 +01:00
stack_lib.rst doc: add stack mempool guide 2020-10-08 09:34:58 +02:00
switch_representation.rst ethdev: support sub-function representor 2021-03-16 20:15:29 +01:00
telemetry_lib.rst doc: add more detail to telemetry guides 2020-07-30 20:32:49 +02:00
thread_safety_dpdk_functions.rst doc: fix reference to master process 2020-08-07 13:02:04 +02:00
timer_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
toeplitz_hash_lib.rst hash: add predictable RSS 2021-04-20 23:13:23 +02:00
trace_lib.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
traffic_management.rst doc: fix spelling reported by aspell in guides 2019-05-03 00:37:13 +02:00
traffic_metering_and_policing.rst ethdev: rename folder to library name 2018-04-27 18:01:00 +01:00
vhost_lib.rst vhost: enhance async enqueue for small packets 2021-01-13 18:51:58 +01:00
writing_efficient_code.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00