git: 43c72c45a185 - main - lacp: Remove racy kassert

From: Andrew Gallatin <gallatin_at_FreeBSD.org>
Date: Mon, 13 Jun 2022 15:35:38 UTC
The branch main has been updated by gallatin:

URL: https://cgit.FreeBSD.org/src/commit/?id=43c72c45a1856c6cdf25a22d259528d5a4040973

commit 43c72c45a1856c6cdf25a22d259528d5a4040973
Author:     Andrew Gallatin <gallatin@FreeBSD.org>
AuthorDate: 2022-06-13 15:32:10 +0000
Commit:     Andrew Gallatin <gallatin@FreeBSD.org>
CommitDate: 2022-06-13 15:32:10 +0000

    lacp: Remove racy kassert
    
    In lacp_select_tx_port_by_hash(), we assert that the selected port is
    DISTRIBUTING. However, the port state is protected by the LACP_LOCK(),
    which is not held around lacp_select_tx_port_by_hash().  So this
    assertion is racy, and can result in a spurious panic when links
    are flapping.
    
    It is certainly possible to fix it by acquiring LACP_LOCK(),
    but this seems like an early development assert, and it seems best
    to just remove it, rather than add complexity inside an ifdef
    INVARIANTS.
    
    Sponsored by: Netflix
    Reviewed by: hselasky
    Differential Revision: https://reviews.freebsd.org/D35396
---
 sys/net/ieee8023ad_lacp.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
index 6656ebb2b400..65b3a337eedc 100644
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -876,9 +876,6 @@ lacp_select_tx_port_by_hash(struct lagg_softc *sc, uint32_t hash,
 	hash %= count;
 	lp = map[hash];
 
-	KASSERT((lp->lp_state & LACP_STATE_DISTRIBUTING) != 0,
-	    ("aggregated port is not distributing"));
-
 	return (lp->lp_lagg);
 }