Skip to content

Commit 1dc94dd

Browse files
crypticC0derigsilya
authored andcommitted
dpif: Maintain upcall_pid, mtu and hash.
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: 0d9dc8e ("dpif-netlink: Provide original upcall pid in 'execute' commands.") Fixes: 2713022 ("dpif-netlink: Allow MRU packet attribute.") Fixes: 0442bfb ("ofproto-dpif-upcall: Echo HASH attribute back to datapath.") Fixes: f9d3039 ("dpif: Fix use of uninitialized execute hash.") Signed-off-by: MJ Ponsonby <[email protected]> Signed-off-by: Ilya Maximets <[email protected]>
1 parent e5db1c6 commit 1dc94dd

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/dpif.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,9 +1160,9 @@ dpif_flow_dump_next(struct dpif_flow_dump_thread *thread,
11601160

11611161
struct dpif_execute_helper_aux {
11621162
struct dpif *dpif;
1163-
const struct flow *flow;
11641163
int error;
11651164
struct ofpbuf meter_actions;
1165+
struct dpif_execute orig_execute;
11661166
};
11671167

11681168
/* This is called for actions that need the context of the datapath to be
@@ -1196,7 +1196,7 @@ dpif_execute_helper_cb(void *aux_, struct dp_packet_batch *packets_,
11961196
case OVS_ACTION_ATTR_TUNNEL_POP:
11971197
case OVS_ACTION_ATTR_USERSPACE:
11981198
case OVS_ACTION_ATTR_RECIRC: {
1199-
struct dpif_execute execute;
1199+
struct dpif_execute execute = aux->orig_execute;
12001200
struct pkt_metadata *md = &packet->md;
12011201

12021202
if (flow_tnl_dst_is_set(&md->tunnel) || aux->meter_actions.size) {
@@ -1232,11 +1232,8 @@ dpif_execute_helper_cb(void *aux_, struct dp_packet_batch *packets_,
12321232
}
12331233

12341234
execute.packet = packet;
1235-
execute.flow = aux->flow;
12361235
execute.needs_help = false;
1237-
execute.probe = false;
1238-
execute.mtu = 0;
1239-
execute.hash = 0;
1236+
12401237
aux->error = dpif_execute(aux->dpif, &execute);
12411238
log_execute_message(aux->dpif, &this_module, &execute,
12421239
true, aux->error);
@@ -1284,8 +1281,8 @@ dpif_execute_with_help(struct dpif *dpif, struct dpif_execute *execute)
12841281
{
12851282
struct dpif_execute_helper_aux aux = {
12861283
.dpif = dpif,
1287-
.flow = execute->flow,
12881284
.error = 0,
1285+
.orig_execute = *execute,
12891286
};
12901287
struct dp_packet_batch pb;
12911288

0 commit comments

Comments
 (0)