git: bcd7b64748d8 - stable/13 - cxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED.
John Baldwin
jhb at FreeBSD.org
Mon Apr 26 19:03:57 UTC 2021
The branch stable/13 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=bcd7b64748d85d043ef5e4031b3f2f44f6186b4e
commit bcd7b64748d85d043ef5e4031b3f2f44f6186b4e
Author: John Baldwin <jhb at FreeBSD.org>
AuthorDate: 2021-03-22 16:59:09 +0000
Commit: John Baldwin <jhb at FreeBSD.org>
CommitDate: 2021-04-26 19:01:57 +0000
cxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED.
This avoids mixing the use of two different enums which modern C
compilers warn about.
Sponsored by: Chelsio Communications
(cherry picked from commit 017902fc5f07114e7baba94bb4720c8b41ddea0f)
---
sys/dev/cxgbe/tom/t4_ddp.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c
index a901efc11894..b0d53dd63997 100644
--- a/sys/dev/cxgbe/tom/t4_ddp.c
+++ b/sys/dev/cxgbe/tom/t4_ddp.c
@@ -609,12 +609,7 @@ handle_ddp_indicate(struct toepcb *toep)
ddp_queue_toep(toep);
}
-enum {
- DDP_BUF0_INVALIDATED = 0x2,
- DDP_BUF1_INVALIDATED
-};
-
-CTASSERT(DDP_BUF0_INVALIDATED == CPL_COOKIE_DDP0);
+CTASSERT(CPL_COOKIE_DDP0 + 1 == CPL_COOKIE_DDP1);
static int
do_ddp_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
@@ -635,12 +630,12 @@ do_ddp_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
toep = lookup_tid(sc, tid);
inp = toep->inp;
switch (cpl->cookie) {
- case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF0_INVALIDATED):
- case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF1_INVALIDATED):
+ case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(CPL_COOKIE_DDP0):
+ case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(CPL_COOKIE_DDP1):
/*
* XXX: This duplicates a lot of code with handle_ddp_data().
*/
- db_idx = G_COOKIE(cpl->cookie) - DDP_BUF0_INVALIDATED;
+ db_idx = G_COOKIE(cpl->cookie) - CPL_COOKIE_DDP0;
MPASS(db_idx < nitems(toep->ddp.db));
INP_WLOCK(inp);
DDP_LOCK(toep);
@@ -1845,7 +1840,7 @@ t4_aio_cancel_active(struct kaiocb *job)
V_TF_DDP_BUF1_VALID(1);
t4_set_tcb_field(sc, toep->ctrlq, toep,
W_TCB_RX_DDP_FLAGS, valid_flag, 0, 1,
- i + DDP_BUF0_INVALIDATED);
+ CPL_COOKIE_DDP0 + i);
toep->ddp.db[i].cancel_pending = 1;
CTR2(KTR_CXGBE, "%s: request %p marked pending",
__func__, job);
More information about the dev-commits-src-all
mailing list