From owner-svn-src-all@FreeBSD.ORG Mon Sep 5 17:54:19 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 B96DC1065670; Mon, 5 Sep 2011 17:54:19 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD9E8FC14; Mon, 5 Sep 2011 17:54:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p85HsJwx047970; Mon, 5 Sep 2011 17:54:19 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p85HsJS6047967; Mon, 5 Sep 2011 17:54:19 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201109051754.p85HsJS6047967@svn.freebsd.org> From: Qing Li Date: Mon, 5 Sep 2011 17:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225405 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 05 Sep 2011 17:54:19 -0000 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. 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<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;