[ovs-dev] [PATCH] netdev-rte-offloads: Add thread-safety notes.

Ilya Maximets i.maximets at samsung.com
Wed Mar 20 11:15:19 UTC 2019


DPDK_FLOW_OFFLOAD_API is not safe in a variety of ways.
This should be documented.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---

Wording/spelling suggestions are welcome.

 lib/netdev-rte-offloads.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/lib/netdev-rte-offloads.h b/lib/netdev-rte-offloads.h
index 3f7d15f45..18c8a7558 100644
--- a/lib/netdev-rte-offloads.h
+++ b/lib/netdev-rte-offloads.h
@@ -25,6 +25,23 @@ struct nlattr;
 struct offload_info;
 struct dpif_flow_stats;
 
+/* Thread-safety
+ * =============
+ *
+ * Below API is NOT thread safe in following terms:
+ *
+ *  - The caller must be sure that none of these functions will be called
+ *    simultaneously.  Even for different 'netdev's.
+ *
+ *  - The caller must be sure that 'netdev' will not be destructed/deallocated.
+ *
+ *  - The caller must be sure that 'netdev' configuration will not be changed.
+ *    For example, simultaneous call of 'netdev_reconfigure()' for the same
+ *    'netdev' is forbidden.
+ *
+ * For current implementation all above restrictions could be fulfilled by
+ * taking the datapath 'port_mutex' in lib/dpif-netdev.c.  */
+
 int netdev_rte_offloads_flow_put(struct netdev *netdev, struct match *match,
                                  struct nlattr *actions, size_t actions_len,
                                  const ovs_u128 *ufid,
-- 
2.17.1



More information about the dev mailing list