From 62e3af52257a08c21993c702f662609f3f151a2a Mon Sep 17 00:00:00 2001 From: Qing Li Date: Mon, 5 Sep 2011 17:54:19 +0000 Subject: 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 --- sys/dev/ixgbe/ixgbe.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index a382a5356c4ef..9a709afcc01a7 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c @@ -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 count) 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; -- cgit v1.3