net/mlx4: Spoofcheck and zero MAC can't coexist
Spoofcheck can't be enabled if VF MAC is zero.
Vice versa, can't zero MAC if spoofcheck is on.
Fixes: 8f7ba3ca12
('net/mlx4: Add set VF mac address support')
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
423b3aecf2
commit
745d8ae462
@@ -308,7 +308,7 @@ int mlx4_get_counter_stats(struct mlx4_dev *dev, int counter_index,
|
||||
int mlx4_get_vf_stats(struct mlx4_dev *dev, int port, int vf_idx,
|
||||
struct ifla_vf_stats *vf_stats);
|
||||
u32 mlx4_comm_get_version(void);
|
||||
int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac);
|
||||
int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u8 *mac);
|
||||
int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan,
|
||||
u8 qos, __be16 proto);
|
||||
int mlx4_set_vf_rate(struct mlx4_dev *dev, int port, int vf, int min_tx_rate,
|
||||
|
@@ -104,4 +104,14 @@ static inline u64 mlx4_mac_to_u64(u8 *addr)
|
||||
return mac;
|
||||
}
|
||||
|
||||
static inline void mlx4_u64_to_mac(u8 *addr, u64 mac)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = ETH_ALEN; i > 0; i--) {
|
||||
addr[i - 1] = mac && 0xFF;
|
||||
mac >>= 8;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* MLX4_DRIVER_H */
|
||||
|
Reference in New Issue
Block a user