2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

dpif-netdev: Don't use zero flow mark.

Zero flow mark is used to indicate the HW to remove the mark. A packet
marked with zero mark is received in SW without a mark at all, so it
cannot be used as a valid mark. Change the pool range to fix it.

Fixes: 241bad15d9 ("dpif-netdev: associate flow with a mark id")
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Roni Bar Yanai <roniba@mellanox.com>
Acked-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Eli Britstein
2020-07-08 06:38:22 +00:00
committed by Ilya Maximets
parent 9ac365a8ed
commit 77057965cb
2 changed files with 15 additions and 11 deletions

View File

@@ -2252,7 +2252,11 @@ dp_netdev_pmd_find_dpcls(struct dp_netdev_pmd_thread *pmd,
}
#define MAX_FLOW_MARK (UINT32_MAX - 1)
#define INVALID_FLOW_MARK (UINT32_MAX)
#define INVALID_FLOW_MARK 0
/* Zero flow mark is used to indicate the HW to remove the mark. A packet
* marked with zero mark is received in SW without a mark at all, so it
* cannot be used as a valid mark.
*/
struct megaflow_to_mark_data {
const struct cmap_node node;
@@ -2278,7 +2282,7 @@ 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(1, MAX_FLOW_MARK);
}
if (id_pool_alloc_id(flow_mark.pool, &mark)) {