From: Roni Bar Yanai <ron...@mellanox.com> Reserve the first 64 intergers (0-63) for special processing. For example, if a packet can't complete its procssesing in hardware, we will make sure that the packet is marked with a special mark to continue its processing in software.
Co-authored-by: Asaf Penso <as...@mellanox.com> Signed-off-by: Asaf Penso <as...@mellanox.com> Co-authored-by: Ophir Munk <ophi...@mellanox.com> Signed-off-by: Ophir Munk <ophi...@mellanox.com> Signed-off-by: Roni Bar Yanai <ron...@mellanox.com> --- lib/dpif-netdev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 9a48038..ea0ace7 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -2096,8 +2096,11 @@ dp_netdev_pmd_find_dpcls(struct dp_netdev_pmd_thread *pmd, return cls; } -#define MAX_FLOW_MARK (UINT32_MAX - 1) -#define INVALID_FLOW_MARK (UINT32_MAX) +#define INVALID_FLOW_MARK (UINT32_MAX) +#define MAX_FLOW_MARK (UINT32_MAX - 1) +#define RESERVED_FLOW_MARK_SIZE (64) +#define MIN_FLOW_MARK RESERVED_FLOW_MARK_SIZE +#define AVAILABLE_FLOW_MARK_SIZE (MAX_FLOW_MARK - MIN_FLOW_MARK + 1) struct megaflow_to_mark_data { const struct cmap_node node; @@ -2123,7 +2126,8 @@ flow_mark_alloc(void) if (!flow_mark.pool) { /* Haven't initiated yet, do it here */ - flow_mark.pool = id_pool_create(0, MAX_FLOW_MARK); + flow_mark.pool = id_pool_create(MIN_FLOW_MARK, + AVAILABLE_FLOW_MARK_SIZE); } if (id_pool_alloc_id(flow_mark.pool, &mark)) { -- 1.8.3.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev