Skip to content

Commit

Permalink
netdev-rte-offloads: Add thread-safety notes.
Browse files Browse the repository at this point in the history
DPDK_FLOW_OFFLOAD_API is not safe in a variety of ways.
This should be documented.

Signed-off-by: Ilya Maximets <[email protected]>
Acked-by: Roni Bar Yanai <[email protected]>
Signed-off-by: Ian Stokes <[email protected]>
  • Loading branch information
igsilya authored and istokes committed Mar 21, 2019
1 parent 1028cb7 commit 272ee84
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/netdev-rte-offloads.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 272ee84

Please sign in to comment.