This change extends the debug logging with the sparse
dump of the flow mask structure to make debug process
easier.

Sample output:

  |netdev_offload_tc|DBG|offloading isn't supported, unknown attribute
  Unused mask bits:
  00000270  00 00 00 00 00 00 00 00-00 00 00 ff 00 00 00 00

In this example, 0x270 + 11 = 635, which is an offset of
the nsh.mdtype in the struct flow.

Suggested-by: Roi Dayan <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
---
 lib/netdev-offload-tc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 29d0e63eb..23fb57c52 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -1542,7 +1542,17 @@ test_key_and_mask(struct match *match)
     }
 
     if (!is_all_zeros(mask, sizeof *mask)) {
-        VLOG_DBG_RL(&rl, "offloading isn't supported, unknown attribute");
+        if (!VLOG_DROP_DBG(&rl)) {
+            struct ds ds = DS_EMPTY_INITIALIZER;
+
+            ds_put_cstr(&ds,
+                        "offloading isn't supported, unknown attribute\n"
+                        "Unused mask bits:\n");
+            ds_put_sparse_hex_dump(&ds, mask, sizeof *mask, 0, false);
+
+            VLOG_DBG("%s", ds_cstr(&ds));
+            ds_destroy(&ds);
+        }
         return EOPNOTSUPP;
     }
 
-- 
2.34.3

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

Reply via email to