The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=017902fc5f07114e7baba94bb4720c8b41ddea0f

commit 017902fc5f07114e7baba94bb4720c8b41ddea0f
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2021-03-22 16:59:09 +0000
Commit:     John Baldwin <j...@freebsd.org>
CommitDate: 2021-03-22 17:05:02 +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.
    
    Reviewed by:    np
    MFC after:      2 weeks
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D29301
---
 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);
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to