Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jan 2008 04:49:21 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 134181 for review
Message-ID:  <200801270449.m0R4nLpW020420@repoman.freebsd.org>

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

Change 134181 by kmacy@kmacy:storage:toehead on 2008/01/27 04:49:19

	IFC 134180
	bring cxgb_sge.c fix for DISABLE_MBUF_IOVEC

Affected files ...

.. //depot/projects/toehead/share/man/man9/style.9#3 integrate
.. //depot/projects/toehead/sys/dev/cxgb/cxgb_sge.c#5 integrate
.. //depot/projects/toehead/sys/dev/cxgb/ulp/tom/cxgb_tcp.h#2 integrate
.. //depot/projects/toehead/sys/netinet/tcp_ofld.c#2 delete
.. //depot/projects/toehead/sys/netinet/tcp_ofld.h#5 delete
.. //depot/projects/toehead/sys/netinet/toedev.h#3 integrate

Differences ...

==== //depot/projects/toehead/share/man/man9/style.9#3 (text+ko) ====

@@ -24,7 +24,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	From: @(#)style	1.14 (Berkeley) 4/28/95
-.\" $FreeBSD: src/share/man/man9/style.9,v 1.124 2008/01/05 21:39:21 grog Exp $
+.\" $FreeBSD: src/share/man/man9/style.9,v 1.125 2008/01/27 03:58:22 obrien Exp $
 .\"
 .Dd February 10, 2005
 .Dt STYLE 9
@@ -46,7 +46,7 @@
  * Style guide for FreeBSD.  Based on the CSRG's KNF (Kernel Normal Form).
  *
  *	@(#)style	1.14 (Berkeley) 4/28/95
- * $FreeBSD: src/share/man/man9/style.9,v 1.124 2008/01/05 21:39:21 grog Exp $
+ * $FreeBSD: src/share/man/man9/style.9,v 1.125 2008/01/27 03:58:22 obrien Exp $
  */
 
 /*
@@ -111,7 +111,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/share/man/man9/style.9,v 1.124 2008/01/05 21:39:21 grog Exp $");
+__FBSDID("$FreeBSD: src/share/man/man9/style.9,v 1.125 2008/01/27 03:58:22 obrien Exp $");
 .Ed
 .Pp
 Leave another blank line before the header files.
@@ -852,3 +852,7 @@
 desire of the
 .Fx
 project.
+.Pa src/admin/style/style
+is a codification by the CSRG of the programming style of Ken Thompson and
+Dennis Ritchie in
+.At v6 .

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

@@ -30,7 +30,7 @@
 
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_sge.c,v 1.47 2008/01/19 22:47:43 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_sge.c,v 1.48 2008/01/27 04:37:02 kmacy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -292,18 +292,6 @@
  *
  *	Return a packet containing the immediate data of the given response.
  */
-#ifdef DISABLE_MBUF_IOVEC
-static __inline int
-get_imm_packet(adapter_t *sc, const struct rsp_desc *resp, struct t3_mbuf_hdr *mh)
-{
-	struct mbuf *m = mh->m_head;
-		
-	memcpy(mtod(m, uint8_t *), resp->imm_data, IMMED_PKT_SIZE);
-	m->m_pkthdr.len = m->m_len = len;
-	return (0);
-}
-
-#else
 static int
 get_imm_packet(adapter_t *sc, const struct rsp_desc *resp, struct mbuf *m, void *cl, uint32_t flags)
 {
@@ -313,7 +301,6 @@
 	return (0);
 	
 }
-#endif
 
 static __inline u_int
 flits_to_desc(u_int n)
@@ -2501,10 +2488,10 @@
 	uint32_t len = G_RSPD_LEN(len_cq);
 	uint32_t flags = ntohl(r->flags);
 	uint8_t sopeop = G_RSPD_SOP_EOP(flags);
-	struct mbuf *m;
-	uint32_t *ref;
+	caddr_t cl;
+	struct mbuf *m, *m0;
 	int ret = 0;
-
+	
 	prefetch(sd->rxsd_cl);
 
 	fl->credits--;
@@ -2517,20 +2504,20 @@
 		memcpy(cl, sd->data, len);
 		recycle_rx_buf(adap, fl, fl->cidx);
 		m = m0;
+		m0->m_len = len;
 	} else {
 	skip_recycle:
-		int flags = 0;
+
 		bus_dmamap_unload(fl->entry_tag, sd->map);
 		cl = sd->rxsd_cl;
 		m = m0 = (struct mbuf *)cl;
 
-		m0->m_len = len;
 		if ((sopeop == RSPQ_SOP_EOP) ||
 		    (sopeop == RSPQ_SOP))
 			flags = M_PKTHDR;
 		init_cluster_mbuf(cl, flags, fl->type, fl->zone);
+		m0->m_len = len;
 	}		
-	
 	switch(sopeop) {
 	case RSPQ_SOP_EOP:
 		DBG(DBG_RX, ("get_packet: SOP-EOP m %p\n", m));
@@ -2541,7 +2528,7 @@
 	case RSPQ_NSOP_NEOP:
 		DBG(DBG_RX, ("get_packet: NO_SOP-NO_EOP m %p\n", m));
 		if (mh->mh_tail == NULL) {
-			printf("discarding intermediate descriptor entry\n");
+			log(LOG_ERR, "discarding intermediate descriptor entry\n");
 			m_freem(m);
 			break;
 		}
@@ -2738,41 +2725,26 @@
 
 		} else if  (flags & F_RSPD_IMM_DATA_VALID) {
 			struct mbuf *m = NULL;
-			
-#ifdef DISABLE_MBUF_IOVEC
-			DPRINTF("IMM DATA VALID opcode=0x%x rspq->cidx=%d\n",
-			    r->rss_hdr.opcode, rspq->cidx);
-			
-			m = rspq->rspq_mh.mh_head = m_gethdr(M_DONTWAIT, MT_DATA);
-			if (m == NULL) {
-				rspq->next_holdoff = NOMEM_INTR_DELAY;
-				budget_left--;
-				break;
-			}
 
-			get_imm_packet(adap, r, &rspq->rspq_mh);
-			eop = 1;
-#else
 			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);
+			if (rspq->rspq_mh.mh_head == NULL)
+				rspq->rspq_mh.mh_head = m_gethdr(M_DONTWAIT, MT_DATA);
                         else 
 				m = m_gethdr(M_DONTWAIT, MT_DATA);
 
 			/*
 			 * XXX revisit me
 			 */
-			if (rspq->rspq_mbuf == NULL &&  m == NULL) {
+			if (rspq->rspq_mh.mh_head == NULL &&  m == NULL) {
 				rspq->next_holdoff = NOMEM_INTR_DELAY;
 				budget_left--;
 				break;
 			}
-			get_imm_packet(adap, r, rspq->rspq_mbuf, m, flags);
+			get_imm_packet(adap, r, rspq->rspq_mh.mh_head, m, flags);
 			
 			eop = 1;
 			rspq->imm_data++;
-#endif			
 		} else if (r->len_cq) {			
 			int drop_thresh = eth ? SGE_RX_DROP_THRES : 0;
 			

==== //depot/projects/toehead/sys/dev/cxgb/ulp/tom/cxgb_tcp.h#2 (text+ko) ====

@@ -25,12 +25,15 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/cxgb/ulp/tom/cxgb_tcp.h,v 1.1 2007/12/17 08:17:50 kmacy Exp $
+ * $FreeBSD: src/sys/dev/cxgb/ulp/tom/cxgb_tcp.h,v 1.2 2008/01/27 04:39:38 kmacy Exp $
  */
 #ifndef CXGB_TCP_H_
 #define CXGB_TCP_H_
-
+#ifdef TCP_USRREQS_OVERLOAD
 struct tcpcb *cxgb_tcp_drop(struct tcpcb *tp, int errno);
+#else
+#define cxgb_tcp_drop	tcp_drop
+#endif
 void cxgb_tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip);
 struct tcpcb *cxgb_tcp_close(struct tcpcb *tp);
 

==== //depot/projects/toehead/sys/netinet/toedev.h#3 (text+ko) ====




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