diff mbox series

[ovs-dev] ofproto-dpif-upcall: Fix inverted tunnel key parsing check.

Message ID 20261103120638.3612816-1-salems@nvidia.com
State New
Headers show
Series [ovs-dev] ofproto-dpif-upcall: Fix inverted tunnel key parsing check. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_FreeBSD_Build_and_Test success github build: passed

Commit Message

Salem Sol Nov. 3, 2026, 12:06 p.m. UTC
The check added to process_upcall() for IPFIX and flow sample upcalls
returns EINVAL when odp_tun_key_from_attr() does not report
ODP_FIT_ERROR, i.e. when the output tunnel key was parsed successfully,
while a key that fails to parse is still used.

The output tunnel key is only provided by the kernel datapath, which
adds OVS_PACKET_ATTR_EGRESS_TUN_KEY to the upcall when the sampled
packet is sent to a tunnel port.  As a result, every IPFIX sample of a
packet sent to a tunnel port is dropped instead of being exported.
The existing IPFIX tunnel tests run on the dummy datapath, which never
provides this key, so they do not cover this path.

Only bail out when the tunnel key cannot be parsed.

Fixes: d1bd62dae553 ("ofproto-dpif-upcall: Check odp_tun_key_from_attr() return value.")
Signed-off-by: Salem Sol <salems@nvidia.com>
---
 ofproto/ofproto-dpif-upcall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index c877a0c24d..b7929d8c07 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1563,7 +1563,7 @@  process_upcall(struct udpif *udpif, struct upcall *upcall,
             if (upcall->out_tun_key) {
                 if (odp_tun_key_from_attr(upcall->out_tun_key,
                                           &output_tunnel_key,
-                                          NULL) != ODP_FIT_ERROR) {
+                                          NULL) == ODP_FIT_ERROR) {
                     return EINVAL;
                 }
             }