aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_ethtool.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_ethtool.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index 4aaa7c3ad22f..cc7bb25c7e40 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -613,8 +613,6 @@ static int mlx4_en_validate_flow(struct net_device *dev,
613 struct ethtool_usrip4_spec *l3_mask; 613 struct ethtool_usrip4_spec *l3_mask;
614 struct ethtool_tcpip4_spec *l4_mask; 614 struct ethtool_tcpip4_spec *l4_mask;
615 struct ethhdr *eth_mask; 615 struct ethhdr *eth_mask;
616 u64 full_mac = ~0ull;
617 u64 zero_mac = 0;
618 616
619 if (cmd->fs.location >= MAX_NUM_OF_FS_RULES) 617 if (cmd->fs.location >= MAX_NUM_OF_FS_RULES)
620 return -EINVAL; 618 return -EINVAL;
@@ -644,11 +642,11 @@ static int mlx4_en_validate_flow(struct net_device *dev,
644 case ETHER_FLOW: 642 case ETHER_FLOW:
645 eth_mask = &cmd->fs.m_u.ether_spec; 643 eth_mask = &cmd->fs.m_u.ether_spec;
646 /* source mac mask must not be set */ 644 /* source mac mask must not be set */
647 if (memcmp(eth_mask->h_source, &zero_mac, ETH_ALEN)) 645 if (!is_zero_ether_addr(eth_mask->h_source))
648 return -EINVAL; 646 return -EINVAL;
649 647
650 /* dest mac mask must be ff:ff:ff:ff:ff:ff */ 648 /* dest mac mask must be ff:ff:ff:ff:ff:ff */
651 if (memcmp(eth_mask->h_dest, &full_mac, ETH_ALEN)) 649 if (!is_broadcast_ether_addr(eth_mask->h_dest))
652 return -EINVAL; 650 return -EINVAL;
653 651
654 if (!all_zeros_or_all_ones(eth_mask->h_proto)) 652 if (!all_zeros_or_all_ones(eth_mask->h_proto))