From: Alexander Duyck Date: Thu, 31 Jan 2013 07:15:51 +0000 (+0000) Subject: igbvf: Make next_to_watch a pointer and adjust memory barriers to avoid races X-Git-Tag: v3.9-rc1~139^2~46^2~12 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3eb1a40f4b6d0c41feb60e55b53d11f70fc8ee8e;p=pandora-kernel.git igbvf: Make next_to_watch a pointer and adjust memory barriers to avoid races This change is meant to address several race issues that become possible because next_to_watch could possibly be set to a value that shows that the descriptor is done when it is not. In order to correct that we instead make next_to_watch a pointer that is set to NULL during cleanup, and set to the eop_desc after the descriptor rings have been written. To enforce proper ordering the next_to_watch pointer is not set until after a wmb writing the values to the last descriptor in a transmit. In order to guarantee that the descriptor is not read until after the eop_desc we use the read_barrier_depends which is only really necessary on the alpha architecture. Signed-off-by: Alexander Duyck Acked-by: Greg Rose Tested-by: Sibai Li Signed-off-by: Jeff Kirsher --- Reading git-diff-tree failed