From owner-freebsd-current@FreeBSD.ORG Mon May 3 14:36:50 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FBAB106564A for ; Mon, 3 May 2010 14:36:50 +0000 (UTC) (envelope-from fabien.thomas@netasq.com) Received: from work.netasq.com (mars.netasq.com [91.212.116.3]) by mx1.freebsd.org (Postfix) with ESMTP id E6BB48FC19 for ; Mon, 3 May 2010 14:36:49 +0000 (UTC) Received: from [10.2.1.5] (unknown [10.2.1.5]) by work.netasq.com (Postfix) with ESMTPSA id 2B6CA740080 for ; Mon, 3 May 2010 16:00:38 +0200 (CEST) From: Fabien Thomas Content-Type: multipart/mixed; boundary=Apple-Mail-2-382786253 Message-Id: <6EF4A177-00E8-47C7-9F9E-9F580FFE2585@netasq.com> Date: Mon, 3 May 2010 16:00:45 +0200 To: freebsd-current@freebsd.org Mime-Version: 1.0 (Apple Message framework v1078) X-Mailer: Apple Mail (2.1078) Subject: m_getjcl and packet cache X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: fabient@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 May 2010 14:36:50 -0000 --Apple-Mail-2-382786253 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, I've posted on -net but in case people will have some feedback on this = before commit. There is two solutions, let every driver get a test for MCLBYTES and = call m_getcl (and then add support for at least igb, em, ixgbe)=20 or integrate the fast path in m_getjcl. I've chosen to integrate the fast path in m_getjcl and patched the two = case now redundant in the attached patch. =46rom freebsd-net@: While doing some 10Gb benchmark i've found that m_getjcl does not = benefit from the packet zone. There is a ~ 80% increase in FPS when applying the following patch. 256B frame driver to driver / stable_8: - 3 765 066 FPS - 6 868 153 FPS with the patch applied. Any advice ? Fabien --Apple-Mail-2-382786253 Content-Disposition: attachment; filename=patch-m_getjcl-packet Content-Type: application/octet-stream; x-unix-mode=0644; name="patch-m_getjcl-packet" Content-Transfer-Encoding: 7bit Index: dev/bce/if_bce.c =================================================================== --- dev/bce/if_bce.c (revision 207555) +++ dev/bce/if_bce.c (working copy) @@ -5059,11 +5059,8 @@ #ifdef BCE_JUMBO_HDRSPLIT MGETHDR(m_new, M_DONTWAIT, MT_DATA); #else - if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES) - m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - else - m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, - sc->rx_bd_mbuf_alloc_size); + m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + sc->rx_bd_mbuf_alloc_size); #endif if (m_new == NULL) { Index: dev/mxge/if_mxge.c =================================================================== --- dev/mxge/if_mxge.c (revision 207555) +++ dev/mxge/if_mxge.c (working copy) @@ -2400,10 +2400,7 @@ mxge_rx_ring_t *rx = &ss->rx_big; int cnt, err, i; - if (rx->cl_size == MCLBYTES) - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - else - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, rx->cl_size); + m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, rx->cl_size); if (m == NULL) { rx->alloc_fail++; err = ENOBUFS; Index: sys/mbuf.h =================================================================== --- sys/mbuf.h (revision 207555) +++ sys/mbuf.h (working copy) @@ -523,6 +523,9 @@ struct mbuf *m, *n; uma_zone_t zone; + if (size == MCLBYTES) + return m_getcl(how, type, flags); + args.flags = flags; args.type = type; --Apple-Mail-2-382786253--