aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2012-05-05 01:32:58 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-07-19 21:20:23 -0400
commitef89e0a24ea97fc9209074a19cf60e63bba18c22 (patch)
tree39f5a969af336f79d884c556e1701f42c5845486 /drivers/net
parent7fa7c9dcadcff800a897232204e2128e92dd44cd (diff)
ixgbe: Only enable anti-spoof on VF pools
The current logic is enabling anti-spoof on all pools and then clearing anti-spoof on just the first PF pool. The correct approach is to only set anti-spoof on the VF pools and to leave all of the PF pools unchecked. This allows for items such as FCoE to use adjacent pools within the PF for transmit and receive queues without the traffic being blocked by this security feature. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_common.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index bbe9d45c8436..90e41db3cb69 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -3225,20 +3225,22 @@ void ixgbe_set_mac_anti_spoofing(struct ixgbe_hw *hw, bool enable, int pf)
3225 * PFVFSPOOF register array is size 8 with 8 bits assigned to 3225 * PFVFSPOOF register array is size 8 with 8 bits assigned to
3226 * MAC anti-spoof enables in each register array element. 3226 * MAC anti-spoof enables in each register array element.
3227 */ 3227 */
3228 for (j = 0; j < IXGBE_PFVFSPOOF_REG_COUNT; j++) 3228 for (j = 0; j < pf_target_reg; j++)
3229 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(j), pfvfspoof); 3229 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(j), pfvfspoof);
3230 3230
3231 /* If not enabling anti-spoofing then done */
3232 if (!enable)
3233 return;
3234
3235 /* 3231 /*
3236 * The PF should be allowed to spoof so that it can support 3232 * The PF should be allowed to spoof so that it can support
3237 * emulation mode NICs. Reset the bit assigned to the PF 3233 * emulation mode NICs. Do not set the bits assigned to the PF
3234 */
3235 pfvfspoof &= (1 << pf_target_shift) - 1;
3236 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(j), pfvfspoof);
3237
3238 /*
3239 * Remaining pools belong to the PF so they do not need to have
3240 * anti-spoofing enabled.
3238 */ 3241 */
3239 pfvfspoof = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(pf_target_reg)); 3242 for (j++; j < IXGBE_PFVFSPOOF_REG_COUNT; j++)
3240 pfvfspoof ^= (1 << pf_target_shift); 3243 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(j), 0);
3241 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(pf_target_reg), pfvfspoof);
3242} 3244}
3243 3245
3244/** 3246/**