net/mlx4_en: Fix setting initial MAC address
authorYan Burman <yanb@mellanox.com>
Tue, 2 Apr 2013 13:49:45 +0000 (16:49 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Apr 2013 16:07:56 +0000 (12:07 -0400)
Commit 6bbb6d9 "net/mlx4_en: Optimize Rx fast path filter checks" introduced a regression
under which the MAC address read from the card was not converted correctly
(the most significant byte was not handled), fix that.

Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Yan Burman <yanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c

index f278b10ef7140a6e195056e11a12075de02afabc..30d78f806dc3735dd3d8a4aa0c9a21a867976cd2 100644 (file)
@@ -411,8 +411,8 @@ static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 
 static void mlx4_en_u64_to_mac(unsigned char dst_mac[ETH_ALEN + 2], u64 src_mac)
 {
-       unsigned int i;
-       for (i = ETH_ALEN - 1; i; --i) {
+       int i;
+       for (i = ETH_ALEN - 1; i >= 0; --i) {
                dst_mac[i] = src_mac & 0xff;
                src_mac >>= 8;
        }