From owner-svn-src-head@FreeBSD.ORG Sat Jun 20 18:57:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86F9F1065670; Sat, 20 Jun 2009 18:57:15 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FB5D8FC08; Sat, 20 Jun 2009 18:57:15 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KIvFJY084271; Sat, 20 Jun 2009 18:57:15 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KIvFHx084267; Sat, 20 Jun 2009 18:57:15 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200906201857.n5KIvFHx084267@svn.freebsd.org> From: Kip Macy Date: Sat, 20 Jun 2009 18:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194553 - in head/sys/dev/cxgb: . sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2009 18:57:16 -0000 Author: kmacy Date: Sat Jun 20 18:57:14 2009 New Revision: 194553 URL: http://svn.freebsd.org/changeset/base/194553 Log: - fix dma map handling for !x86 case - fix allocation failure handing in refill_fl Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgb/sys/mvec.h head/sys/dev/cxgb/sys/uipc_mvec.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Jun 20 18:52:02 2009 (r194552) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Jun 20 18:57:14 2009 (r194553) @@ -714,6 +714,7 @@ refill_fl(adapter_t *sc, struct sge_fl * if (q->zone = zone_pack) uma_zfree(q->zone, cl); m_free(m); + goto done; } #else cb_arg.seg.ds_addr = pmap_kextract((vm_offset_t)cl); @@ -1157,7 +1158,7 @@ retry: m0 = *m; pktlen = m0->m_pkthdr.len; #if defined(__i386__) || defined(__amd64__) - if (busdma_map_sg_collapse(txq, txsd, m, segs, nsegs) == 0) { + if (busdma_map_sg_collapse(txq, txsd->map, m, segs, nsegs) == 0) { goto done; } else #endif @@ -1411,11 +1412,11 @@ t3_encap(struct sge_qset *qs, struct mbu tso_info = V_LSO_MSS(m0->m_pkthdr.tso_segsz); #endif if (m0->m_nextpkt != NULL) { - busdma_map_sg_vec(txq, txsd, m0, segs, &nsegs); + busdma_map_sg_vec(txq, txsd->map, m0, segs, &nsegs); ndesc = 1; mlen = 0; } else { - if ((err = busdma_map_sg_collapse(txq, txsd, &m0, segs, &nsegs))) { + if ((err = busdma_map_sg_collapse(txq, txsd->map, &m0, segs, &nsegs))) { if (cxgb_debug) printf("failed ... err=%d\n", err); return (err); Modified: head/sys/dev/cxgb/sys/mvec.h ============================================================================== --- head/sys/dev/cxgb/sys/mvec.h Sat Jun 20 18:52:02 2009 (r194552) +++ head/sys/dev/cxgb/sys/mvec.h Sat Jun 20 18:57:14 2009 (r194553) @@ -43,7 +43,7 @@ #define m_ulp_mode m_pkthdr.tso_segsz /* upper level protocol */ static __inline void -busdma_map_mbuf_fast(struct sge_txq *txq, struct tx_sw_desc *txsd, +busdma_map_mbuf_fast(struct sge_txq *txq, bus_dmamap_t map, struct mbuf *m, bus_dma_segment_t *seg) { #if defined(__i386__) || defined(__amd64__) @@ -52,14 +52,15 @@ busdma_map_mbuf_fast(struct sge_txq *txq #else int nsegstmp; - bus_dmamap_load_mbuf_sg(txq->entry_tag, txsd->map, m, seg, + bus_dmamap_load_mbuf_sg(txq->entry_tag, map, m, seg, &nsegstmp, 0); #endif } -int busdma_map_sg_collapse(struct sge_txq *txq, struct tx_sw_desc *txsd, +int busdma_map_sg_collapse(struct sge_txq *txq, bus_dmamap_t map, struct mbuf **m, bus_dma_segment_t *segs, int *nsegs); -void busdma_map_sg_vec(struct sge_txq *txq, struct tx_sw_desc *txsd, struct mbuf *m, bus_dma_segment_t *segs, int *nsegs); +void busdma_map_sg_vec(struct sge_txq *txq, bus_dmamap_t map, + struct mbuf *m, bus_dma_segment_t *segs, int *nsegs); static __inline int busdma_map_sgl(bus_dma_segment_t *vsegs, bus_dma_segment_t *segs, int count) { Modified: head/sys/dev/cxgb/sys/uipc_mvec.c ============================================================================== --- head/sys/dev/cxgb/sys/uipc_mvec.c Sat Jun 20 18:52:02 2009 (r194552) +++ head/sys/dev/cxgb/sys/uipc_mvec.c Sat Jun 20 18:57:14 2009 (r194553) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #endif int -busdma_map_sg_collapse(struct sge_txq *txq, struct tx_sw_desc *txsd, +busdma_map_sg_collapse(struct sge_txq *txq, bus_dmamap_t map, struct mbuf **m, bus_dma_segment_t *segs, int *nsegs) { struct mbuf *n = *m; @@ -73,7 +73,7 @@ retry: psegs = segs; seg_count = 0; if (n->m_next == NULL) { - busdma_map_mbuf_fast(txq, txsd, n, segs); + busdma_map_mbuf_fast(txq, map, n, segs); *nsegs = 1; return (0); } @@ -84,13 +84,13 @@ retry: */ if (__predict_true(n->m_len != 0)) { seg_count++; - busdma_map_mbuf_fast(txq, txsd, n, psegs); + busdma_map_mbuf_fast(txq, map, n, psegs); psegs++; } n = n->m_next; } #else - err = bus_dmamap_load_mbuf_sg(txq->entry_tag, txsd->map, m, segs, + err = bus_dmamap_load_mbuf_sg(txq->entry_tag, map, m, segs, &seg_count, 0); #endif if (seg_count == 0) { @@ -122,11 +122,11 @@ err_out: } void -busdma_map_sg_vec(struct sge_txq *txq, struct tx_sw_desc *txsd, +busdma_map_sg_vec(struct sge_txq *txq, bus_dmamap_t map, struct mbuf *m, bus_dma_segment_t *segs, int *nsegs) { for (*nsegs = 0; m != NULL ; segs++, *nsegs += 1, m = m->m_nextpkt) - busdma_map_mbuf_fast(txq, txsd, m, segs); + busdma_map_mbuf_fast(txq, map, m, segs); }