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

diff --git a/lib/dpif-offload.c b/lib/dpif-offload.c
index bb2feced9..79cc28d2c 100644
--- a/lib/dpif-offload.c
+++ b/lib/dpif-offload.c
@@ -1278,10 +1278,19 @@ dpif_offload_operate(struct dpif *dpif, struct dpif_op 
**ops, size_t n_ops,
                              dpif_offload_name(offload), op->error);
 
                     switch (op->type) {
-                    case DPIF_OP_FLOW_PUT:
+                    case DPIF_OP_FLOW_PUT: {
+                        int log_error = 0;
+
+                        /* Keep ENOSPC and unhandled operations on the
+                         * existing debug-only path, but include full flow
+                         * details for real offload failures. */
+                        if (op->error > 0 && op->error != ENOSPC) {
+                            log_error = op->error;
+                        }
                         log_flow_put_message(dpif, &this_module,
-                                             &op->flow_put, 0);
+                                             &op->flow_put, log_error);
                         break;
+                    }
                     case DPIF_OP_FLOW_DEL:
                         log_flow_del_message(dpif, &this_module,
                                              &op->flow_del, 0);
-- 
2.54.0

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

Reply via email to