summaryrefslogtreecommitdiffstats
path: root/include/linux/mlx4/driver.h
diff options
context:
space:
mode:
authorEugenia Emantayev <eugenia@mellanox.com>2017-02-23 12:02:42 +0200
committerDavid S. Miller <davem@davemloft.net>2017-02-23 10:57:56 -0500
commit745d8ae4622c6808b22e33a944c7decb30074be4 (patch)
tree56b55f8e44f2678025ad8551d0e8d8e983f31ab1 /include/linux/mlx4/driver.h
parent423b3aecf29085a52530d4f9167c56a84b081042 (diff)
downloadlinux-745d8ae4622c6808b22e33a944c7decb30074be4.tar.gz
linux-745d8ae4622c6808b22e33a944c7decb30074be4.tar.xz
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: 8f7ba3ca12f6 ('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>
Diffstat (limited to 'include/linux/mlx4/driver.h')
-rw-r--r--include/linux/mlx4/driver.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index bd0e7075ea6d..e965e5090d96 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -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 */