The commit in the fixes tag extended struct dpif_execute with an
upcall_pid member.

This member was left uninitialized in dpif_execute_helper_cb(),
leading to Open vSwitch providing the kernel with a PID for which
it does not have a listener, we fix this by extending the
execute_helper_aux struct to include the upcall_pid, which we then use
to save the original upcall_pid, which is then used to initialize that
value in dpif_execute_helper_cb.

This condition is caught by one of the existing system-traffic
tests which is extended to explicitly check for presence of lost
upcalls in the datapath, however only with linux kernel >= 6.17.0-5.5
and gcc < 15.

Fixes: 0d9dc8e9ca4a ("dpif-netlink: Provide original upcall pid in 'execute' 
commands.")

Signed-off-by: MJ Ponsonby <[email protected]>
---
 lib/dpif.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/dpif.c b/lib/dpif.c
index 070fc0131..cde0f32af 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -1164,6 +1164,7 @@ struct dpif_execute_helper_aux {
     const struct flow *flow;
     int error;
     struct ofpbuf meter_actions;
+    uint32_t upcall_pid;
 };
 
 /* This is called for actions that need the context of the datapath to be
@@ -1240,6 +1241,7 @@ dpif_execute_helper_cb(void *aux_, struct dp_packet_batch 
*packets_,
         execute.probe = false;
         execute.mtu = 0;
         execute.hash = 0;
+        execute.upcall_pid = aux->upcall_pid;
         aux->error = dpif_execute(aux->dpif, &execute);
         log_execute_message(aux->dpif, &this_module, &execute,
                             true, aux->error);
@@ -1289,6 +1291,7 @@ dpif_execute_with_help(struct dpif *dpif, struct 
dpif_execute *execute)
         .dpif = dpif,
         .flow = execute->flow,
         .error = 0,
+        .upcall_pid = execute->upcall_pid,
     };
     struct dp_packet_batch pb;
 
-- 
2.43.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to