git: 70510800d1ad - main - mlx5: Enter network epoch when using if_foreach()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 06 Mar 2023 16:24:13 UTC
The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=70510800d1ada1a92dc22bc74e57e9bb4fbaccc3 commit 70510800d1ada1a92dc22bc74e57e9bb4fbaccc3 Author: Justin Hibbits <jhibbits@FreeBSD.org> AuthorDate: 2023-02-21 19:43:53 +0000 Commit: Justin Hibbits <jhibbits@FreeBSD.org> CommitDate: 2023-03-06 16:04:15 +0000 mlx5: Enter network epoch when using if_foreach() Summary: IFNET_RLOCK() is not sufficient, the epoch needs entered. Reviewed by: hselasky Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38711 --- sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c index 629ecf3e5755..0b0a4b2019a0 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c @@ -3150,18 +3150,19 @@ mlx5_enable_roce_if_cb(if_t ifp, void *arg) static int mlx5_enable_roce(struct mlx5_ib_dev *dev) { + struct epoch_tracker et; VNET_ITERATOR_DECL(vnet_iter); int err; /* Check if mlx5en net device already exists */ VNET_LIST_RLOCK(); + NET_EPOCH_ENTER(et); VNET_FOREACH(vnet_iter) { - IFNET_RLOCK(); CURVNET_SET_QUIET(vnet_iter); if_foreach(mlx5_enable_roce_if_cb, dev); CURVNET_RESTORE(); - IFNET_RUNLOCK(); } + NET_EPOCH_EXIT(et); VNET_LIST_RUNLOCK(); dev->roce.nb.notifier_call = mlx5_netdev_event;