summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2013-08-28 20:45:45 +0000
committernp <np@FreeBSD.org>2013-08-28 20:45:45 +0000
commit5147205a55b3f9cfbf6fd2523986dd24e80d743a (patch)
treefc36df2229069e7b6cf7ffdbc33cb15e72fbe6ca
parent8071801ca5dbd29cf20ba73e01f4748f7bbfb046 (diff)
downloadFreeBSD-src-5147205a55b3f9cfbf6fd2523986dd24e80d743a.zip
FreeBSD-src-5147205a55b3f9cfbf6fd2523986dd24e80d743a.tar.gz
Add hooks in base cxgbe(4) for the iWARP upper-layer driver. Update a
couple of assertions in the TOE driver as well.
-rw-r--r--sys/dev/cxgbe/adapter.h1
-rw-r--r--sys/dev/cxgbe/offload.h1
-rw-r--r--sys/dev/cxgbe/osdep.h2
-rw-r--r--sys/dev/cxgbe/t4_main.c1
-rw-r--r--sys/dev/cxgbe/t4_sge.c18
-rw-r--r--sys/dev/cxgbe/tom/t4_cpl_io.c15
6 files changed, 30 insertions, 8 deletions
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index 2d118c4..f121ec8 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -567,6 +567,7 @@ struct adapter {
#ifdef TCP_OFFLOAD
void *tom_softc; /* (struct tom_data *) */
struct tom_tunables tt;
+ void *iwarp_softc; /* (struct c4iw_dev *) */
#endif
struct l2t_data *l2t; /* L2 table */
struct tid_info tids;
diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h
index 7f4b38e..8d3cf66 100644
--- a/sys/dev/cxgbe/offload.h
+++ b/sys/dev/cxgbe/offload.h
@@ -123,6 +123,7 @@ struct t4_virt_res { /* virtualized HW resources */
#ifdef TCP_OFFLOAD
enum {
ULD_TOM = 1,
+ ULD_IWARP = 2,
};
struct adapter;
diff --git a/sys/dev/cxgbe/osdep.h b/sys/dev/cxgbe/osdep.h
index 5575f61..403b535 100644
--- a/sys/dev/cxgbe/osdep.h
+++ b/sys/dev/cxgbe/osdep.h
@@ -45,6 +45,7 @@
#define CH_ALERT(adap, fmt, ...) log(LOG_ALERT, fmt, ##__VA_ARGS__)
#define CH_WARN_RATELIMIT(adap, fmt, ...) log(LOG_WARNING, fmt, ##__VA_ARGS__)
+#ifndef LINUX_TYPES_DEFINED
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
@@ -156,5 +157,6 @@ strstrip(char *s)
return (r);
}
+#endif /* LINUX_TYPES_DEFINED */
#endif
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index db4637d..e185de7 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -600,7 +600,6 @@ t4_attach(device_t dev)
t4_register_cpl_handler(sc, CPL_TRACE_PKT_T5, t5_trace_pkt);
t4_init_sge_cpl_handlers(sc);
-
/* Prepare the adapter for operation */
rc = -t4_prep_adapter(sc);
if (rc != 0) {
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 2ab1810..c5aeff9 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -1069,6 +1069,17 @@ service_iq(struct sge_iq *iq, int budget)
("%s: budget %u, rsp_type %u", __func__,
budget, rsp_type));
+ /*
+ * There are 1K interrupt-capable queues (qids 0
+ * through 1023). A response type indicating a
+ * forwarded interrupt with a qid >= 1K is an
+ * iWARP async notification.
+ */
+ if (lq >= 1024) {
+ sc->an_handler(iq, ctrl);
+ break;
+ }
+
q = sc->sge.iqmap[lq - sc->sge.iq_start];
if (atomic_cmpset_int(&q->state, IQS_IDLE,
IQS_BUSY)) {
@@ -1083,7 +1094,12 @@ service_iq(struct sge_iq *iq, int budget)
break;
default:
- sc->an_handler(iq, ctrl);
+ KASSERT(0,
+ ("%s: illegal response type %d on iq %p",
+ __func__, rsp_type, iq));
+ log(LOG_ERR,
+ "%s: illegal response type %d on iq %p",
+ device_get_nameunit(sc->dev), rsp_type, iq);
break;
}
diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
index 8bb90f5..99e9db4 100644
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -548,9 +548,10 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep)
KASSERT(toep->flags & TPF_FLOWC_WR_SENT,
("%s: flowc_wr not sent for tid %u.", __func__, toep->tid));
- if (__predict_false(toep->ulp_mode != ULP_MODE_NONE &&
- toep->ulp_mode != ULP_MODE_TCPDDP))
- CXGBE_UNIMPLEMENTED("ulp_mode");
+ KASSERT(toep->ulp_mode == ULP_MODE_NONE ||
+ toep->ulp_mode == ULP_MODE_TCPDDP ||
+ toep->ulp_mode == ULP_MODE_RDMA,
+ ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep));
/*
* This function doesn't resume by itself. Someone else must clear the
@@ -843,9 +844,11 @@ do_peer_close(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
}
socantrcvmore_locked(so); /* unlocks the sockbuf */
- KASSERT(tp->rcv_nxt == be32toh(cpl->rcv_nxt),
- ("%s: rcv_nxt mismatch: %u %u", __func__, tp->rcv_nxt,
- be32toh(cpl->rcv_nxt)));
+ if (toep->ulp_mode != ULP_MODE_RDMA) {
+ KASSERT(tp->rcv_nxt == be32toh(cpl->rcv_nxt),
+ ("%s: rcv_nxt mismatch: %u %u", __func__, tp->rcv_nxt,
+ be32toh(cpl->rcv_nxt)));
+ }
switch (tp->t_state) {
case TCPS_SYN_RECEIVED:
OpenPOWER on IntegriCloud