From nobody Mon Oct 21 18:39:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XXPH716tJz5ZcYq; Mon, 21 Oct 2024 18:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXPH65yRcz4GQ3; Mon, 21 Oct 2024 18:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729535970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PuDOSCYhTY1SRLEvZ7besxbVTk1RzQnO6I7N6pg83So=; b=CKuJTAdVpW72POJJnfS53Atf3mWbB9D3E4caYvHayIFNIgYfQ9fQ5JuIKMcgrggZv6aAG/ 9a06ZRjv/+yAInQ/aaLwgFHSKPxST3ApMpiAd1sE4OHGtirmkESpnntRbY6S01rrWYCygu kDGZKfoUXABbuEfr1aP0JyH2R9K7pm/f0AWah2QZ1ppszXX54R1xD8DmTfO1TiEvVyFZ5j GLuPUvKs+Enax6YkDx1l9SSdrtr53Eo4u0fFpctoLWCpx/gErVD3J2b3SgRFEEA3w9qemm 4TLyRr1zGb8qFWXym2avWDA5SMIe1Y626bV5oY3rEWKgpwQv5HdDtUuY/OKrfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729535970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PuDOSCYhTY1SRLEvZ7besxbVTk1RzQnO6I7N6pg83So=; b=X0z08/P9X9bXfWoZVcL5yP9YwE4or23nFinJuZjs/Gb10vSJxUG5n97TtV8Eut+NTWoMo5 80xEjMfqsXPES0AesfjZ5sZz9dGe514MwQhFmTGBPzB/FJ3+tUDJjsHMxW1bStcV5BCGsE /efD3muqkqnrVrhN4OdoRL1TwiAiTNvff+oA10coD6JdIQaww78aq5AJOoyyLWHQmm/6eu bQ+nt7EyCg82SxMEoHq7+SP7KWnF51yLsalGDHyTkWf2Ov/gRxpnHVK/ndz6bOA826qc6e CVMWBVbXNTDyon3NDFm1wUAu9PBQ1KhuSMwwtFCrkwJVPcgchUIOl/4C2aK+9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729535970; a=rsa-sha256; cv=none; b=FD2Cys3FQHT+sEATw0OXNFsEDrQF7r7HOoMwFlPCoZ9XVPCCGilAXrXRCXhLLigj03GQER mkACE1EsL8eADX87/8rUEXHf8UTM1XxwiKJzJUHCrdM/ZaoA5BJR6OqMdyLKFAsbQA96Eq +M5gGsN4KajiFZEMJWdcIcdV9BumkXmx7K2FyMcCIZNzIUqKHKgGnaByvZo4J0Rnue+JRZ Dx6KDILMu6oQkr/NirelD9mavzE4LW9VvdL6HcYk5ulUjPSd1DvNK+10xYrFDH3doem8tq 9WfZ9fiOL98ys36GGhRrLgFU0xSH2t+2zAwWMMo+VvMgPJidsCdTgcZY6z81dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XXPH65ZlgzhQR; Mon, 21 Oct 2024 18:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49LIdUoo037153; Mon, 21 Oct 2024 18:39:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LIdUCM037149; Mon, 21 Oct 2024 18:39:30 GMT (envelope-from git) Date: Mon, 21 Oct 2024 18:39:30 GMT Message-Id: <202410211839.49LIdUCM037149@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 2c9c295f5e95 - stable/14 - cxgbe/t4_tom: completely avoid L2T entries during stop/suspend. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c9c295f5e9555a642de6e9473bf3571f593f4c4 Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=2c9c295f5e9555a642de6e9473bf3571f593f4c4 commit 2c9c295f5e9555a642de6e9473bf3571f593f4c4 Author: Navdeep Parhar AuthorDate: 2024-09-14 04:23:23 +0000 Commit: Navdeep Parhar 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)