diff options
author | Ajit Khaparde <ajit.khaparde@emulex.com> | 2011-07-13 01:10:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-13 01:10:01 -0400 |
commit | 4c5102f94c175d81790a3a288e85efd4a8a1649a (patch) | |
tree | a6b46dd6a8eefb58cb13f208b520e9d98badd363 | |
parent | 1e75896294d282ecd5b1717fcb3f6aa2908d5946 (diff) |
be2net: move to new vlan model
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/benet/be.h | 1 | ||||
-rw-r--r-- | drivers/net/benet/be_main.c | 34 |
2 files changed, 9 insertions, 26 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index 72ec00f2d032..c85768cd1b18 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -333,7 +333,6 @@ struct be_adapter { | |||
333 | u8 eq_next_idx; | 333 | u8 eq_next_idx; |
334 | struct be_drv_stats drv_stats; | 334 | struct be_drv_stats drv_stats; |
335 | 335 | ||
336 | struct vlan_group *vlan_grp; | ||
337 | u16 vlans_added; | 336 | u16 vlans_added; |
338 | u16 max_vlans; /* Number of vlans supported */ | 337 | u16 max_vlans; /* Number of vlans supported */ |
339 | u8 vlan_tag[VLAN_N_VID]; | 338 | u8 vlan_tag[VLAN_N_VID]; |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index f7d6d9de6a01..ae2d2622a18e 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -654,7 +654,7 @@ static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr, | |||
654 | AMAP_SET_BITS(struct amap_eth_hdr_wrb, udpcs, hdr, 1); | 654 | AMAP_SET_BITS(struct amap_eth_hdr_wrb, udpcs, hdr, 1); |
655 | } | 655 | } |
656 | 656 | ||
657 | if (adapter->vlan_grp && vlan_tx_tag_present(skb)) { | 657 | if (vlan_tx_tag_present(skb)) { |
658 | AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan, hdr, 1); | 658 | AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan, hdr, 1); |
659 | vlan_tag = vlan_tx_tag_get(skb); | 659 | vlan_tag = vlan_tx_tag_get(skb); |
660 | vlan_prio = (vlan_tag & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT; | 660 | vlan_prio = (vlan_tag & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT; |
@@ -847,13 +847,6 @@ static int be_vid_config(struct be_adapter *adapter, bool vf, u32 vf_num) | |||
847 | return status; | 847 | return status; |
848 | } | 848 | } |
849 | 849 | ||
850 | static void be_vlan_register(struct net_device *netdev, struct vlan_group *grp) | ||
851 | { | ||
852 | struct be_adapter *adapter = netdev_priv(netdev); | ||
853 | |||
854 | adapter->vlan_grp = grp; | ||
855 | } | ||
856 | |||
857 | static void be_vlan_add_vid(struct net_device *netdev, u16 vid) | 850 | static void be_vlan_add_vid(struct net_device *netdev, u16 vid) |
858 | { | 851 | { |
859 | struct be_adapter *adapter = netdev_priv(netdev); | 852 | struct be_adapter *adapter = netdev_priv(netdev); |
@@ -872,7 +865,6 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) | |||
872 | struct be_adapter *adapter = netdev_priv(netdev); | 865 | struct be_adapter *adapter = netdev_priv(netdev); |
873 | 866 | ||
874 | adapter->vlans_added--; | 867 | adapter->vlans_added--; |
875 | vlan_group_set_device(adapter->vlan_grp, vid, NULL); | ||
876 | 868 | ||
877 | if (!be_physfn(adapter)) | 869 | if (!be_physfn(adapter)) |
878 | return; | 870 | return; |
@@ -1200,16 +1192,10 @@ static void be_rx_compl_process(struct be_adapter *adapter, | |||
1200 | skb->rxhash = rxcp->rss_hash; | 1192 | skb->rxhash = rxcp->rss_hash; |
1201 | 1193 | ||
1202 | 1194 | ||
1203 | if (unlikely(rxcp->vlanf)) { | 1195 | if (unlikely(rxcp->vlanf)) |
1204 | if (!adapter->vlan_grp || adapter->vlans_added == 0) { | 1196 | __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag); |
1205 | kfree_skb(skb); | 1197 | |
1206 | return; | 1198 | netif_receive_skb(skb); |
1207 | } | ||
1208 | vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, | ||
1209 | rxcp->vlan_tag); | ||
1210 | } else { | ||
1211 | netif_receive_skb(skb); | ||
1212 | } | ||
1213 | } | 1199 | } |
1214 | 1200 | ||
1215 | /* Process the RX completion indicated by rxcp when GRO is enabled */ | 1201 | /* Process the RX completion indicated by rxcp when GRO is enabled */ |
@@ -1263,11 +1249,10 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, | |||
1263 | if (adapter->netdev->features & NETIF_F_RXHASH) | 1249 | if (adapter->netdev->features & NETIF_F_RXHASH) |
1264 | skb->rxhash = rxcp->rss_hash; | 1250 | skb->rxhash = rxcp->rss_hash; |
1265 | 1251 | ||
1266 | if (likely(!rxcp->vlanf)) | 1252 | if (unlikely(rxcp->vlanf)) |
1267 | napi_gro_frags(&eq_obj->napi); | 1253 | __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag); |
1268 | else | 1254 | |
1269 | vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp, | 1255 | napi_gro_frags(&eq_obj->napi); |
1270 | rxcp->vlan_tag); | ||
1271 | } | 1256 | } |
1272 | 1257 | ||
1273 | static void be_parse_rx_compl_v1(struct be_adapter *adapter, | 1258 | static void be_parse_rx_compl_v1(struct be_adapter *adapter, |
@@ -2950,7 +2935,6 @@ static struct net_device_ops be_netdev_ops = { | |||
2950 | .ndo_set_mac_address = be_mac_addr_set, | 2935 | .ndo_set_mac_address = be_mac_addr_set, |
2951 | .ndo_change_mtu = be_change_mtu, | 2936 | .ndo_change_mtu = be_change_mtu, |
2952 | .ndo_validate_addr = eth_validate_addr, | 2937 | .ndo_validate_addr = eth_validate_addr, |
2953 | .ndo_vlan_rx_register = be_vlan_register, | ||
2954 | .ndo_vlan_rx_add_vid = be_vlan_add_vid, | 2938 | .ndo_vlan_rx_add_vid = be_vlan_add_vid, |
2955 | .ndo_vlan_rx_kill_vid = be_vlan_rem_vid, | 2939 | .ndo_vlan_rx_kill_vid = be_vlan_rem_vid, |
2956 | .ndo_set_vf_mac = be_set_vf_mac, | 2940 | .ndo_set_vf_mac = be_set_vf_mac, |