[PATCH] if_lagg: Add INVARIANTS condition

Mark Johnston markj at freebsd.org
Thu Jun 6 16:26:15 UTC 2019


On Wed, Jun 05, 2019 at 01:41:10PM +0200, Sebastian Huber wrote:
> There is no need to call in_epoch() in case INVARIANTS is not defined.

I committed this in r348745.

> ---
>  sys/net/if_lagg.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
> index 1a4d1d302ec..3e1cb2043b0 100644
> --- a/sys/net/if_lagg.c
> +++ b/sys/net/if_lagg.c
> @@ -1955,12 +1955,14 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_port *lp)
>  	 * Search a port which reports an active link state.
>  	 */
>  
> +#ifdef INVARIANTS
>  	/*
>  	 * This is called with either LAGG_RLOCK() held or
>  	 * LAGG_XLOCK(sc) held.
>  	 */
>  	if (!in_epoch(net_epoch_preempt))
>  		LAGG_XLOCK_ASSERT(sc);
> +#endif
>  
>  	if (lp == NULL)
>  		goto search;
> -- 
> 2.16.4
> 
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"


More information about the freebsd-hackers mailing list