odp-util: Accept fields with zero mask
authorHaggai Eran <haggaie@mellanox.com>
Thu, 14 Jan 2016 11:29:07 +0000 (13:29 +0200)
committerJesse Gross <jesse@kernel.org>
Tue, 19 Jan 2016 21:14:12 +0000 (13:14 -0800)
It is possible to pass some fields to the kernel with a zero mask, but
ovs-dpctl doesn't currently allow it. Change the code to allow it to
mimic what vswitchd is allowed to do.

Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Jesse Gross <jesse@kernel.org>
lib/odp-util.c

index f16e113..346064d 100644 (file)
@@ -3923,12 +3923,9 @@ geneve_to_attr(struct ofpbuf *a, const void *data_)
         SCAN_FIELD_NESTED__(NAME, TYPE, SCAN_AS, 0, FUNC)
 
 #define SCAN_PUT(ATTR, FUNC)                            \
-        if (!mask || !is_all_zeros(&smask, sizeof smask)) { \
-            SCAN_PUT_ATTR(key, ATTR, skey, FUNC);       \
-            if (mask) {                                 \
-                SCAN_PUT_ATTR(mask, ATTR, smask, FUNC); \
-            }                                           \
-        }
+        SCAN_PUT_ATTR(key, ATTR, skey, FUNC);           \
+        if (mask)                                       \
+            SCAN_PUT_ATTR(mask, ATTR, smask, FUNC);     \
 
 #define SCAN_END(ATTR)                                  \
         SCAN_FINISH();                                  \