提交 c402b947 编写于 作者: Y Yan Burman 提交者: David S. Miller

net/mlx4_en: Use generic etherdevice.h functions.

Get rid of full_mac, zero_mac in favour of
is_zero_ether_addr and is_broadcast_ether_addr.
Signed-off-by: NYan Burman <yanb@mellanox.com>
Signed-off-by: NAmir Vadai <amirv@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d4676eac
...@@ -613,8 +613,6 @@ static int mlx4_en_validate_flow(struct net_device *dev, ...@@ -613,8 +613,6 @@ static int mlx4_en_validate_flow(struct net_device *dev,
struct ethtool_usrip4_spec *l3_mask; struct ethtool_usrip4_spec *l3_mask;
struct ethtool_tcpip4_spec *l4_mask; struct ethtool_tcpip4_spec *l4_mask;
struct ethhdr *eth_mask; struct ethhdr *eth_mask;
u64 full_mac = ~0ull;
u64 zero_mac = 0;
if (cmd->fs.location >= MAX_NUM_OF_FS_RULES) if (cmd->fs.location >= MAX_NUM_OF_FS_RULES)
return -EINVAL; return -EINVAL;
...@@ -644,11 +642,11 @@ static int mlx4_en_validate_flow(struct net_device *dev, ...@@ -644,11 +642,11 @@ static int mlx4_en_validate_flow(struct net_device *dev,
case ETHER_FLOW: case ETHER_FLOW:
eth_mask = &cmd->fs.m_u.ether_spec; eth_mask = &cmd->fs.m_u.ether_spec;
/* source mac mask must not be set */ /* source mac mask must not be set */
if (memcmp(eth_mask->h_source, &zero_mac, ETH_ALEN)) if (!is_zero_ether_addr(eth_mask->h_source))
return -EINVAL; return -EINVAL;
/* dest mac mask must be ff:ff:ff:ff:ff:ff */ /* dest mac mask must be ff:ff:ff:ff:ff:ff */
if (memcmp(eth_mask->h_dest, &full_mac, ETH_ALEN)) if (!is_broadcast_ether_addr(eth_mask->h_dest))
return -EINVAL; return -EINVAL;
if (!all_zeros_or_all_ones(eth_mask->h_proto)) if (!all_zeros_or_all_ones(eth_mask->h_proto))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册