numam-dpdk/lib
Olivier Matz 5842289a54 mbuf: add new Rx checksum flags
Following discussions in [1] and [2], introduce a new bit to
describe the Rx checksum status in mbuf.

Before this patch, only one flag was available:
  PKT_RX_L4_CKSUM_BAD: L4 cksum of RX pkt. is not OK.

And same for L3:
  PKT_RX_IP_CKSUM_BAD: IP cksum of RX pkt. is not OK.

This had 2 issues:
- it was not possible to differentiate "checksum good" from
  "checksum unknown".
- it was not possible for a virtual driver to say "the checksum
  in packet may be wrong, but data integrity is valid".

This patch tries to solve this issue by having 4 states (2 bits)
for the IP and L4 Rx checksums. New values are:

 - PKT_RX_L4_CKSUM_UNKNOWN: no information about the RX L4 checksum
   -> the application should verify the checksum by sw
 - PKT_RX_L4_CKSUM_BAD: the L4 checksum in the packet is wrong
   -> the application can drop the packet without additional check
 - PKT_RX_L4_CKSUM_GOOD: the L4 checksum in the packet is valid
   -> the application can accept the packet without verifying the
      checksum by sw
 - PKT_RX_L4_CKSUM_NONE: the L4 checksum is not correct in the packet
   data, but the integrity of the L4 data is verified.
   -> the application can process the packet but must not verify the
      checksum by sw. It has to take care to recalculate the cksum
      if the packet is transmitted (either by sw or using tx offload)

  And same for L3 (replace L4 by IP in description above).

This commit tries to be compatible with existing applications that
only check the existing flag (CKSUM_BAD).

[1] http://dpdk.org/ml/archives/dev/2016-May/039920.html
[2] http://dpdk.org/ml/archives/dev/2016-June/040007.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-10-13 20:45:33 +02:00
..
librte_acl lib: use C99 syntax for zero-size arrays 2016-09-13 15:35:28 +02:00
librte_cfgfile lib: add missing include dependencies 2016-09-13 15:35:28 +02:00
librte_cmdline lib: add missing include dependencies 2016-09-13 15:35:28 +02:00
librte_compat compat: remove unneeded macro 2015-06-29 16:41:23 +02:00
librte_cryptodev cryptodev: fix build on Suse 11 SP2 2016-10-08 17:54:38 +02:00
librte_distributor distributor: remove inclusion of mbuf header 2015-05-11 15:36:37 +02:00
librte_eal app/test: fix vdev names 2016-10-13 15:55:42 +02:00
librte_ether app/test: fix vdev names 2016-10-13 15:55:42 +02:00
librte_hash hash: fix bucket size usage 2016-10-12 18:40:52 +02:00
librte_ip_frag ip_frag: fix missing dependency on hash library 2016-10-05 15:47:23 +02:00
librte_jobstats jobstats: fix typo in a comment 2016-06-30 18:51:20 +02:00
librte_kni kni: remove continuous memory restriction 2016-09-21 19:18:44 +02:00
librte_kvargs remove unneeded tests for NULL when freeing 2016-01-27 15:34:48 +01:00
librte_lpm lib: add missing include dependencies 2016-09-13 15:35:28 +02:00
librte_mbuf mbuf: add new Rx checksum flags 2016-10-13 20:45:33 +02:00
librte_mempool mempool: fix comments for no contiguous flag 2016-10-04 11:16:01 +02:00
librte_meter meter: fix excess token bucket update in srtcm 2016-09-21 22:56:03 +02:00
librte_net net: add function to calculate checksum in mbuf 2016-10-13 20:44:18 +02:00
librte_pdump pdump: fix created directory permissions 2016-10-12 18:40:49 +02:00
librte_pipeline lib: work around unnamed structs/unions 2016-09-13 15:35:28 +02:00
librte_port port: support file descriptor 2016-10-13 11:42:37 +02:00
librte_power examples/vm_power_manager: remove dependency on internal header 2016-07-11 17:23:32 +02:00
librte_reorder lib: add missing include dependencies 2016-09-13 15:35:28 +02:00
librte_ring lib: use C99 syntax for zero-size arrays 2016-09-13 15:35:28 +02:00
librte_sched sched: fix releasing enqueued packets 2016-09-23 21:14:54 +02:00
librte_table table: add cuckoo hash 2016-10-12 22:08:36 +02:00
librte_timer timer: fix lag delay 2016-10-05 12:02:53 +02:00
librte_vhost vhost: fix Windows VM hang 2016-10-13 10:29:31 +02:00
Makefile ivshmem: remove library and its EAL integration 2016-08-23 12:23:58 +02:00