Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352024
b: refs/heads/master
c: 8258bd2
h: refs/heads/master
v: v3
  • Loading branch information
Hadar Hen Zion authored and David S. Miller committed Jan 31, 2013
1 parent 6532fb7 commit a5440e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 69d7126b7fef09beaa4b7c103ec2a5bd8c8b2666
refs/heads/master: 8258bd2713c3e42bc0e5664cbede0e07587c125f
13 changes: 9 additions & 4 deletions trunk/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,12 +666,16 @@ static int mlx4_en_validate_flow(struct net_device *dev,

if ((cmd->fs.flow_type & FLOW_EXT)) {
if (cmd->fs.m_ext.vlan_etype ||
!(cmd->fs.m_ext.vlan_tci == 0 ||
cmd->fs.m_ext.vlan_tci == cpu_to_be16(0xfff)))
!((cmd->fs.m_ext.vlan_tci & cpu_to_be16(VLAN_VID_MASK)) ==
0 ||
(cmd->fs.m_ext.vlan_tci & cpu_to_be16(VLAN_VID_MASK)) ==
cpu_to_be16(VLAN_VID_MASK)))
return -EINVAL;

if (cmd->fs.m_ext.vlan_tci) {
if (be16_to_cpu(cmd->fs.h_ext.vlan_tci) >= VLAN_N_VID)
return -EINVAL;

}
}

Expand All @@ -690,9 +694,10 @@ static int mlx4_en_ethtool_add_mac_rule(struct ethtool_rxnfc *cmd,
memcpy(spec_l2->eth.dst_mac_msk, &mac_msk, ETH_ALEN);
memcpy(spec_l2->eth.dst_mac, mac, ETH_ALEN);

if ((cmd->fs.flow_type & FLOW_EXT) && cmd->fs.m_ext.vlan_tci) {
if ((cmd->fs.flow_type & FLOW_EXT) &&
(cmd->fs.m_ext.vlan_tci & cpu_to_be16(VLAN_VID_MASK))) {
spec_l2->eth.vlan_id = cmd->fs.h_ext.vlan_tci;
spec_l2->eth.vlan_id_msk = cpu_to_be16(0xfff);
spec_l2->eth.vlan_id_msk = cpu_to_be16(VLAN_VID_MASK);
}

list_add_tail(&spec_l2->list, rule_list_h);
Expand Down

0 comments on commit a5440e6

Please sign in to comment.