t4_ddp.c (243857) | t4_ddp.c (248925) |
---|---|
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 243857 2012-12-04 09:32:43Z glebius $"); | 29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/tom/t4_ddp.c 248925 2013-03-30 02:26:20Z np $"); |
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> --- 315 unchanged lines hidden (view full) --- 353 /* 354 * We'll send a compound work request that has 3 SET_TCB_FIELDs and an 355 * RX_DATA_ACK (with RX_MODULATE to speed up delivery). 356 * 357 * The work request header is 16B and always ends at a 16B boundary. 358 * The ULPTX master commands that follow must all end at 16B boundaries 359 * too so we round up the size to 16. 360 */ | 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> --- 315 unchanged lines hidden (view full) --- 353 /* 354 * We'll send a compound work request that has 3 SET_TCB_FIELDs and an 355 * RX_DATA_ACK (with RX_MODULATE to speed up delivery). 356 * 357 * The work request header is 16B and always ends at a 16B boundary. 358 * The ULPTX master commands that follow must all end at 16B boundaries 359 * too so we round up the size to 16. 360 */ |
361 len = sizeof(*wrh) + 3 * roundup(LEN__SET_TCB_FIELD_ULP, 16) + 362 roundup(LEN__RX_DATA_ACK_ULP, 16); | 361 len = sizeof(*wrh) + 3 * roundup2(LEN__SET_TCB_FIELD_ULP, 16) + 362 roundup2(LEN__RX_DATA_ACK_ULP, 16); |
363 364 wr = alloc_wrqe(len, toep->ctrlq); 365 if (wr == NULL) 366 return (NULL); 367 wrh = wrtod(wr); 368 INIT_ULPTX_WRH(wrh, len, 1, 0); /* atomic */ 369 ulpmc = (struct ulp_txpkt *)(wrh + 1); 370 --- 379 unchanged lines hidden (view full) --- 750 751 ddp_pgsz = t4_ddp_pgsz[G_PPOD_PGSZ(db->tag)]; 752 ppod_addr = sc->vres.ddp.start + G_PPOD_TAG(db->tag) * PPOD_SIZE; 753 for (i = 0; i < db->nppods; ppod_addr += chunk) { 754 755 /* How many page pods are we writing in this cycle */ 756 n = min(db->nppods - i, NUM_ULP_TX_SC_IMM_PPODS); 757 chunk = PPOD_SZ(n); | 363 364 wr = alloc_wrqe(len, toep->ctrlq); 365 if (wr == NULL) 366 return (NULL); 367 wrh = wrtod(wr); 368 INIT_ULPTX_WRH(wrh, len, 1, 0); /* atomic */ 369 ulpmc = (struct ulp_txpkt *)(wrh + 1); 370 --- 379 unchanged lines hidden (view full) --- 750 751 ddp_pgsz = t4_ddp_pgsz[G_PPOD_PGSZ(db->tag)]; 752 ppod_addr = sc->vres.ddp.start + G_PPOD_TAG(db->tag) * PPOD_SIZE; 753 for (i = 0; i < db->nppods; ppod_addr += chunk) { 754 755 /* How many page pods are we writing in this cycle */ 756 n = min(db->nppods - i, NUM_ULP_TX_SC_IMM_PPODS); 757 chunk = PPOD_SZ(n); |
758 len = roundup(sizeof(*ulpmc) + sizeof(*ulpsc) + chunk, 16); | 758 len = roundup2(sizeof(*ulpmc) + sizeof(*ulpsc) + chunk, 16); |
759 760 wr = alloc_wrqe(len, toep->ctrlq); 761 if (wr == NULL) 762 return (ENOMEM); /* ok to just bail out */ 763 ulpmc = wrtod(wr); 764 765 INIT_ULPTX_WR(ulpmc, len, 0, 0); 766 ulpmc->cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | | 759 760 wr = alloc_wrqe(len, toep->ctrlq); 761 if (wr == NULL) 762 return (ENOMEM); /* ok to just bail out */ 763 ulpmc = wrtod(wr); 764 765 INIT_ULPTX_WR(ulpmc, len, 0, 0); 766 ulpmc->cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | |
767 F_ULP_MEMIO_ORDER); | 767 is_t4(sc) ? F_ULP_MEMIO_ORDER : F_T5_ULP_MEMIO_IMM); |
768 ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk / 32)); 769 ulpmc->len16 = htobe32(howmany(len - sizeof(ulpmc->wr), 16)); 770 ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(ppod_addr >> 5)); 771 772 ulpsc = (struct ulptx_idata *)(ulpmc + 1); 773 ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); 774 ulpsc->len = htobe32(chunk); 775 --- 494 unchanged lines hidden --- | 768 ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk / 32)); 769 ulpmc->len16 = htobe32(howmany(len - sizeof(ulpmc->wr), 16)); 770 ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(ppod_addr >> 5)); 771 772 ulpsc = (struct ulptx_idata *)(ulpmc + 1); 773 ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); 774 ulpsc->len = htobe32(chunk); 775 --- 494 unchanged lines hidden --- |