Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Apr 2015 22:18:51 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r281954 - stable/10/sys/dev/ixgbe
Message-ID:  <201504242218.t3OMIp7D057021@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri Apr 24 22:18:50 2015
New Revision: 281954
URL: https://svnweb.freebsd.org/changeset/base/281954

Log:
  MFC r279393:
  
  Pad RX copy alignment calculation to avoid illegal memory accesses
  
  The optimization made in r239940 is valid for struct mbuf's current structure
  and size in FreeBSD, but hardcodes assumptions about sizes of struct mbuf,
  which are unfortunately broken if additional data is added to the beginning of
  struct mbuf
  
  X-MFC note (discussed with rwatson):
  
  This change requires the MPKTHSIZE definition, which is only available after
  head@r277203 and will not be MFCed as it breaks mbuf(9) KPI.
  
  A direct commit to stable/10 and merges to other branches to add the necessary
  definitions to work with the code as-is will be done to facilitate this MFC
  
  PR: 194314
  Approved/Reviewed by: erj, jfv
  Sponsored by: EMC / Isilon Storage Division

Modified:
  stable/10/sys/dev/ixgbe/ixgbe.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/ixgbe/ixgbe.h
==============================================================================
--- stable/10/sys/dev/ixgbe/ixgbe.h	Fri Apr 24 22:05:12 2015	(r281953)
+++ stable/10/sys/dev/ixgbe/ixgbe.h	Fri Apr 24 22:18:50 2015	(r281954)
@@ -160,8 +160,9 @@
  * modern Intel CPUs, results in 40 bytes wasted and a significant drop
  * in observed efficiency of the optimization, 97.9% -> 81.8%.
  */
-#define IXGBE_RX_COPY_LEN	160
-#define IXGBE_RX_COPY_ALIGN	(MHLEN - IXGBE_RX_COPY_LEN)
+#define IXGBE_RX_COPY_HDR_PADDED	((((MPKTHSIZE - 1) / 32) + 1) * 32)
+#define IXGBE_RX_COPY_LEN		(MSIZE - IXGBE_RX_COPY_HDR_PADDED)
+#define IXGBE_RX_COPY_ALIGN		(IXGBE_RX_COPY_HDR_PADDED - MPKTHSIZE)
 
 /* Keep older OS drivers building... */
 #if !defined(SYSCTL_ADD_UQUAD)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504242218.t3OMIp7D057021>