diff options
author | Eli Britstein <elibr@nvidia.com> | 2021-07-26 11:14:53 +0300 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2021-08-02 19:17:17 +0200 |
commit | 350507b1633ee8fa50f42bcd7f26881cf995cb2e (patch) | |
tree | 61190931cd7bb97bbf9e83193626ebe4f5bf2877 | |
parent | f92ce92e53eb2e559f2e7aae08b4a51386d22d32 (diff) | |
download | openvswitch-350507b1633ee8fa50f42bcd7f26881cf995cb2e.tar.gz |
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: 02bb2824e51d ("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>
-rw-r--r-- | lib/dpif-netdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 9e0ba4fc4..d695f4d61 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -2423,7 +2423,8 @@ dp_netdev_flow_offload_put(struct dp_flow_offload_item *offload) const struct dpif_class *dpif_class = pmd->dp->class; struct dp_netdev_flow *flow = offload->flow; odp_port_t in_port = flow->flow.in_port.odp_port; - 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; @@ -2435,7 +2436,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 |