On 4/12/21 5:20 PM, Gaetan Rivet wrote:
> The port mutex protects the netdev mapping, that can be changed by port
> addition or port deletion. HW offloads operations can be considered read
> operations on the port mapping itself. Use a rwlock to differentiate
> between read and write operations, allowing concurrent queries and
> offload insertions.
>
> Because offload queries, deletion, and reconfigure_datapath() calls are
> all rdlock, the deadlock fixed by [1] is still avoided, as the rdlock
> side is recursive as prescribed by the POSIX standard. Executing
> 'reconfigure_datapath()' only requires a rdlock taken, but it is sometimes
> executed in contexts where wrlock is taken ('do_add_port()' and
> 'do_del_port()').
>
> This means that the deadlock described in [2] is still valid and should
> be mitigated. The rdlock is taken using 'tryrdlock()' during offload query,
> keeping the current behavior.
>
> [1]: 81e89d5c2645 ("dpif-netdev: Make datapath port mutex recursive.")
>
> [2]: 12d0edd75eba ("dpif-netdev: Avoid deadlock with offloading during PMD
> thread deletion.").
>
> Signed-off-by: Gaetan Rivet <[email protected]>
> Reviewed-by: Eli Britstein <[email protected]>
> ---
> lib/dpif-netdev.c | 139 +++++++++++++++++++-------------------
> lib/netdev-offload-dpdk.c | 4 +-
> 2 files changed, 72 insertions(+), 71 deletions(-)
>
Reviewed-by: Maxime Coquelin <[email protected]>
Thanks,
Maxime
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev
- Re: [ovs-dev] [PATCH v2 22/28] netdev-offload-dpdk: L... Maxime Coquelin
- [ovs-dev] [PATCH v2 25/28] dpif-netdev: Make megaflow and ... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 25/28] dpif-netdev: Make mega... Maxime Coquelin
- [ovs-dev] [PATCH v2 11/28] llring: Add lockless MPMC bound... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 11/28] llring: Add lockless M... Maxime Coquelin
- [ovs-dev] [PATCH v2 16/28] dpif-netdev: Use seq-pool for m... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 16/28] dpif-netdev: Use seq-p... Maxime Coquelin
- [ovs-dev] [PATCH v2 10/28] mpsc-queue: Module for lock-fre... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 10/28] mpsc-queue: Module for... Maxime Coquelin
- [ovs-dev] [PATCH v2 26/28] dpif-netdev: Replace port mutex... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 26/28] dpif-netdev: Replace p... Maxime Coquelin
- [ovs-dev] [PATCH v2 18/28] tests: Add ovs-barrier unit tes... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 18/28] tests: Add ovs-barrier... Maxime Coquelin
- [ovs-dev] [PATCH v2 28/28] netdev-dpdk: Remove rte-flow AP... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 28/28] netdev-dpdk: Remove rt... Maxime Coquelin
- [ovs-dev] [PATCH v2 27/28] dpif-netdev: Use one or more of... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 27/28] dpif-netdev: Use one o... Maxime Coquelin
- [ovs-dev] [PATCH v2 19/28] ovs-thread: Fix barrier use-aft... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 19/28] ovs-thread: Fix barrie... Maxime Coquelin
- [ovs-dev] [PATCH v2 12/28] seq-pool: Module for faster ID ... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 12/28] seq-pool: Module for f... Maxime Coquelin
