From owner-svn-src-head@FreeBSD.ORG Tue Sep 6 09:53:37 2011 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 1AA8A106564A; Tue, 6 Sep 2011 09:53:37 +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 09A068FC17; Tue, 6 Sep 2011 09:53:35 +0000 (UTC) Received: from [10.2.1.1] (unknown [10.2.1.1]) by work.netasq.com (Postfix) with ESMTPSA id 8182B74004E; Tue, 6 Sep 2011 11:36:05 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Fabien Thomas In-Reply-To: <201109051754.p85HsJS6047967@svn.freebsd.org> Date: Tue, 6 Sep 2011 11:36:33 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <239C40DF-095D-4571-BE83-0E2FB21F13EF@netasq.com> References: <201109051754.p85HsJS6047967@svn.freebsd.org> To: Qing Li X-Mailer: Apple Mail (2.1084) 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-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: Tue, 06 Sep 2011 09:53:37 -0000 On Sep 5, 2011, at 7:54 PM, Qing Li wrote: > Author: qingli > Date: Mon Sep 5 17:54:19 2011 > New Revision: 225405 > URL: http://svn.freebsd.org/changeset/base/225405 >=20 > 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'm not sure to understand the fix: if (adapter->max_frame_size <=3D 2048) adapter->rx_mbuf_sz =3D MCLBYTES; else if (adapter->max_frame_size <=3D 4096) adapter->rx_mbuf_sz =3D MJUMPAGESIZE; else if (adapter->max_frame_size <=3D 9216) adapter->rx_mbuf_sz =3D MJUM9BYTES; else adapter->rx_mbuf_sz =3D MJUM16BYTES; Without the fix this resolve to bufsz =3D adapter->rx_mbuf_sz >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; 2048 >> 10 =3D 2 which seem correct regarding the definition: BSIZEPACKET: Receive Buffer Size for Packet Buffer. The value is in 1 KB resolution. = Value can be from 1 KB to 16 KB. Default buffer size is 2 KB. This field = should not be set to 0x0. This field should be greater or equal to 0x2 = in queues where RSC is enabled. I've missed something? >=20 > 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. >=20 > Submitted by: original patch by Ray Ruvinskiy at BlueCoat dot = com > Reviewed by: jfv, kmacy, rwatson > Approved by: re (rwatson) > MFC after: 5 days >=20 > Modified: > head/sys/dev/ixgbe/ixgbe.c >=20 > Modified: head/sys/dev/ixgbe/ixgbe.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 >=20 > +#define BSIZEPKT_ROUNDUP ((1< +=09 > static void > ixgbe_initialize_receive_units(struct adapter *adapter) > { > @@ -3882,7 +3884,7 @@ ixgbe_initialize_receive_units(struct ad > hlreg &=3D ~IXGBE_HLREG0_JUMBOEN; > IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); >=20 > - bufsz =3D adapter->rx_mbuf_sz >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; > + bufsz =3D (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> = IXGBE_SRRCTL_BSIZEPKT_SHIFT; >=20 > for (int i =3D 0; i < adapter->num_queues; i++, rxr++) { > u64 rdba =3D rxr->rxdma.dma_paddr; > @@ -4300,9 +4302,10 @@ ixgbe_rxeof(struct ix_queue *que, int co > sendmp =3D rbuf->fmp; > rbuf->m_pack =3D rbuf->fmp =3D NULL; >=20 > - if (sendmp !=3D NULL) /* secondary frag */ > + if (sendmp !=3D NULL) { /* secondary frag */ > + mp->m_flags &=3D ~M_PKTHDR; > sendmp->m_pkthdr.len +=3D mp->m_len; > - else { > + } else { > /* first desc of a non-ps chain */ > sendmp =3D mp; > sendmp->m_flags |=3D M_PKTHDR; -- Fabien Thomas