On 3/21/2019 7:35 AM, Roni Bar Yanai wrote:
Looks good.

-----Original Message-----
From: Ilya Maximets <[email protected]>
Sent: Wednesday, March 20, 2019 1:15 PM
To: [email protected]; Ian Stokes <[email protected]>
Cc: Flavio Leitner <[email protected]>; Ophir Munk
<[email protected]>; Kevin Traynor <[email protected]>; Roni Bar
Yanai <[email protected]>; Finn Christensen <[email protected]>; Asaf
Penso <[email protected]>; Ilya Maximets <[email protected]>
Subject: [PATCH] netdev-rte-offloads: Add thread-safety notes.

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


Thanks Ilya, LGTM, pushed to master.

Ian
Signed-off-by: Ilya Maximets <[email protected]>
---

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


_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to