aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_ethtool.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index f33049f9bfe7..f36c219dffcf 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -666,12 +666,16 @@ static int mlx4_en_validate_flow(struct net_device *dev,
666 666
667 if ((cmd->fs.flow_type & FLOW_EXT)) { 667 if ((cmd->fs.flow_type & FLOW_EXT)) {
668 if (cmd->fs.m_ext.vlan_etype || 668 if (cmd->fs.m_ext.vlan_etype ||
669 !(cmd->fs.m_ext.vlan_tci == 0 || 669 !((cmd->fs.m_ext.vlan_tci & cpu_to_be16(VLAN_VID_MASK)) ==
670 cmd->fs.m_ext.vlan_tci == cpu_to_be16(0xfff))) 670 0 ||
671 (cmd->fs.m_ext.vlan_tci & cpu_to_be16(VLAN_VID_MASK)) ==
672 cpu_to_be16(VLAN_VID_MASK)))
671 return -EINVAL; 673 return -EINVAL;
674
672 if (cmd->fs.m_ext.vlan_tci) { 675 if (cmd->fs.m_ext.vlan_tci) {
673 if (be16_to_cpu(cmd->fs.h_ext.vlan_tci) >= VLAN_N_VID) 676 if (be16_to_cpu(cmd->fs.h_ext.vlan_tci) >= VLAN_N_VID)
674 return -EINVAL; 677 return -EINVAL;
678
675 } 679 }
676 } 680 }
677 681
@@ -690,9 +694,10 @@ static int mlx4_en_ethtool_add_mac_rule(struct ethtool_rxnfc *cmd,
690 memcpy(spec_l2->eth.dst_mac_msk, &mac_msk, ETH_ALEN); 694 memcpy(spec_l2->eth.dst_mac_msk, &mac_msk, ETH_ALEN);
691 memcpy(spec_l2->eth.dst_mac, mac, ETH_ALEN); 695 memcpy(spec_l2->eth.dst_mac, mac, ETH_ALEN);
692 696
693 if ((cmd->fs.flow_type & FLOW_EXT) && cmd->fs.m_ext.vlan_tci) { 697 if ((cmd->fs.flow_type & FLOW_EXT) &&
698 (cmd->fs.m_ext.vlan_tci & cpu_to_be16(VLAN_VID_MASK))) {
694 spec_l2->eth.vlan_id = cmd->fs.h_ext.vlan_tci; 699 spec_l2->eth.vlan_id = cmd->fs.h_ext.vlan_tci;
695 spec_l2->eth.vlan_id_msk = cpu_to_be16(0xfff); 700 spec_l2->eth.vlan_id_msk = cpu_to_be16(VLAN_VID_MASK);
696 } 701 }
697 702
698 list_add_tail(&spec_l2->list, rule_list_h); 703 list_add_tail(&spec_l2->list, rule_list_h);