When there are offload errors we see error messages that only include
the netdev such as:

2026-03-19T19:42:43.103Z|03122|dpif_netlink(handler367)|ERR|failed to offload 
flow: Invalid argument: ovn-d2586f-0

This error message lacks the flow information in order to debug why the
flow failed to be offloaded. This then requires a user to go reproduce
the problem and turn on debug logging to try to correlate the error to a
flow.

Pass the provider error to log_flow_put_message() for flow put failures,
while keeping ENOSPC on the existing debug-only path. This makes the
offload layer emit the failed flow match/actions for cases like EINVAL,
so root-causing TC offload failures does not require enabling debug
logging.

Signed-off-by: Tim Rozet <[email protected]>
---
 lib/dpif-offload.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/dpif-offload.c b/lib/dpif-offload.c
index bb2feced9..290dee2c7 100644
--- a/lib/dpif-offload.c
+++ b/lib/dpif-offload.c
@@ -1279,8 +1279,14 @@ dpif_offload_operate(struct dpif *dpif, struct dpif_op 
**ops, size_t n_ops,
 
                     switch (op->type) {
                     case DPIF_OP_FLOW_PUT:
+                        /* Keep ENOSPC and unresolved sentinel values on the
+                         * existing debug-only path, but include full flow
+                         * details for real offload failures. */
                         log_flow_put_message(dpif, &this_module,
-                                             &op->flow_put, 0);
+                                             &op->flow_put,
+                                             op->error > 0
+                                             && op->error != ENOSPC
+                                             ? op->error : 0);
                         break;
                     case DPIF_OP_FLOW_DEL:
                         log_flow_del_message(dpif, &this_module,
-- 
2.53.0

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

Reply via email to