From 505f4e1db1c0c4cc934b1206be283e88d47af0fe Mon Sep 17 00:00:00 2001 From: Jieqiang Wang Date: Mon, 21 Aug 2023 15:58:10 +0800 Subject: 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 Change-Id: I3182022d9ccd46b2fc55bb3edfbfac9062ed7c89 --- src/plugins/dpdk/device/format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c index 11435343cc8..1fd609a68a5 100644 --- a/src/plugins/dpdk/device/format.c +++ b/src/plugins/dpdk/device/format.c @@ -706,7 +706,7 @@ format_dpdk_pkt_offload_flags (u8 * s, va_list * va) s = format (s, "Packet Offload Flags"); #define _(F, S) \ - if (*ol_flags & RTE_MBUF_F_##F) \ + if ((*ol_flags & RTE_MBUF_F_##F) == RTE_MBUF_F_##F) \ { \ s = format (s, "\n%U%s (0x%04x) %s", format_white_space, indent, \ "PKT_" #F, RTE_MBUF_F_##F, S); \ -- cgit 1.2.3-korg