2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-01 06:45:17 +00:00

dpif-netdev: Fix flow modification after failure.

dp_netdev_flow_offload_main thread is asynchronous, by the cited commit.
There might be a case where there are modification requests of the same
flow submitted before handled. Then, if the first handling fails, the
rule for the flow is deleted, and the mark is freed. Then, the following
one should not be handled as a modification, but rather as an "add".

Fixes: 02bb2824e5 ("dpif-netdev: do hw flow offload in a thread")
Signed-off-by: Eli Britstein <elibr@nvidia.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Eli Britstein
2021-07-26 11:14:53 +03:00
committed by Ilya Maximets
parent 8917010b05
commit 0d25621e4d

View File

@@ -2573,7 +2573,8 @@ dp_netdev_flow_offload_put(struct dp_flow_offload_item *offload)
struct dp_netdev_flow *flow = offload->flow;
odp_port_t in_port = flow->flow.in_port.odp_port;
const char *dpif_type_str = dpif_normalize_type(pmd->dp->class->type);
bool modification = offload->op == DP_NETDEV_FLOW_OFFLOAD_OP_MOD;
bool modification = offload->op == DP_NETDEV_FLOW_OFFLOAD_OP_MOD
&& flow->mark != INVALID_FLOW_MARK;
struct offload_info info;
struct netdev *port;
uint32_t mark;
@@ -2585,7 +2586,6 @@ dp_netdev_flow_offload_put(struct dp_flow_offload_item *offload)
if (modification) {
mark = flow->mark;
ovs_assert(mark != INVALID_FLOW_MARK);
} else {
/*
* If a mega flow has already been offloaded (from other PMD