[ovs-dev] [PATCH RESEND ovs-dev v1 2/2] dpif-netdev: Return error code when no mark available.

xiangxia.m.yue at gmail.com xiangxia.m.yue at gmail.com
Tue Jun 9 00:53:41 UTC 2020


From: Tonghao Zhang <xiangxia.m.yue at gmail.com>

The max number of mark is (UINT32_MAX - 1), that is
enough to be used. But theoretically, if there are no
mark available, the later different flows will shared
the mark INVALID_FLOW_MARK, that may break the function.
If there are no available mark to be used, return error
code.

Cc: Yuanhan Liu <yliu at fridaylinux.org>
Cc: Ian Stokes <ian.stokes at intel.com>
Cc: Ben Pfaff <blp at ovn.org>
Cc: William Tu <u9012063 at gmail.com>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
---
 lib/dpif-netdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index e9d2e1267335..401294744044 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -2441,6 +2441,7 @@ dp_netdev_flow_offload_put(struct dp_flow_offload_item *offload)
         mark = flow_mark_alloc();
         if (mark == INVALID_FLOW_MARK) {
             VLOG_ERR("Failed to allocate flow mark!\n");
+            return -1;
         }
     }
     info.flow_mark = mark;
-- 
2.26.1



More information about the dev mailing list