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 previous dpif_execute struct
which we use to carry over various values such as the mtu, hash and
upcall_pid.

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 | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/lib/dpif.c b/lib/dpif.c
index 070fc0131..85ea1f552 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -1161,9 +1161,9 @@ dpif_flow_dump_next(struct dpif_flow_dump_thread *thread,
 
 struct dpif_execute_helper_aux {
     struct dpif *dpif;
-    const struct flow *flow;
     int error;
     struct ofpbuf meter_actions;
+    struct dpif_execute orig_execute;
 };
 
 /* This is called for actions that need the context of the datapath to be
@@ -1199,7 +1199,7 @@ dpif_execute_helper_cb(void *aux_, struct dp_packet_batch 
*packets_,
     case OVS_ACTION_ATTR_PSAMPLE:
     case OVS_ACTION_ATTR_SAMPLE:
     case OVS_ACTION_ATTR_RECIRC: {
-        struct dpif_execute execute;
+        struct dpif_execute execute = aux->orig_execute;
         struct pkt_metadata *md = &packet->md;
 
         if (flow_tnl_dst_is_set(&md->tunnel) || aux->meter_actions.size) {
@@ -1235,11 +1235,8 @@ dpif_execute_helper_cb(void *aux_, struct 
dp_packet_batch *packets_,
         }
 
         execute.packet = packet;
-        execute.flow = aux->flow;
         execute.needs_help = false;
-        execute.probe = false;
-        execute.mtu = 0;
-        execute.hash = 0;
+
         aux->error = dpif_execute(aux->dpif, &execute);
         log_execute_message(aux->dpif, &this_module, &execute,
                             true, aux->error);
@@ -1287,8 +1284,8 @@ dpif_execute_with_help(struct dpif *dpif, struct 
dpif_execute *execute)
 {
     struct dpif_execute_helper_aux aux = {
         .dpif = dpif,
-        .flow = execute->flow,
         .error = 0,
+        .orig_execute = *execute,
     };
     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