svn commit: r255005 - in head/sys/dev/cxgbe: . tom

Navdeep Parhar np at FreeBSD.org
Wed Aug 28 20:45:46 UTC 2013


Author: np
Date: Wed Aug 28 20:45:45 2013
New Revision: 255005
URL: http://svnweb.freebsd.org/changeset/base/255005

Log:
  Add hooks in base cxgbe(4) for the iWARP upper-layer driver.  Update a
  couple of assertions in the TOE driver as well.

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/offload.h
  head/sys/dev/cxgbe/osdep.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/dev/cxgbe/tom/t4_cpl_io.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Wed Aug 28 20:10:56 2013	(r255004)
+++ head/sys/dev/cxgbe/adapter.h	Wed Aug 28 20:45:45 2013	(r255005)
@@ -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;

Modified: head/sys/dev/cxgbe/offload.h
==============================================================================
--- head/sys/dev/cxgbe/offload.h	Wed Aug 28 20:10:56 2013	(r255004)
+++ head/sys/dev/cxgbe/offload.h	Wed Aug 28 20:45:45 2013	(r255005)
@@ -123,6 +123,7 @@ struct t4_virt_res {                    
 #ifdef TCP_OFFLOAD
 enum {
 	ULD_TOM = 1,
+	ULD_IWARP = 2,
 };
 
 struct adapter;

Modified: head/sys/dev/cxgbe/osdep.h
==============================================================================
--- head/sys/dev/cxgbe/osdep.h	Wed Aug 28 20:10:56 2013	(r255004)
+++ head/sys/dev/cxgbe/osdep.h	Wed Aug 28 20:45:45 2013	(r255005)
@@ -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

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Wed Aug 28 20:10:56 2013	(r255004)
+++ head/sys/dev/cxgbe/t4_main.c	Wed Aug 28 20:45:45 2013	(r255005)
@@ -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) {

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Wed Aug 28 20:10:56 2013	(r255004)
+++ head/sys/dev/cxgbe/t4_sge.c	Wed Aug 28 20:45:45 2013	(r255005)
@@ -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;
 			}
 

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c	Wed Aug 28 20:10:56 2013	(r255004)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c	Wed Aug 28 20:45:45 2013	(r255005)
@@ -548,9 +548,10 @@ t4_push_frames(struct adapter *sc, struc
 	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 s
 	}
 	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:


More information about the svn-src-head mailing list