> On 24 Jan 2018, at 00:43, Martin Pieuchot <[email protected]> wrote:
>
> ifiq_destroy() is not called with the NET_LOCK() held, so there's no
> need to check for that.
>
> Simply put an assert.
ok.
>
> Index: net/ifq.c
> ===================================================================
> RCS file: /cvs/src/sys/net/ifq.c,v
> retrieving revision 1.21
> diff -u -p -r1.21 ifq.c
> --- net/ifq.c 4 Jan 2018 11:02:57 -0000 1.21
> +++ net/ifq.c 23 Jan 2018 14:41:24 -0000
> @@ -446,15 +446,8 @@ void
> ifiq_destroy(struct ifiqueue *ifiq)
> {
> if (!task_del(ifiq->ifiq_softnet, &ifiq->ifiq_task)) {
> - int netlocked = (rw_status(&netlock) == RW_WRITE);
> -
> - if (netlocked) /* XXXSMP breaks atomicity */
> - NET_UNLOCK();
> -
> + NET_ASSERT_UNLOCKED();
> taskq_barrier(ifiq->ifiq_softnet);
> -
> - if (netlocked)
> - NET_LOCK();
> }
>
> /* don't need to lock because this is the last use of the ifiq */
>