> From: netdev-ow...@vger.kernel.org [mailto:netdev- > ow...@vger.kernel.org] On Behalf Of Alexander Duyck > Sent: Wednesday, March 2, 2016 1:16 PM > To: netdev@vger.kernel.org; jogre...@redhat.com; intel-wired- > l...@lists.osuosl.org; Kirsher, Jeffrey T <jeffrey.t.kirs...@intel.com>; > sassm...@redhat.com > Subject: [net PATCH 1/2] e1000: Do not overestimate descriptor counts in Tx > pre-check > > The current code path is capable of grossly overestimating the number of > descriptors needed to transmit a new frame. This specifically occurs if > the skb contains a number of 4K pages. The issue is that the logic for > determining the descriptors needed is ((S) >> (X)) + 1. When X is 12 it > means that we were indicating that we required 2 descriptors for each 4K > page when we only needed one. > > This change corrects this by instead adding (1 << (X)) - 1 to the S value > instead of adding 1 after the fact. This way we get an accurate descriptor > needed count as we are essentially doing a DIV_ROUNDUP(). > > Reported-by: Ivan Suzdal <isuz...@mirantis.com> > Signed-off-by: Alexander Duyck <adu...@mirantis.com> > --- > drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)
Tested-by: Aaron Brown <aaron.f.br...@intel.com>