]> git.baikalelectronics.ru Git - kernel.git/commit
i40e: Do not directly increment Tx next_to_use
authorAlexander Duyck <alexander.h.duyck@intel.com>
Sat, 28 Sep 2013 06:00:22 +0000 (06:00 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 10 Oct 2013 04:22:01 +0000 (21:22 -0700)
commitb028fa6e2b7b53d39bf0c5e63794f35a85f8cef9
tree502943f7a5a91496891e83f3348fd804e135506e
parentbe8d861232ab43cdc5bd0cb1db3e48c347d26236
i40e: Do not directly increment Tx next_to_use

Avoid directly incrementing next_to_use for multiple reasons.  The main
reason being that if we directly increment it then it can attain a state
where it is equal to the ring count.  Technically this is a state it
should not be able to reach but the way this is written it now can.

This patch pulls the value off into a register and then increments it
and writes back either the value or 0 depending on if the value is equal
to the ring count.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c