git: 43f6f0848804 - main - cxgbe(4): Reword the comment explaining the atid/cookie split.

From: Navdeep Parhar <np_at_FreeBSD.org>
Date: Mon, 29 Apr 2024 20:49:02 UTC
The branch main has been updated by np:

URL: https://cgit.FreeBSD.org/src/commit/?id=43f6f08488046788b0ad66e9a5119f36e5de71ab

commit 43f6f08488046788b0ad66e9a5119f36e5de71ab
Author:     Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2023-04-01 23:07:36 +0000
Commit:     Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2024-04-29 20:40:40 +0000

    cxgbe(4): Reword the comment explaining the atid/cookie split.
    
    Avoid a magic constant while here.  No functional change intended.
    
    MFC after:      1 week
    Sponsored by:   Chelsio Communications
---
 sys/dev/cxgbe/offload.h | 6 +++---
 sys/dev/cxgbe/t4_main.c | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h
index 688c4b592180..a8b243b764c8 100644
--- a/sys/dev/cxgbe/offload.h
+++ b/sys/dev/cxgbe/offload.h
@@ -67,10 +67,10 @@ struct stid_region {
 };
 
 /*
- * Max # of ATIDs.  The absolute HW max is 14b (enough for 16K) but we reserve
- * the upper 3b for use as a cookie to demux the reply.
+ * Max # of ATIDs.  The absolute HW max is larger than this but we reserve a few
+ * of the upper bits for use as a cookie to demux the reply.
  */
-#define MAX_ATIDS 2048U
+#define MAX_ATIDS (M_TID_TID + 1)
 
 union aopen_entry {
 	void *data;
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 7bdce5faf7af..16b3ac7dd6ff 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -3905,6 +3905,9 @@ rw_via_memwin(struct adapter *sc, int idx, uint32_t addr, uint32_t *val,
 	return (0);
 }
 
+CTASSERT(M_TID_COOKIE == M_COOKIE);
+CTASSERT(MAX_ATIDS <= (M_TID_TID + 1));
+
 static void
 t4_init_atid_table(struct adapter *sc)
 {