dpdk: correct the printing of Rx offloading flags 81/39581/3
authorJieqiang Wang <jieqiang.wang@arm.com>
Mon, 21 Aug 2023 07:58:10 +0000 (15:58 +0800)
committerMohammed HAWARI <momohawari@gmail.com>
Mon, 6 Nov 2023 10:21:35 +0000 (10:21 +0000)
commit505f4e1db1c0c4cc934b1206be283e88d47af0fe
tree1ef47532904a5916e6155f086cf49678dcdfb34b
parent7444fd2a0d177796cacb7c040323cdc327afa97a
dpdk: correct the printing of Rx offloading flags

DPDK added new Rx checksum flags[1] to handle cases like the virtual
drivers. Current check of flags is not strict enough for flags like
RTE_MBUF_F_RX_IP_CKSUM_NONE and will always be true no matter the
checksum in packet is good or bad.
Fix this issue by comparing the result of AND operation with the
correspinding Rx checksum flags.

Before this patch, packet trace prints the offload flags as below:

    Packet Offload Flags
      PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
      PKT_RX_IP_CKSUM_NONE (0x0090) no IP cksum of RX pkt.
      PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid
      PKT_RX_L4_CKSUM_NONE (0x0108) no L4 cksum of RX pkt.

After this patch, packet offload flags would be like:

    Packet Offload Flags
      PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
      PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid

Type: fix

[1] https://github.com/DPDK/dpdk/commit/5842289a546ceb0072bd7faccb93821e21848e07

Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I3182022d9ccd46b2fc55bb3edfbfac9062ed7c89
src/plugins/dpdk/device/format.c