Once the datapath action list passed 64 kB,
xlate_resubmit_resource_check() refused every further resubmit. That
clamped the list below the limit, so the nl_attr_oversized() check at
the end of xlate_actions() never fired, and the flow was installed
rather than slow-pathed, silently missing whatever did not fit. The
comments on the check already suspected as much.
An OVN multicast flood to 800 remote ports reached 712 of them and
dropped the other 88, with nothing but a repeated log message to show
for it.
Let translation finish instead. The list then grows to its real size,
nl_attr_oversized() sees it, and the flow is slow-pathed and reaches
every destination. MAX_RESUBMITS and MAX_DEPTH still bound the work.
A flow that is also near the resubmit ceiling now fails translation
outright rather than delivering part of itself.
Fixes: 98b07853dfd6 ("ofproto-dpif-xlate: Limit memory and time that
translation can consume.")
Assisted-by: Claude Opus 5, Cursor
Signed-off-by: Han Zhou <[email protected]>
---
ofproto/ofproto-dpif-xlate.c | 4 ----
tests/ofproto-dpif.at | 11 ++++++-----
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 4e7d6fb401f7..90cb8f7690b9 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -4741,10 +4741,6 @@ xlate_resubmit_resource_check(struct xlate_ctx *ctx)
} else if (ctx->resubmits >= MAX_RESUBMITS) {
xlate_report_error(ctx, "over %d resubmit actions", MAX_RESUBMITS);
ctx->error = XLATE_TOO_MANY_RESUBMITS;
- } else if (ctx->odp_actions->size > UINT16_MAX) {
- xlate_report_error(ctx, "resubmits yielded over 64 kB of actions");
- /* NOT an error, as we'll be slow-pathing the flow in this case? */
- ctx->exit = true; /* XXX: translation still terminated! */
} else if (ctx->stack.size >= 65536) {
xlate_report_error(ctx, "resubmits yielded over 64 kB of stack");
ctx->error = XLATE_STACK_TOO_DEEP;
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 0d544dfdc02f..23ae77dc0e5f 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -11679,19 +11679,20 @@ AT_CLEANUP
AT_SETUP([ofproto-dpif - too many output actions])
OVS_VSWITCHD_START
add_of_ports br0 1
-(for i in `seq 1 12`; do
+dnl Nine levels of doubling reach the output limit while staying inside the
+dnl resubmit budget, so that this tests too_many_output_actions() and not
+dnl MAX_RESUBMITS.
+(for i in `seq 1 9`; do
j=`expr $i + 1`
echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
done
- echo "in_port=13, actions=local,local,local,local,local,local,local,local") >
flows
+ echo "in_port=10, actions=local,local,local,local,local,local,local,local") >
flows
AT_CHECK([ovs-ofctl add-flows br0 flows])
AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0],
[stdout])
AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
[0], [1
])
-AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' stdout], [0], [1
-])
-OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
+OVS_VSWITCHD_STOP
AT_CLEANUP
AT_SETUP([ofproto-dpif - stack too deep])
--
2.38.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev