diff options
author | jhb <jhb@FreeBSD.org> | 2018-03-27 20:14:22 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2018-03-27 20:14:22 +0000 |
commit | 77f1a110c4743d633372805615ca6d1da813c872 (patch) | |
tree | e7c08890dffc0dd12a69cbf0d971372bdb07a5d8 /sys/dev/cxgbe/tom/t4_tom.c | |
parent | 199ef8f96a0caadc29a4bdf121b8a5c9efcde207 (diff) | |
download | FreeBSD-src-77f1a110c4743d633372805615ca6d1da813c872.zip FreeBSD-src-77f1a110c4743d633372805615ca6d1da813c872.tar.gz |
MFC 329785: Move DDP PCB state into a helper structure.
This consolidates all of the DDP state in one place. Also, the code has
now been fixed to ensure that DDP state is only accessed for DDP
connections. This should not be a functional change but makes it cleaner
and easier to add state for other TOE socket modes in the future.
Sponsored by: Chelsio Communications
Diffstat (limited to 'sys/dev/cxgbe/tom/t4_tom.c')
-rw-r--r-- | sys/dev/cxgbe/tom/t4_tom.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 837c80e..61d18cb 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -171,7 +171,6 @@ alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, int flags) toep->txsd_pidx = 0; toep->txsd_cidx = 0; aiotx_init_toep(toep); - ddp_init_toep(toep); return (toep); } @@ -196,7 +195,8 @@ free_toepcb(struct toepcb *toep) KASSERT(!(toep->flags & TPF_CPL_PENDING), ("%s: CPL pending", __func__)); - ddp_uninit_toep(toep); + if (toep->ulp_mode == ULP_MODE_TCPDDP) + ddp_uninit_toep(toep); free(toep, M_CXGBE); } @@ -301,7 +301,8 @@ release_offload_resources(struct toepcb *toep) MPASS(mbufq_len(&toep->ulp_pduq) == 0); MPASS(mbufq_len(&toep->ulp_pdu_reclaimq) == 0); #ifdef INVARIANTS - ddp_assert_empty(toep); + if (toep->ulp_mode == ULP_MODE_TCPDDP) + ddp_assert_empty(toep); #endif if (toep->l2te) @@ -617,7 +618,7 @@ set_tcpddp_ulp_mode(struct toepcb *toep) { toep->ulp_mode = ULP_MODE_TCPDDP; - toep->ddp_flags = DDP_OK; + ddp_init_toep(toep); } int |