aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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/**