From owner-svn-src-all@FreeBSD.ORG Sun Jul 13 07:39:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5516D334; Sun, 13 Jul 2014 07:39:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2647B2D01; Sun, 13 Jul 2014 07:39:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6D7dTac010111; Sun, 13 Jul 2014 07:39:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6D7dSk9010110; Sun, 13 Jul 2014 07:39:28 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407130739.s6D7dSk9010110@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 13 Jul 2014 07:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268582 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2014 07:39:29 -0000 Author: hselasky Date: Sun Jul 13 07:39:28 2014 New Revision: 268582 URL: http://svnweb.freebsd.org/changeset/base/268582 Log: Fix performance problems with AXGE network adapter in RX direction: - Remove 4 extra bytes from the ethernet payload. - The maximum RX buffer was incorrectly set. Increase it to 64K for now, until the exact limit is understood. - Enable hardware checksumming again. - Make hardware data structure packed. MFC after: 3 days Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Sun Jul 13 06:01:23 2014 (r268581) +++ head/sys/dev/usb/net/if_axge.c Sun Jul 13 07:39:28 2014 (r268582) @@ -77,7 +77,7 @@ static const struct { uint8_t timer_h; uint8_t size; uint8_t ifg; -} axge_bulk_size[] = { +} __packed axge_bulk_size[] = { { 7, 0x4f, 0x00, 0x12, 0xff }, { 7, 0x20, 0x03, 0x16, 0xff }, { 7, 0xae, 0x07, 0x18, 0xff }, @@ -153,7 +153,7 @@ static const struct usb_config axge_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = 20480, + .bufsize = 65536, .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = axge_bulk_read_callback, .timeout = 0, /* no timeout */ @@ -613,15 +613,14 @@ tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); uether_rxflush(ue); - return; + break; default: if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); goto tr_setup; } - return; - + break; } } @@ -965,8 +964,8 @@ axge_rx_frame(struct usb_ether *ue, stru DPRINTF("Dropped a packet\n"); ue->ue_ifp->if_ierrors++; } - if (pktlen >= 2 && (int)(pos + pktlen) <= actlen) { - axge_rxeof(ue, pc, pos + 2, pktlen - 2, pkt_hdr); + if (pktlen >= 6 && (int)(pos + pktlen) <= actlen) { + axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr); } else { DPRINTF("Invalid packet pos=%d len=%d\n", (int)pos, (int)pktlen); @@ -1001,7 +1000,7 @@ axge_rxeof(struct usb_ether *ue, struct usbd_copy_out(pc, offset, mtod(m, uint8_t *), len); ifp->if_ipackets++; -#if 0 + if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) { if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == AXGE_RXHDR_L4_TYPE_TCP || @@ -1012,7 +1011,7 @@ axge_rxeof(struct usb_ether *ue, struct m->m_pkthdr.csum_data = 0xffff; } } -#endif + _IF_ENQUEUE(&ue->ue_rxq, m); }