mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
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
This commit is contained in:
parent
6a6f2b0ce9
commit
70510800d1
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue