t4_ddp.c (275326) | t4_ddp.c (275329) |
---|---|
1/*- 2 * Copyright (c) 2012 Chelsio Communications, Inc. 3 * All rights reserved. 4 * Written by: Navdeep Parhar <np@FreeBSD.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Chelsio Communications, Inc. 3 * All rights reserved. 4 * Written by: Navdeep Parhar <np@FreeBSD.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/tom/t4_ddp.c 275326 2014-11-30 12:52:33Z glebius $"); | 29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/tom/t4_ddp.c 275329 2014-11-30 13:24:21Z glebius $"); |
30 31#include "opt_inet.h" 32 33#include <sys/param.h> 34#include <sys/types.h> 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#include <sys/ktr.h> --- 188 unchanged lines hidden (view full) --- 226 227 KASSERT(toep->sb_cc >= sbused(sb), 228 ("%s: sb %p has more data (%d) than last time (%d).", 229 __func__, sb, sbused(sb), toep->sb_cc)); 230 toep->rx_credits += toep->sb_cc - sbused(sb); 231#ifdef USE_DDP_RX_FLOW_CONTROL 232 toep->rx_credits -= n; /* adjust for F_RX_FC_DDP */ 233#endif | 30 31#include "opt_inet.h" 32 33#include <sys/param.h> 34#include <sys/types.h> 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#include <sys/ktr.h> --- 188 unchanged lines hidden (view full) --- 226 227 KASSERT(toep->sb_cc >= sbused(sb), 228 ("%s: sb %p has more data (%d) than last time (%d).", 229 __func__, sb, sbused(sb), toep->sb_cc)); 230 toep->rx_credits += toep->sb_cc - sbused(sb); 231#ifdef USE_DDP_RX_FLOW_CONTROL 232 toep->rx_credits -= n; /* adjust for F_RX_FC_DDP */ 233#endif |
234 sbappendstream_locked(sb, m); | 234 sbappendstream_locked(sb, m, 0); |
235 toep->sb_cc = sbused(sb); 236} 237 238/* SET_TCB_FIELD sent as a ULP command looks like this */ 239#define LEN__SET_TCB_FIELD_ULP (sizeof(struct ulp_txpkt) + \ 240 sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) 241 242/* RX_DATA_ACK sent as a ULP command looks like this */ --- 218 unchanged lines hidden (view full) --- 461 462 KASSERT(toep->sb_cc >= sbused(sb), 463 ("%s: sb %p has more data (%d) than last time (%d).", 464 __func__, sb, sbused(sb), toep->sb_cc)); 465 toep->rx_credits += toep->sb_cc - sbused(sb); 466#ifdef USE_DDP_RX_FLOW_CONTROL 467 toep->rx_credits -= len; /* adjust for F_RX_FC_DDP */ 468#endif | 235 toep->sb_cc = sbused(sb); 236} 237 238/* SET_TCB_FIELD sent as a ULP command looks like this */ 239#define LEN__SET_TCB_FIELD_ULP (sizeof(struct ulp_txpkt) + \ 240 sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) 241 242/* RX_DATA_ACK sent as a ULP command looks like this */ --- 218 unchanged lines hidden (view full) --- 461 462 KASSERT(toep->sb_cc >= sbused(sb), 463 ("%s: sb %p has more data (%d) than last time (%d).", 464 __func__, sb, sbused(sb), toep->sb_cc)); 465 toep->rx_credits += toep->sb_cc - sbused(sb); 466#ifdef USE_DDP_RX_FLOW_CONTROL 467 toep->rx_credits -= len; /* adjust for F_RX_FC_DDP */ 468#endif |
469 sbappendstream_locked(sb, m); | 469 sbappendstream_locked(sb, m, 0); |
470 toep->sb_cc = sbused(sb); 471wakeup: 472 KASSERT(toep->ddp_flags & db_flag, 473 ("%s: DDP buffer not active. toep %p, ddp_flags 0x%x, report 0x%x", 474 __func__, toep, toep->ddp_flags, report)); 475 toep->ddp_flags &= ~db_flag; 476 sorwakeup_locked(so); 477 SOCKBUF_UNLOCK_ASSERT(sb); --- 820 unchanged lines hidden --- | 470 toep->sb_cc = sbused(sb); 471wakeup: 472 KASSERT(toep->ddp_flags & db_flag, 473 ("%s: DDP buffer not active. toep %p, ddp_flags 0x%x, report 0x%x", 474 __func__, toep, toep->ddp_flags, report)); 475 toep->ddp_flags &= ~db_flag; 476 sorwakeup_locked(so); 477 SOCKBUF_UNLOCK_ASSERT(sb); --- 820 unchanged lines hidden --- |