Commit af22d9de authored by Amir Vadai's avatar Amir Vadai Committed by David S. Miller

net/mlx4: Move MAC_MASK to a common place

Define this macro is one common place instead of duplicating it over the code
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0cc535a2
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/mlx4/driver.h>
#include "mlx4_en.h" #include "mlx4_en.h"
#include "en_port.h" #include "en_port.h"
#define EN_ETHTOOL_QP_ATTACH (1ull << 63) #define EN_ETHTOOL_QP_ATTACH (1ull << 63)
#define EN_ETHTOOL_MAC_MASK 0xffffffffffffULL
#define EN_ETHTOOL_SHORT_MASK cpu_to_be16(0xffff) #define EN_ETHTOOL_SHORT_MASK cpu_to_be16(0xffff)
#define EN_ETHTOOL_WORD_MASK cpu_to_be32(0xffffffff) #define EN_ETHTOOL_WORD_MASK cpu_to_be32(0xffffffff)
...@@ -751,7 +751,7 @@ static int mlx4_en_ethtool_to_net_trans_rule(struct net_device *dev, ...@@ -751,7 +751,7 @@ static int mlx4_en_ethtool_to_net_trans_rule(struct net_device *dev,
struct ethhdr *eth_spec; struct ethhdr *eth_spec;
struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_spec_list *spec_l2; struct mlx4_spec_list *spec_l2;
__be64 mac_msk = cpu_to_be64(EN_ETHTOOL_MAC_MASK << 16); __be64 mac_msk = cpu_to_be64(MLX4_MAC_MASK << 16);
err = mlx4_en_validate_flow(dev, cmd); err = mlx4_en_validate_flow(dev, cmd);
if (err) if (err)
...@@ -761,7 +761,7 @@ static int mlx4_en_ethtool_to_net_trans_rule(struct net_device *dev, ...@@ -761,7 +761,7 @@ static int mlx4_en_ethtool_to_net_trans_rule(struct net_device *dev,
if (!spec_l2) if (!spec_l2)
return -ENOMEM; return -ENOMEM;
mac = priv->mac & EN_ETHTOOL_MAC_MASK; mac = priv->mac & MLX4_MAC_MASK;
be_mac = cpu_to_be64(mac << 16); be_mac = cpu_to_be64(mac << 16);
spec_l2->id = MLX4_NET_TRANS_RULE_ID_ETH; spec_l2->id = MLX4_NET_TRANS_RULE_ID_ETH;
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#define MGM_QPN_MASK 0x00FFFFFF #define MGM_QPN_MASK 0x00FFFFFF
#define MGM_BLCK_LB_BIT 30 #define MGM_BLCK_LB_BIT 30
#define MLX4_MAC_MASK 0xffffffffffffULL
static const u8 zero_gid[16]; /* automatically initialized to 0 */ static const u8 zero_gid[16]; /* automatically initialized to 0 */
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "mlx4.h" #include "mlx4.h"
#define MLX4_MAC_VALID (1ull << 63) #define MLX4_MAC_VALID (1ull << 63)
#define MLX4_MAC_MASK 0xffffffffffffULL
#define MLX4_VLAN_VALID (1u << 31) #define MLX4_VLAN_VALID (1u << 31)
#define MLX4_VLAN_MASK 0xfff #define MLX4_VLAN_MASK 0xfff
......
...@@ -41,13 +41,12 @@ ...@@ -41,13 +41,12 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mlx4/cmd.h> #include <linux/mlx4/cmd.h>
#include <linux/mlx4/qp.h> #include <linux/mlx4/qp.h>
#include <linux/if_ether.h>
#include "mlx4.h" #include "mlx4.h"
#include "fw.h" #include "fw.h"
#define MLX4_MAC_VALID (1ull << 63) #define MLX4_MAC_VALID (1ull << 63)
#define MLX4_MAC_MASK 0x7fffffffffffffffULL
#define ETH_ALEN 6
struct mac_res { struct mac_res {
struct list_head list; struct list_head list;
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
struct mlx4_dev; struct mlx4_dev;
#define MLX4_MAC_MASK 0xffffffffffffULL
enum mlx4_dev_event { enum mlx4_dev_event {
MLX4_DEV_EVENT_CATASTROPHIC_ERROR, MLX4_DEV_EVENT_CATASTROPHIC_ERROR,
MLX4_DEV_EVENT_PORT_UP, MLX4_DEV_EVENT_PORT_UP,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment