Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2007 00:00:25 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 129528 for review
Message-ID:  <200711260000.lAQ00PL5052350@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=129528

Change 129528 by kmacy@kmacy:storage:toestack on 2007/11/25 23:59:32

	use 16k clusters for jumbo frames
	fix case where we were skipping over returning credits 
	turn off IMM DATA printfs
	add debugging for q stop / restart

Affected files ...

.. //depot/projects/toestack/sys/dev/cxgb/cxgb_sge.c#13 edit
.. //depot/projects/toestack/sys/dev/cxgb/sys/cxgb_support.c#3 edit

Differences ...

==== //depot/projects/toestack/sys/dev/cxgb/cxgb_sge.c#13 (text+ko) ====

@@ -1513,6 +1513,8 @@
 
 		struct sge_qset *qs = txq_to_qset(q, qid);
 
+		printf("stopping q\n");
+		
 		setbit(&qs->txq_stopped, qid);
 		smp_mb();
 
@@ -1585,7 +1587,7 @@
 			mtx_unlock(&q->lock);
 			printf("no desc available\n");
 			
-			return (-1);
+			return (ENOSPC);
 		}
 		goto again;
 	}
@@ -1618,6 +1620,8 @@
 	struct sge_txq *q = &qs->txq[TXQ_CTRL];
 	adapter_t *adap = qs->port->adapter;
 
+	printf("Restart_ctrlq\n");
+	
 	mtx_lock(&q->lock);
 again:	reclaim_completed_tx_imm(q);
 
@@ -1997,6 +2001,8 @@
 	ret = check_desc_avail(adap, q, m, ndesc, TXQ_OFLD);
 	if (__predict_false(ret)) {
 		if (ret == 1) {
+			printf("no ofld desc avail\n");
+			
 			m_set_priority(m, ndesc);     /* save for restart */
 			mtx_unlock(&q->lock);
 			return (EINTR);
@@ -2181,16 +2187,24 @@
 {
 	struct adapter *sc = qs->port->adapter;
 	
+	
 	if (isset(&qs->txq_stopped, TXQ_OFLD) &&
 	    should_restart_tx(&qs->txq[TXQ_OFLD]) &&
 	    test_and_clear_bit(TXQ_OFLD, &qs->txq_stopped)) {
 		qs->txq[TXQ_OFLD].restarts++;
+		printf("restarting TXQ_OFLD\n");
 		taskqueue_enqueue(sc->tq, &qs->txq[TXQ_OFLD].qresume_task);
 	}
+	printf("stopped=0x%x restart=%d processed=%d cleaned=%d in_use=%d\n",
+	    qs->txq_stopped, should_restart_tx(&qs->txq[TXQ_CTRL]),
+	    qs->txq[TXQ_CTRL].processed, qs->txq[TXQ_CTRL].cleaned,
+	    qs->txq[TXQ_CTRL].in_use);
+	
 	if (isset(&qs->txq_stopped, TXQ_CTRL) &&
 	    should_restart_tx(&qs->txq[TXQ_CTRL]) &&
 	    test_and_clear_bit(TXQ_CTRL, &qs->txq_stopped)) {
 		qs->txq[TXQ_CTRL].restarts++;
+		printf("restarting TXQ_CTRL\n");
 		taskqueue_enqueue(sc->tq, &qs->txq[TXQ_CTRL].qresume_task);
 	}
 }
@@ -2303,9 +2317,9 @@
 	q->fl[0].zone = zone_clust;
 	q->fl[0].type = EXT_CLUSTER;
 	if (jumbo_phys_contig) {
-		q->fl[1].buf_size = MJUM9BYTES - sizeof(uint32_t) - sizeof(struct m_hdr) - sizeof(struct pkthdr) - sizeof(struct m_ext_);
-		q->fl[1].zone = zone_jumbo9;
-		q->fl[1].type = EXT_JUMBO9;
+		q->fl[1].buf_size = MJUM16BYTES - sizeof(uint32_t) - sizeof(struct m_hdr) - sizeof(struct pkthdr) - sizeof(struct m_ext_);
+		q->fl[1].zone = zone_jumbo16;
+		q->fl[1].type = EXT_JUMBO16;
 	} else {
 		q->fl[1].buf_size = MJUMPAGESIZE - sizeof(uint32_t) - sizeof(struct m_hdr) - sizeof(struct pkthdr) - sizeof(struct m_ext_);
 		q->fl[1].zone = zone_jumbop;
@@ -2736,7 +2750,7 @@
 		} else if  (flags & F_RSPD_IMM_DATA_VALID) {
 #ifdef DISABLE_MBUF_IOVEC
 
-			printf("IMM DATA VALID opcode=0x%x rspq->cidx=%d\n", r->rss_hdr.opcode, rspq->cidx);
+			DPRINTF("IMM DATA VALID opcode=0x%x rspq->cidx=%d\n", r->rss_hdr.opcode, rspq->cidx);
 
 			if(get_imm_packet(adap, r, &rspq->rspq_mh) == 0) {
 				rspq->next_holdoff = NOMEM_INTR_DELAY;
@@ -2748,7 +2762,7 @@
 #else
 			struct mbuf *m = NULL;
 			
-			printf("IMM DATA VALID opcode=0x%x rspq->cidx=%d\n", r->rss_hdr.opcode, rspq->cidx);
+			DPRINTF("IMM DATA VALID opcode=0x%x rspq->cidx=%d\n", r->rss_hdr.opcode, rspq->cidx);
 			if (rspq->rspq_mbuf == NULL)
 				rspq->rspq_mbuf = m_gethdr(M_DONTWAIT, MT_DATA);
                         else 
@@ -2794,13 +2808,14 @@
 			DPRINTF("pure response\n");
 			rspq->pure_rsps++;
 		}
+#ifndef DISABLE_MBUF_IOVEC		
+	skip:
+#endif
 		if (flags & RSPD_CTRL_MASK) {
 			sleeping |= flags & RSPD_GTS_MASK;
 			handle_rsp_cntrl_info(qs, flags);
 		}
-#ifndef DISABLE_MBUF_IOVEC		
-	skip:
-#endif		
+
 		r++;
 		if (__predict_false(++rspq->cidx == rspq->size)) {
 			rspq->cidx = 0;
@@ -2824,13 +2839,15 @@
 			ngathered = rx_offload(&adap->tdev, rspq,
 			    rspq->rspq_mh.mh_head, offload_mbufs, ngathered);
 			rspq->rspq_mh.mh_head = NULL;
+			DPRINTF("received offload packet\n");
+			
 		} else if (eth && eop) {
 			prefetch(mtod(rspq->rspq_mh.mh_head, uint8_t *)); 
 			prefetch(mtod(rspq->rspq_mh.mh_head, uint8_t *) + L1_CACHE_BYTES);
 
 			t3_rx_eth_lro(adap, rspq, rspq->rspq_mh.mh_head, ethpad,
 			    rss_hash, rss_csum, lro);
-
+			DPRINTF("received tunnel packet\n");
 				rspq->rspq_mh.mh_head = NULL;
 
 		}
@@ -2846,9 +2863,12 @@
 		check_ring_db(adap, qs, sleeping);
 
 	smp_mb();  /* commit Tx queue processed updates */
-	if (__predict_false(qs->txq_stopped != 0))
+	if (__predict_false(qs->txq_stopped != 0)) {
+		printf("restarting tx on %p\n", qs);
+		
 		restart_tx(qs);
-
+	}
+	
 	__refill_fl_lt(adap, &qs->fl[0], 512);
 	__refill_fl_lt(adap, &qs->fl[1], 512);
 	budget -= budget_left;

==== //depot/projects/toestack/sys/dev/cxgb/sys/cxgb_support.c#3 (text+ko) ====

@@ -127,7 +127,7 @@
 		return (err);
 
 	if (jumbo_phys_contig)
-		ccp->ccp_jumbo_zone = zone_jumbo9;
+		ccp->ccp_jumbo_zone = zone_jumbo16;
 	else
 		ccp->ccp_jumbo_zone = zone_jumbop;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711260000.lAQ00PL5052350>