[PATCH] if_lagg: Add INVARIANTS condition

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jun 5 11:41:25 UTC 2019


There is no need to call in_epoch() in case INVARIANTS is not defined.
---
 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



More information about the freebsd-hackers mailing list