summaryrefslogtreecommitdiff
path: root/lib/dpif-netdev.c
diff options
context:
space:
mode:
authorGaetan Rivet <grive@u256.net>2021-09-08 11:47:45 +0200
committerIlya Maximets <i.maximets@ovn.org>2022-01-19 01:35:19 +0100
commit54dcf60e6f7ee4a2a01581350b0b523aa470e1b7 (patch)
tree86ea0e9a1ab20ee9bfa376c2ea1400b88a7f2db6 /lib/dpif-netdev.c
parent7851e602c0909d8cfbbcbf9dca9b02159b9ba4fa (diff)
downloadopenvswitch-54dcf60e6f7ee4a2a01581350b0b523aa470e1b7.tar.gz
netdev-offload-dpdk: Lock rte_flow map access.
Add a lock to access the ufid to rte_flow map. This will protect it from concurrent write accesses when multiple threads attempt it. At this point, the reason for taking the lock is not to fullfill the needs of the DPDK offload implementation anymore. Rewrite the comments to reflect this change. The lock is still needed to protect against changes to netdev port mapping. Signed-off-by: Gaetan Rivet <grive@u256.net> Reviewed-by: Eli Britstein <elibr@nvidia.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib/dpif-netdev.c')
-rw-r--r--lib/dpif-netdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 7e93e9250..8eef3fda6 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -2557,7 +2557,7 @@ mark_to_flow_disassociate(struct dp_netdev_pmd_thread *pmd,
port = netdev_ports_get(in_port, dpif_type_str);
if (port) {
/* Taking a global 'port_mutex' to fulfill thread safety
- * restrictions for the netdev-offload-dpdk module. */
+ * restrictions regarding netdev port mapping. */
ovs_mutex_lock(&pmd->dp->port_mutex);
ret = netdev_flow_del(port, &flow->mega_ufid, NULL);
ovs_mutex_unlock(&pmd->dp->port_mutex);
@@ -2726,8 +2726,8 @@ dp_netdev_flow_offload_put(struct dp_offload_flow_item *offload)
goto err_free;
}
- /* Taking a global 'port_mutex' to fulfill thread safety restrictions for
- * the netdev-offload-dpdk module. */
+ /* Taking a global 'port_mutex' to fulfill thread safety
+ * restrictions regarding the netdev port mapping. */
ovs_mutex_lock(&pmd->dp->port_mutex);
ret = netdev_flow_put(port, &offload->match,
CONST_CAST(struct nlattr *, offload->actions),
@@ -3566,7 +3566,7 @@ dpif_netdev_get_flow_offload_status(const struct dp_netdev *dp,
}
ofpbuf_use_stack(&buf, &act_buf, sizeof act_buf);
/* Taking a global 'port_mutex' to fulfill thread safety
- * restrictions for the netdev-offload-dpdk module.
+ * restrictions regarding netdev port mapping.
*
* XXX: Main thread will try to pause/stop all revalidators during datapath
* reconfiguration via datapath purge callback (dp_purge_cb) while