From owner-svn-src-user@FreeBSD.ORG Mon Jun 8 21:42:16 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20D1A1065694; Mon, 8 Jun 2009 21:42:16 +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 0441B8FC15; Mon, 8 Jun 2009 21:42:16 +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 n58LgFub044625; Mon, 8 Jun 2009 21:42:15 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58LgF5q044624; Mon, 8 Jun 2009 21:42:15 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200906082142.n58LgF5q044624@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Jun 2009 21:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193764 - user/kmacy/releng_7_2_fcs/sys/dev/cxgb X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 21:42:16 -0000 Author: kmacy Date: Mon Jun 8 21:42:15 2009 New Revision: 193764 URL: http://svn.freebsd.org/changeset/base/193764 Log: - add hysteresis to coalescing - handle big-endian case in set_wr_hdr - don't do read before write of descriptor in t3_encap Modified: user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c Modified: user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c Mon Jun 8 21:34:12 2009 (r193763) +++ user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c Mon Jun 8 21:42:15 2009 (r193764) @@ -235,9 +235,11 @@ check_pkt_coalesce(struct sge_qset *qs) /* * if the hardware transmit queue is more than 3/4 full - * we mark it as coalescing + * we mark it as coalescing - we drop back from coalescing + * when we go below 1/4 full, this provides us with some + * degree of hysteresis */ - if (*fill != 0 && (txq->in_use < (txq->size - (txq->size>>2)))) + if (*fill != 0 && (txq->in_use < (txq->size>>2))) *fill = 0; else if (*fill == 0 && (txq->in_use >= (txq->size - (txq->size>>2)))) *fill = 1; @@ -250,9 +252,13 @@ static void set_wr_hdr(struct work_request_hdr *wrp, uint32_t wr_hi, uint32_t wr_lo) { uint64_t wr_hilo; - +#if _BYTE_ORDER == _LITTLE_ENDIAN wr_hilo = wr_hi; - wr_hilo |= (((uint64_t)wr_lo)<<32) ; + wr_hilo |= (((uint64_t)wr_lo)<<32); +#else + wr_hilo = wr_lo; + wr_hilo |= (((uint64_t)wr_hi)<<32); +#endif wrp->wrh_hilo = wr_hilo; } #else @@ -1392,29 +1398,31 @@ t3_encap(struct sge_qset *qs, struct mbu flits = nsegs*2 + 1; for (fidx = 1, i = 0; i < nsegs; i++, fidx += 2) { - struct cpl_tx_pkt_batch_entry *cbe = &cpl_batch->pkt_entry[i]; + struct cpl_tx_pkt_batch_entry *cbe; + uint64_t flit; + uint32_t *hflit = (uint32_t *)&flit; + int cflags = m0->m_pkthdr.csum_flags; cntrl = V_TXPKT_INTF(pi->txpkt_intf); GET_VTAG(cntrl, m0); cntrl |= V_TXPKT_OPCODE(CPL_TX_PKT); - if (__predict_false(!(m0->m_pkthdr.csum_flags & CSUM_IP))) + if (__predict_false(!(cflags & CSUM_IP))) cntrl |= F_TXPKT_IPCSUM_DIS; - if (__predict_false(!(m0->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)))) + if (__predict_false(!(cflags & (CSUM_TCP | CSUM_UDP)))) cntrl |= F_TXPKT_L4CSUM_DIS; - cbe->cntrl = htonl(cntrl); - cbe->len = htonl(segs[i].ds_len | 0x80000000); + + hflit[0] = htonl(cntrl); + hflit[1] = htonl(segs[i].ds_len | 0x80000000); + flit |= htobe64(1 << 24); + cbe = &cpl_batch->pkt_entry[i]; + cbe->cntrl = hflit[0]; + cbe->len = hflit[1]; cbe->addr = htobe64(segs[i].ds_addr); - /* - * 62% of function time is spent on the following - need to - * calculate the value to be stored in an intermediate - * and then do a direct update - */ - txd->flit[fidx] |= htobe64(1 << 24); } - wr_hi = htonl(F_WR_SOP | F_WR_EOP | V_WR_DATATYPE(1) | - V_WR_SGLSFLT(flits)) | htonl(V_WR_OP(FW_WROPCODE_TUNNEL_TX_PKT) | txqs.compl); + V_WR_SGLSFLT(flits)) | + htonl(V_WR_OP(FW_WROPCODE_TUNNEL_TX_PKT) | txqs.compl); wr_lo = htonl(V_WR_LEN(flits) | V_WR_GEN(txqs.gen)) | htonl(V_WR_TID(txq->token)); set_wr_hdr(wrp, wr_hi, wr_lo);