From owner-svn-src-all@FreeBSD.ORG Mon Sep 5 23:56:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7DD91065675; Mon, 5 Sep 2011 23:56:14 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com [209.85.210.45]) by mx1.freebsd.org (Postfix) with ESMTP id A8BD08FC12; Mon, 5 Sep 2011 23:56:14 +0000 (UTC) Received: by pzk33 with SMTP id 33so15458595pzk.18 for ; Mon, 05 Sep 2011 16:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=/OMpJIyRS48zPEEW4o/7OOwcYi9rTqxaLfxP899Fwps=; b=cT9Zj2fqOevp4PVTkQML2gpRVyth15gBqtA2/P6xh1m+AYPx/tklqtT/J8CeS95bUR RYmgol+2cN/9NO56PgFP4OqZ96MPmMAJ2w0w/OESCSWctcrS0qmXhjaPdZOigJyOKmsI Ckw7zLFfqYMeCJiqktf/De2AtjlzwIKtLQ4oQ= Received: by 10.68.10.4 with SMTP id e4mr8388346pbb.516.1315265516921; Mon, 05 Sep 2011 16:31:56 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id e8sm25468487pbc.8.2011.09.05.16.31.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Sep 2011 16:31:55 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 05 Sep 2011 16:31:21 -0700 From: YongHyeon PYUN Date: Mon, 5 Sep 2011 16:31:21 -0700 To: Qing Li Message-ID: <20110905233121.GA1760@michelle.cdnetworks.com> References: <201109051754.p85HsJS6047967@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201109051754.p85HsJS6047967@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225405 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com 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: Mon, 05 Sep 2011 23:56:15 -0000 On Mon, Sep 05, 2011 at 05:54:19PM +0000, Qing Li wrote: > Author: qingli > Date: Mon Sep 5 17:54:19 2011 > New Revision: 225405 > URL: http://svn.freebsd.org/changeset/base/225405 > > Log: > The maximum read size of incoming packets is done in 1024-byte increments. > The current code was rounding down the maximum frame size instead of > routing up, resulting in a read size of 1024 bytes, in the non-jumbo > frame case, and splitting the packets across multiple mbufs. > I guess the minimum allowed value of rx_mbuf_sz is 2048 such that old code will still produce 2(i.e. 2KB). Do you use non-standard rx_mbuf_sz which is not multiple of 1024? > Consequently the above problem exposed another issue, which is when > packets were splitted across multiple mbufs, and all of the mbufs in the > chain have the M_PKTHDR flag set. > > Submitted by: original patch by Ray Ruvinskiy at BlueCoat dot com > Reviewed by: jfv, kmacy, rwatson > Approved by: re (rwatson) > MFC after: 5 days > > Modified: > head/sys/dev/ixgbe/ixgbe.c > > Modified: head/sys/dev/ixgbe/ixgbe.c > ============================================================================== > --- head/sys/dev/ixgbe/ixgbe.c Mon Sep 5 17:45:24 2011 (r225404) > +++ head/sys/dev/ixgbe/ixgbe.c Mon Sep 5 17:54:19 2011 (r225405) > @@ -3849,6 +3849,8 @@ fail: > **********************************************************************/ > #define IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT 2 > > +#define BSIZEPKT_ROUNDUP ((1< + > static void > ixgbe_initialize_receive_units(struct adapter *adapter) > { > @@ -3882,7 +3884,7 @@ ixgbe_initialize_receive_units(struct ad > hlreg &= ~IXGBE_HLREG0_JUMBOEN; > IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); > > - bufsz = adapter->rx_mbuf_sz >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; > + bufsz = (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; > > for (int i = 0; i < adapter->num_queues; i++, rxr++) { > u64 rdba = rxr->rxdma.dma_paddr; > @@ -4300,9 +4302,10 @@ ixgbe_rxeof(struct ix_queue *que, int co > sendmp = rbuf->fmp; > rbuf->m_pack = rbuf->fmp = NULL; > > - if (sendmp != NULL) /* secondary frag */ > + if (sendmp != NULL) { /* secondary frag */ > + mp->m_flags &= ~M_PKTHDR; > sendmp->m_pkthdr.len += mp->m_len; > - else { > + } else { > /* first desc of a non-ps chain */ > sendmp = mp; > sendmp->m_flags |= M_PKTHDR;