Date: Mon, 21 Oct 2024 18:39:30 GMT From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 2c9c295f5e95 - stable/14 - cxgbe/t4_tom: completely avoid L2T entries during stop/suspend. Message-ID: <202410211839.49LIdUCM037149@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=2c9c295f5e9555a642de6e9473bf3571f593f4c4 commit 2c9c295f5e9555a642de6e9473bf3571f593f4c4 Author: Navdeep Parhar <np@FreeBSD.org> AuthorDate: 2024-09-14 04:23:23 +0000 Commit: Navdeep Parhar <np@FreeBSD.org> CommitDate: 2024-10-21 17:14:04 +0000 cxgbe/t4_tom: completely avoid L2T entries during stop/suspend. 1. Mark the L2T entry valid only if t4_write_l2e succeeds, which won't happen if the adapter is stopped. This prevents L2T entries from sometimes getting (re)promoted to VALID on Tx activity during stop. 2. Discard a work request immediately instead of enqueueing it to the arp queue if the adapter is stopped. Fixes: c1c524852f62 cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM. Sponsored by: Chelsio Communications (cherry picked from commit 07f47e8850d0639d474026b203013072aeb32c81) --- sys/dev/cxgbe/tom/t4_tom_l2t.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tom_l2t.c b/sys/dev/cxgbe/tom/t4_tom_l2t.c index 749e5704863e..be42a887323f 100644 --- a/sys/dev/cxgbe/tom/t4_tom_l2t.c +++ b/sys/dev/cxgbe/tom/t4_tom_l2t.c @@ -212,20 +212,18 @@ update_entry(struct adapter *sc, struct l2t_entry *e, uint8_t *lladdr, e->state = L2T_STATE_STALE; - } else { - - if (e->state == L2T_STATE_RESOLVING || - e->state == L2T_STATE_FAILED || - memcmp(e->dmac, lladdr, ETHER_ADDR_LEN)) { + } else if (e->state == L2T_STATE_RESOLVING || + e->state == L2T_STATE_FAILED || + memcmp(e->dmac, lladdr, ETHER_ADDR_LEN)) { - /* unresolved -> resolved; or dmac changed */ + /* unresolved -> resolved; or dmac changed */ - memcpy(e->dmac, lladdr, ETHER_ADDR_LEN); - e->vlan = vtag; - t4_write_l2e(e, 1); - } + memcpy(e->dmac, lladdr, ETHER_ADDR_LEN); + e->vlan = vtag; + if (t4_write_l2e(e, 1) == 0) + e->state = L2T_STATE_VALID; + } else e->state = L2T_STATE_VALID; - } } static int @@ -291,7 +289,10 @@ again: mtx_unlock(&e->lock); goto again; } - arpq_enqueue(e, wr); + if (adapter_stopped(sc)) + free(wr, M_CXGBE); + else + arpq_enqueue(e, wr); mtx_unlock(&e->lock); if (resolve_entry(sc, e) == EWOULDBLOCK)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202410211839.49LIdUCM037149>