diff options
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/port.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c index 575839dba8a2..98e776261ead 100644 --- a/drivers/net/ethernet/mellanox/mlx4/port.c +++ b/drivers/net/ethernet/mellanox/mlx4/port.c | |||
@@ -79,13 +79,14 @@ static int mlx4_uc_steer_add(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn) | |||
79 | { | 79 | { |
80 | struct mlx4_qp qp; | 80 | struct mlx4_qp qp; |
81 | u8 gid[16] = {0}; | 81 | u8 gid[16] = {0}; |
82 | __be64 be_mac; | ||
82 | int err; | 83 | int err; |
83 | 84 | ||
84 | qp.qpn = *qpn; | 85 | qp.qpn = *qpn; |
85 | 86 | ||
86 | mac &= 0xffffffffffffULL; | 87 | mac &= 0xffffffffffffULL; |
87 | mac = cpu_to_be64(mac << 16); | 88 | be_mac = cpu_to_be64(mac << 16); |
88 | memcpy(&gid[10], &mac, ETH_ALEN); | 89 | memcpy(&gid[10], &be_mac, ETH_ALEN); |
89 | gid[5] = port; | 90 | gid[5] = port; |
90 | 91 | ||
91 | err = mlx4_unicast_attach(dev, &qp, gid, 0, MLX4_PROT_ETH); | 92 | err = mlx4_unicast_attach(dev, &qp, gid, 0, MLX4_PROT_ETH); |
@@ -100,11 +101,12 @@ static void mlx4_uc_steer_release(struct mlx4_dev *dev, u8 port, | |||
100 | { | 101 | { |
101 | struct mlx4_qp qp; | 102 | struct mlx4_qp qp; |
102 | u8 gid[16] = {0}; | 103 | u8 gid[16] = {0}; |
104 | __be64 be_mac; | ||
103 | 105 | ||
104 | qp.qpn = qpn; | 106 | qp.qpn = qpn; |
105 | mac &= 0xffffffffffffULL; | 107 | mac &= 0xffffffffffffULL; |
106 | mac = cpu_to_be64(mac << 16); | 108 | be_mac = cpu_to_be64(mac << 16); |
107 | memcpy(&gid[10], &mac, ETH_ALEN); | 109 | memcpy(&gid[10], &be_mac, ETH_ALEN); |
108 | gid[5] = port; | 110 | gid[5] = port; |
109 | 111 | ||
110 | mlx4_unicast_detach(dev, &qp, gid, MLX4_PROT_ETH); | 112 | mlx4_unicast_detach(dev, &qp, gid, MLX4_PROT_ETH); |