summaryrefslogtreecommitdiffstats
path: root/sys/dev/cxgbe/tom/t4_connect.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2016-12-05 20:43:25 +0000
committerjhb <jhb@FreeBSD.org>2016-12-05 20:43:25 +0000
commit14b8e70534d9788f03d27c16ff5957513ea67edc (patch)
treee4c4064dca3e307af30217c487806cabed81cdc7 /sys/dev/cxgbe/tom/t4_connect.c
parent2d64e2dd58e247189656af25ac3b78211bd989f9 (diff)
downloadFreeBSD-src-14b8e70534d9788f03d27c16ff5957513ea67edc.zip
FreeBSD-src-14b8e70534d9788f03d27c16ff5957513ea67edc.tar.gz
MFC 305695,305696,305699,305702,305703,305713,305715,305827,305852,305906,
305908,306062,306063,306137,306138,306206,306216,306273,306295,306301, 306465,309302: Add support for adapters using the Terminator T6 ASIC. 305695: cxgbe(4): Set up fl_starve_threshold2 accurately for T6. 305696: cxgbe(4): Use correct macro for header length with T6 ASICs. This affects the transmit of the VF driver only. 305699: cxgbe(4): Update the pad_boundary calculation for T6, which has a different range of boundaries. 305702: cxgbe(4): Use smaller min/max bursts for fl descriptors with a T6. 305703: cxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6. 305713: cxgbe(4): Add support for additional port types and link speeds. 305715: cxgbe(4): Catch up with the rename of tlscaps -> cryptocaps. TLS is one of the capabilities of the crypto engine in T6. 305827: cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields to use in tx work requests. 305852: cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will come up as 't6nex' nexus devices with 'cc' ports hanging off them. The T6 firmware and configuration files will be added as soon as they are released. For now the driver will try to work with whatever firmware and configuration is on the card's flash. 305906: cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6. 305908: cxgbe/t4_tom: Update the active/passive open code to support T6. Data path works as-is. 306062: cxgbe(4): Show wcwr_stats for T6 cards. 306063: cxgbe(4): Setup congestion response for T6 rx queues. 306137: cxgbetool: Add T6 support to the SGE context decoder. 306138: Fix typo. 306206: cxgbe(4): Catch up with the different layout of WHOAMI in T6. Note that the code moved below t4_prep_adapter() as part of this change because now it needs a working chip_id(). 306216: cxgbe(4): Fix the output of the "tids" sysctl on T6. 306273: cxgbe(4): Fix netmap with T6, which doesn't encapsulate SGE_EGR_UPDATE message inside a FW_MSG. The base NIC already deals with updates in either form. 306295: cxgbe(4): Support SIOGIFXMEDIA so that ifconfig displays correct media for 25Gbps and 100Gbps ports. This should have been part of r305713, which is when the driver first started reporting extended media types. 306301: cxgbe(4): Use the port's top speed to figure out whether it is "high speed" or not (for the purpose of calculating the number of queues etc.) This does the right thing for 25Gbps and 100Gbps ports. 306465: cxgbe(4): Claim the T6 -DBG card. 309302: cxgbe(4): Include firmware for T6 cards in the driver. Update all firmwares to 1.16.12.0. Sponsored by: Chelsio Communications
Diffstat (limited to 'sys/dev/cxgbe/tom/t4_connect.c')
-rw-r--r--sys/dev/cxgbe/tom/t4_connect.c82
1 files changed, 51 insertions, 31 deletions
diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c
index 3524011..5ec627c 100644
--- a/sys/dev/cxgbe/tom/t4_connect.c
+++ b/sys/dev/cxgbe/tom/t4_connect.c
@@ -277,19 +277,26 @@ t4_init_connect_cpl_handlers(void)
static inline int
act_open_cpl_size(struct adapter *sc, int isipv6)
{
- static const int sz_t4[] = {
- sizeof (struct cpl_act_open_req),
- sizeof (struct cpl_act_open_req6)
- };
- static const int sz_t5[] = {
- sizeof (struct cpl_t5_act_open_req),
- sizeof (struct cpl_t5_act_open_req6)
+ int idx;
+ static const int sz_table[3][2] = {
+ {
+ sizeof (struct cpl_act_open_req),
+ sizeof (struct cpl_act_open_req6)
+ },
+ {
+ sizeof (struct cpl_t5_act_open_req),
+ sizeof (struct cpl_t5_act_open_req6)
+ },
+ {
+ sizeof (struct cpl_t6_act_open_req),
+ sizeof (struct cpl_t6_act_open_req6)
+ },
};
- if (is_t4(sc))
- return (sz_t4[!!isipv6]);
- else
- return (sz_t5[!!isipv6]);
+ MPASS(chip_id(sc) >= CHELSIO_T4);
+ idx = min(chip_id(sc) - CHELSIO_T4, 2);
+
+ return (sz_table[idx][!!isipv6]);
}
/*
@@ -373,28 +380,32 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
if (isipv6) {
struct cpl_act_open_req6 *cpl = wrtod(wr);
+ struct cpl_t5_act_open_req6 *cpl5 = (void *)cpl;
+ struct cpl_t6_act_open_req6 *cpl6 = (void *)cpl;
- if ((inp->inp_vflag & INP_IPV6) == 0) {
- /* XXX think about this a bit more */
- log(LOG_ERR,
- "%s: time to think about AF_INET6 + vflag 0x%x.\n",
- __func__, inp->inp_vflag);
+ if ((inp->inp_vflag & INP_IPV6) == 0)
DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP);
- }
toep->ce = hold_lip(td, &inp->in6p_laddr);
if (toep->ce == NULL)
DONT_OFFLOAD_ACTIVE_OPEN(ENOENT);
- if (is_t4(sc)) {
+ switch (chip_id(sc)) {
+ case CHELSIO_T4:
INIT_TP_WR(cpl, 0);
cpl->params = select_ntuple(vi, toep->l2te);
- } else {
- struct cpl_t5_act_open_req6 *c5 = (void *)cpl;
-
- INIT_TP_WR(c5, 0);
- c5->iss = htobe32(tp->iss);
- c5->params = select_ntuple(vi, toep->l2te);
+ break;
+ case CHELSIO_T5:
+ INIT_TP_WR(cpl5, 0);
+ cpl5->iss = htobe32(tp->iss);
+ cpl5->params = select_ntuple(vi, toep->l2te);
+ break;
+ case CHELSIO_T6:
+ default:
+ INIT_TP_WR(cpl6, 0);
+ cpl6->iss = htobe32(tp->iss);
+ cpl6->params = select_ntuple(vi, toep->l2te);
+ break;
}
OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6,
qid_atid));
@@ -409,16 +420,25 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
cpl->opt2 = calc_opt2a(so, toep);
} else {
struct cpl_act_open_req *cpl = wrtod(wr);
+ struct cpl_t5_act_open_req *cpl5 = (void *)cpl;
+ struct cpl_t6_act_open_req *cpl6 = (void *)cpl;
- if (is_t4(sc)) {
+ switch (chip_id(sc)) {
+ case CHELSIO_T4:
INIT_TP_WR(cpl, 0);
cpl->params = select_ntuple(vi, toep->l2te);
- } else {
- struct cpl_t5_act_open_req *c5 = (void *)cpl;
-
- INIT_TP_WR(c5, 0);
- c5->iss = htobe32(tp->iss);
- c5->params = select_ntuple(vi, toep->l2te);
+ break;
+ case CHELSIO_T5:
+ INIT_TP_WR(cpl5, 0);
+ cpl5->iss = htobe32(tp->iss);
+ cpl5->params = select_ntuple(vi, toep->l2te);
+ break;
+ case CHELSIO_T6:
+ default:
+ INIT_TP_WR(cpl6, 0);
+ cpl6->iss = htobe32(tp->iss);
+ cpl6->params = select_ntuple(vi, toep->l2te);
+ break;
}
OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ,
qid_atid));
OpenPOWER on IntegriCloud