From nobody Thu Sep 29 05:47:26 2022 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 4MdMnp4bm7z4dTy1; Thu, 29 Sep 2022 05:47:26 +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 4MdMnp45Jyz3v4G; Thu, 29 Sep 2022 05:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664430446; 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=h/EuDuvna5soud0m8nszbtUUl2ljrsqYMI7erxu+TSE=; b=pmON6MSB9PVF4/cbiCmwkIMGjZpHP0EBBzqcsxlwwedqGXG/P03u2llcBMHUvYujvnpdhR jSub9ZrlIeQrfl1yXou2mJYlJ2EISvhQ8cTRKHRbU0nodJukd1BoZpJnRpJuKzGPhY1F5N KxBhzjR0JLhhQWmjIsM8ZeMFrPiJzv+kvdYglgZHJPKeGp8qwNlE44dCp1T9EWY5c+T6mb YQ22jayDtNfEwgsnTGYy2c03B4ody0SU9FPiOyZrWhi38nbsBw9p5kSpIcI3epLD7giYRD cMBCGHJ2uJ8glmDam3pb3WQ0mhcpIhTqenWFD7LYBPXp5ZZH3sAHwL1rUP3ggw== 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 4MdMnp36X3zjsw; Thu, 29 Sep 2022 05:47:26 +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 28T5lQPm082752; Thu, 29 Sep 2022 05:47:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28T5lQmM082751; Thu, 29 Sep 2022 05:47:26 GMT (envelope-from git) Date: Thu, 29 Sep 2022 05:47:26 GMT Message-Id: <202209290547.28T5lQmM082751@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: 8d2c13931b7e - main - cxgbe/tom: Fix assertions in the code that maintains TCB history. 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 8d2c13931b7e4897ca5d73af57f4cf35e440ec54 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664430446; 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=h/EuDuvna5soud0m8nszbtUUl2ljrsqYMI7erxu+TSE=; b=gOMBeBcX2N8wKiCnPOp13pF2YlfSTDlHVam8XxcUuo6kj02H+2kXcO04Mn3gXMgHp1nNVx cndWNkfS0lxj7DXmHtMB4aSDr/lsEL7Xyt7GbU99JXUfZl0p5MdiTbxKHUkZ6wgxN9r1fa uN1eGf0plmq+kNnlBAokrSLF1GBk2dQ7LzLClEX8zSfqh6rQtkEXvjSH+dZrSK84gOQe+j 3x3WXqCAepSTrCUL7FxZWL5s/B51cCIlgYLgoNThDczKBB0ifeSa1Xl9/wdskjJFJcP+Kd KGQ1/MT14ZWBz4VmFCBrCDHrvpexJxzvrvP/ivyOYlsPzN2GxEj3Cq6ZyzDGow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664430446; a=rsa-sha256; cv=none; b=sK0yUj+Lyi2Gpsqf0L/Je8T4otj8yUwXWL3jazeo25QKIaDHslBo4PlrTxLVvOAvrRhwBF Hpadk+m/siJE+paffOZX0LPWU/NtCY4orTtuZaa4Zm6vfHQ7mwtsRkVQNNXHdwUxjW1HgC ncyfdRvskpTPYgNgAuL31Dj6FLZcOjnafXJJV4Sje1LW4j14fUs5gbdbq/OtP3JVtgNpmj 4AC4OYjXLWrzv560XQaNOtOUaIeI0/rB9/DP8cscIGXOxhpWYvMi21q+JIDUcVKe+muNOr 6JMJMp0wafFwV9dIye2A8re9Gh5ZVrrkclgFeKv9qaL4ElF4gm9QNNax/ElYJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=8d2c13931b7e4897ca5d73af57f4cf35e440ec54 commit 8d2c13931b7e4897ca5d73af57f4cf35e440ec54 Author: Navdeep Parhar AuthorDate: 2022-09-29 02:56:14 +0000 Commit: Navdeep Parhar CommitDate: 2022-09-29 03:01:14 +0000 cxgbe/tom: Fix assertions in the code that maintains TCB history. The tids used for TOE connections start from tid_base, not 0. MFC after: 1 week Sponsored by: Chelsio Communications --- 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 825a4e96ce81..dd214e91f0b3 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -474,7 +474,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); @@ -527,7 +528,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); @@ -577,7 +579,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); @@ -769,7 +772,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);