From nobody Mon Sep 16 19:00:14 2024 X-Original-To: dev-commits-src-main@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 4X6vPB4vFcz5WjP5; Mon, 16 Sep 2024 19:00:14 +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 4X6vPB3fdpz4k9D; Mon, 16 Sep 2024 19:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726513214; 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=1Ne9RYZMTBvQYyNVGd8/RFfjPfUTkZg5DZwgnumiLoc=; b=tOENNXbVPtoIER261YUa7CN8HQHz3N9/E65BdOkLT2V/jgIwfJ8DrnpTdkR4pjnyn+Rg9b J6rBmREynbkepBtG8PE6DLDmwTp32pffb8xwZTMAjYbatCS0NEbJF1/4d2c3KkW/MsLbkh GSCRVTU+VjYt3Ipd/jRjEqY1TdlWvsVcHFM925vyhByyrefTYVeTUwbaFOfyTfyu/sVGr/ 1LKaCj/WmIipsKFkfCY49u5EQ4X6Afky2jjaQSPM02CzWo4QBYd1CrM7YiUHFLF74KoWao 8TNm333YjOxt31wg+axykJqyG6ZtHa+wrrbZwomc9cCuyea3EpxQ3Mw6zckDHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726513214; a=rsa-sha256; cv=none; b=jxi2j4VltK20gtK6ukhkg3kkJinokBDBF8iBRRqkTQ2c7TqGORh0kaoF0lJIfoIV8STPus iBVw3W1+wy3/JKTl5fMqXAnucwRJF2DRdoHUdGAI9++MpuI0Qu1i5mKMFAzOhGIr8SQT/q Jgnq0j5xtmZoJzkXL10JNvjZCrK1kwWFcDaUhbASDlNIFY+Aa1+Fbz/hN65YS+WTOtJYBr NU4QvYzRr1Z+yxeb0kzMY6bkpbKll9GH7nAjUDhyh32VmEpbfJYFupP5JBNqllcfrM5QHA AR1KrcQkKO4dC2c+dAMM/f2lnNDoauatG/kSLdYaLoT0OJYIDtWwTfXbrrMzeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726513214; 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=1Ne9RYZMTBvQYyNVGd8/RFfjPfUTkZg5DZwgnumiLoc=; b=mV+9Gu3fVYNiUyj7D9m83G/FyoOoudm0Fecho5Ev59irZp4qMIZNZA4sMCWzR7Up9MfJVU agcfCxzhKOB+9UbQgwawCsB6vCClMg5qB7nxKtVo+qWayIpdFE3gG7AfpwhHBgeDylLMlx izREA4LvsJMQk9uOvXODGU3OwiqFrjDxtT4PvQ0+GPXMA6iSUxJYTjHKtzU9/sfz9dMROE mOIhJSvDBoF1mmiQ2D3UZQs9trsC9Puf78c7t+CWMFA9kf/4fwPgB8Cts1J05TLaAobwL9 3XRq0G1bMpyRo52EWIJ9+9NxpUSth8cZyW1wjyFgiAP4iW7ywcj7HTFc0h8sQw== 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 4X6vPB2kzrz15Yj; Mon, 16 Sep 2024 19:00:14 +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 48GJ0ECh022779; Mon, 16 Sep 2024 19:00:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GJ0Ewo022771; Mon, 16 Sep 2024 19:00:14 GMT (envelope-from git) Date: Mon, 16 Sep 2024 19:00:14 GMT Message-Id: <202409161900.48GJ0Ewo022771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 07f47e8850d0 - main - cxgbe/t4_tom: completely avoid L2T entries during stop/suspend. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 07f47e8850d0639d474026b203013072aeb32c81 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=07f47e8850d0639d474026b203013072aeb32c81 commit 07f47e8850d0639d474026b203013072aeb32c81 Author: Navdeep Parhar AuthorDate: 2024-09-14 04:23:23 +0000 Commit: Navdeep Parhar CommitDate: 2024-09-16 17:24:32 +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. MFC after: 1 week Sponsored by: Chelsio Communications --- 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)