Skip to content

Commit 285eeb3

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 7dc1b3c commit 285eeb3

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
@@ -1161,9 +1161,9 @@ dpif_flow_dump_next(struct dpif_flow_dump_thread *thread,
11611161

11621162
struct dpif_execute_helper_aux {
11631163
struct dpif *dpif;
1164-
const struct flow *flow;
11651164
int error;
11661165
struct ofpbuf meter_actions;
1166+
struct dpif_execute orig_execute;
11671167
};
11681168

11691169
/* 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_,
11991199
case OVS_ACTION_ATTR_PSAMPLE:
12001200
case OVS_ACTION_ATTR_SAMPLE:
12011201
case OVS_ACTION_ATTR_RECIRC: {
1202-
struct dpif_execute execute;
1202+
struct dpif_execute execute = aux->orig_execute;
12031203
struct pkt_metadata *md = &packet->md;
12041204

12051205
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_,
12351235
}
12361236

12371237
execute.packet = packet;
1238-
execute.flow = aux->flow;
12391238
execute.needs_help = false;
1240-
execute.probe = false;
1241-
execute.mtu = 0;
1242-
execute.hash = 0;
1239+
12431240
aux->error = dpif_execute(aux->dpif, &execute);
12441241
log_execute_message(aux->dpif, &this_module, &execute,
12451242
true, aux->error);
@@ -1287,8 +1284,8 @@ dpif_execute_with_help(struct dpif *dpif, struct dpif_execute *execute)
12871284
{
12881285
struct dpif_execute_helper_aux aux = {
12891286
.dpif = dpif,
1290-
.flow = execute->flow,
12911287
.error = 0,
1288+
.orig_execute = *execute,
12921289
};
12931290
struct dp_packet_batch pb;
12941291

0 commit comments

Comments
 (0)