From nobody Thu Feb 02 07:39:41 2023 X-Original-To: dev-commits-src-all@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 4P6rK93tLSz3c94m; Thu, 2 Feb 2023 07:39:41 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P6rK93BLPz3CZy; Thu, 2 Feb 2023 07:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675323581; 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=GR7wFQ7NQ5lsJz/crjd1M++4WSOFNg8fXr9gja3IxpU=; b=oncPkrQfCj0E/DqrPVAfwDstafWj8frlqUD6f+Rw2bWaF+HtDgB9Zq+FELfDpJ6LHMQU2f 2QskDjZkZ5Up2pYO0J4Hg0h1OKeSg23hsz1t+iEK+k1hfv3Gra42BVhpsx57rb1rcDn3RT 1ACCfVcGOmW5YJ7NnvlyHJ0PHPL23dTrhMY5EcYwMGSl88Mn9oqNIjiuWb8aRDdce1RLo7 lglOkD6HLWPdBhtyEA8/lkvBg6+cqZtfjUEt2tm4+5tpgY7vpD8phN6ZlLNO2UtdDoqFkY kQUk8NqD6e0+QS/Axfc6XUqQKfgi0cKkywRmRNFjg727EKWwX0GY+WhHS5LCNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675323581; 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=GR7wFQ7NQ5lsJz/crjd1M++4WSOFNg8fXr9gja3IxpU=; b=ahEAJpkqYZIoWlRePLnPmnyEIAoKRldIB8Plc9Gmk3TuaueOdreurgRPzGrt0t4HDqXPvW t8EjCWiA/8eooYtHuju0GD+NNcmiWdm/52cBNJB2OD8q97sZ4BA+uOqMFftc322q2RGvE2 XBn8cT+Y0e/yWAQulKePfY6yHg7uKRc1hvTv4CrhqVR0zj9u8mPueau0AGdrjlZHyIhi74 5Kp1LLUlwjhCKbCi+VuvL2FN4XbpvBB6cMGchIGu0LipY5K05nPT1fsagtePfalXnxWov8 VfdDpAqmLBzuQnbXjljvQ6ZFAYZT/WBKwW3m+J9Es6WTNFA2dXSJU+8+0mRJcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675323581; a=rsa-sha256; cv=none; b=jan7UhD6ZKFBZzFzJeefKsoDbcPZV3cVLFlXxU3Jwz3Qn5KH3hRUlO8+AALD8iYrnkTxqq /rpCyhm6joGhB4UqPPbtk+Yyqi06aaG+XqrWeWkqUYNY6M8OEEQjHuPBstofsUpIRktMfy VMun8StDjF29HovIvvPmeJ3Gb/MvFMiLg/st/KW5aHoZeftGDQnZ/AKPf0KXpsykeOs2f8 oJewK27lDn533qYVjuTRXGEJl+0NzOsz/EPv2rC+KUpifSYQMrOUz9f27DTVfwOW8IC8BF QoH3iG6mzg3r5SEnFynbnyIH5ichgPXgj/Rzrycl4ytYpBesu91FYmZmaZvtcA== 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 4P6rK92DbkzmXp; Thu, 2 Feb 2023 07:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3127dfl7062238; Thu, 2 Feb 2023 07:39:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3127df13062237; Thu, 2 Feb 2023 07:39:41 GMT (envelope-from git) Date: Thu, 2 Feb 2023 07:39:41 GMT Message-Id: <202302020739.3127df13062237@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: beb8eaf79368 - stable/13 - cxgbe/tom: Fix assertions in the code that maintains TCB history. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/13 X-Git-Reftype: branch X-Git-Commit: beb8eaf7936877fdabbd02ef28d42543860bf96f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=beb8eaf7936877fdabbd02ef28d42543860bf96f commit beb8eaf7936877fdabbd02ef28d42543860bf96f Author: Navdeep Parhar AuthorDate: 2022-09-29 02:56:14 +0000 Commit: Navdeep Parhar CommitDate: 2023-02-02 07:20:15 +0000 cxgbe/tom: Fix assertions in the code that maintains TCB history. The tids used for TOE connections start from tid_base, not 0. Sponsored by: Chelsio Communications (cherry picked from commit 8d2c13931b7e4897ca5d73af57f4cf35e440ec54) --- sys/dev/cxgbe/tom/t4_tom.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 8888265dd32a..25a63b992287 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -478,7 +478,8 @@ send_get_tcb(struct adapter *sc, u_int tid) struct cpl_get_tcb *cpl; struct wrq_cookie cookie; - MPASS(tid < sc->tids.ntids); + MPASS(tid >= sc->tids.tid_base); + MPASS(tid - sc->tids.tid_base < sc->tids.ntids); cpl = start_wrq_wr(&sc->sge.ctrlq[0], howmany(sizeof(*cpl), 16), &cookie); @@ -531,7 +532,8 @@ add_tid_to_history(struct adapter *sc, u_int tid) struct tom_data *td = sc->tom_softc; int rc; - MPASS(tid < sc->tids.ntids); + MPASS(tid >= sc->tids.tid_base); + MPASS(tid - sc->tids.tid_base < sc->tids.ntids); if (td->tcb_history == NULL) return (ENXIO); @@ -581,7 +583,8 @@ lookup_tcb_histent(struct adapter *sc, u_int tid, bool addrem) struct tcb_histent *te; struct tom_data *td = sc->tom_softc; - MPASS(tid < sc->tids.ntids); + MPASS(tid >= sc->tids.tid_base); + MPASS(tid - sc->tids.tid_base < sc->tids.ntids); if (td->tcb_history == NULL) return (NULL); @@ -773,7 +776,8 @@ read_tcb_using_memwin(struct adapter *sc, u_int tid, uint64_t *buf) uint32_t addr; u_char *tcb, tmp; - MPASS(tid < sc->tids.ntids); + MPASS(tid >= sc->tids.tid_base); + MPASS(tid - sc->tids.tid_base < sc->tids.ntids); addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE) + tid * TCB_SIZE; rc = read_via_memwin(sc, 2, addr, (uint32_t *)buf, TCB_SIZE);