Deleted Added
full compact
t4_listen.c (245937) t4_listen.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_listen.c 245937 2013-01-26 03:23:28Z np $");
29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/tom/t4_listen.c 248925 2013-03-30 02:26:20Z np $");
30
31#include "opt_inet.h"
32#include "opt_inet6.h"
33
34#ifdef TCP_OFFLOAD
35#include <sys/param.h>
36#include <sys/types.h>
37#include <sys/kernel.h>

--- 317 unchanged lines hidden (view full) ---

355
356 get_qids_from_mbuf(m, &txqid, &rxqid);
357 ofld_txq = &sc->sge.ofld_txq[txqid];
358 ofld_rxq = &sc->sge.ofld_rxq[rxqid];
359
360 /* The wrqe will have two WRs - a flowc followed by an abort_req */
361 flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval);
362
30
31#include "opt_inet.h"
32#include "opt_inet6.h"
33
34#ifdef TCP_OFFLOAD
35#include <sys/param.h>
36#include <sys/types.h>
37#include <sys/kernel.h>

--- 317 unchanged lines hidden (view full) ---

355
356 get_qids_from_mbuf(m, &txqid, &rxqid);
357 ofld_txq = &sc->sge.ofld_txq[txqid];
358 ofld_rxq = &sc->sge.ofld_rxq[rxqid];
359
360 /* The wrqe will have two WRs - a flowc followed by an abort_req */
361 flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval);
362
363 wr = alloc_wrqe(roundup(flowclen, EQ_ESIZE) + sizeof(*req), ofld_txq);
363 wr = alloc_wrqe(roundup2(flowclen, EQ_ESIZE) + sizeof(*req), ofld_txq);
364 if (wr == NULL) {
365 /* XXX */
366 panic("%s: allocation failure.", __func__);
367 }
368 flowc = wrtod(wr);
364 if (wr == NULL) {
365 /* XXX */
366 panic("%s: allocation failure.", __func__);
367 }
368 flowc = wrtod(wr);
369 req = (void *)((caddr_t)flowc + roundup(flowclen, EQ_ESIZE));
369 req = (void *)((caddr_t)flowc + roundup2(flowclen, EQ_ESIZE));
370
371 /* First the flowc ... */
372 memset(flowc, 0, wr->wr_len);
373 flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) |
374 V_FW_FLOWC_WR_NPARAMS(nparams));
375 flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) |
376 V_FW_WR_FLOWID(synqe->tid));
377 flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN;

--- 561 unchanged lines hidden (view full) ---

939
940/*
941 * Use the trailing space in the mbuf in which the PASS_ACCEPT_REQ arrived to
942 * store some state temporarily.
943 */
944static struct synq_entry *
945mbuf_to_synqe(struct mbuf *m)
946{
370
371 /* First the flowc ... */
372 memset(flowc, 0, wr->wr_len);
373 flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) |
374 V_FW_FLOWC_WR_NPARAMS(nparams));
375 flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) |
376 V_FW_WR_FLOWID(synqe->tid));
377 flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN;

--- 561 unchanged lines hidden (view full) ---

939
940/*
941 * Use the trailing space in the mbuf in which the PASS_ACCEPT_REQ arrived to
942 * store some state temporarily.
943 */
944static struct synq_entry *
945mbuf_to_synqe(struct mbuf *m)
946{
947 int len = roundup(sizeof (struct synq_entry), 8);
947 int len = roundup2(sizeof (struct synq_entry), 8);
948 int tspace = M_TRAILINGSPACE(m);
949 struct synq_entry *synqe = NULL;
950
951 if (tspace < len) {
952 synqe = malloc(sizeof(*synqe), M_CXGBE, M_NOWAIT);
953 if (synqe == NULL)
954 return (NULL);
955 synqe->flags = TPF_SYNQE | TPF_SYNQE_NEEDFREE;

--- 45 unchanged lines hidden (view full) ---

1001 if (tcpopt->wsf > 0)
1002 opt2 |= F_WND_SCALE_EN;
1003 }
1004
1005 if (V_tcp_do_ecn && th->th_flags & (TH_ECE | TH_CWR))
1006 opt2 |= F_CCTRL_ECN;
1007
1008 opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]);
948 int tspace = M_TRAILINGSPACE(m);
949 struct synq_entry *synqe = NULL;
950
951 if (tspace < len) {
952 synqe = malloc(sizeof(*synqe), M_CXGBE, M_NOWAIT);
953 if (synqe == NULL)
954 return (NULL);
955 synqe->flags = TPF_SYNQE | TPF_SYNQE_NEEDFREE;

--- 45 unchanged lines hidden (view full) ---

1001 if (tcpopt->wsf > 0)
1002 opt2 |= F_WND_SCALE_EN;
1003 }
1004
1005 if (V_tcp_do_ecn && th->th_flags & (TH_ECE | TH_CWR))
1006 opt2 |= F_CCTRL_ECN;
1007
1008 opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]);
1009 opt2 |= F_RX_COALESCE_VALID | V_RX_COALESCE(M_RX_COALESCE);
1010 opt2 |= F_RSS_QUEUE_VALID | V_RSS_QUEUE(ofld_rxq->iq.abs_id);
1009 opt2 |= F_RSS_QUEUE_VALID | V_RSS_QUEUE(ofld_rxq->iq.abs_id);
1010 if (is_t4(sc))
1011 opt2 |= F_RX_COALESCE_VALID | V_RX_COALESCE(M_RX_COALESCE);
1012 else
1013 opt2 |= F_T5_OPT_2_VALID | V_RX_COALESCE(M_RX_COALESCE);
1011
1012#ifdef USE_DDP_RX_FLOW_CONTROL
1013 if (ulp_mode == ULP_MODE_TCPDDP)
1014 opt2 |= F_RX_FC_VALID | F_RX_FC_DDP;
1015#endif
1016
1017 return htobe32(opt2);
1018}

--- 580 unchanged lines hidden ---
1014
1015#ifdef USE_DDP_RX_FLOW_CONTROL
1016 if (ulp_mode == ULP_MODE_TCPDDP)
1017 opt2 |= F_RX_FC_VALID | F_RX_FC_DDP;
1018#endif
1019
1020 return htobe32(opt2);
1021}

--- 580 unchanged lines hidden ---