aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2011-07-20 00:54:07 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-21 16:47:53 -0400
commitb49500957a2c90a559dd91f0dcfeb83d84458664 (patch)
treeb776fdec11b66f39fbf4412241af993fb1b385da
parent7033c4ad87c3cf1050eb8190c93f94f5c8b9fae9 (diff)
ehea: do vlan cleanup
- unify vlan and nonvlan rx path - kill port->vgrp and ehea_vlan_rx_register Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ehea/ehea.h1
-rw-r--r--drivers/net/ehea/ehea_main.c54
2 files changed, 7 insertions, 48 deletions
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 6c7257bd73fc..7dd5e6a0d998 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -457,7 +457,6 @@ struct ehea_port {
457 struct ehea_port_res port_res[EHEA_MAX_PORT_RES]; 457 struct ehea_port_res port_res[EHEA_MAX_PORT_RES];
458 struct platform_device ofdev; /* Open Firmware Device */ 458 struct platform_device ofdev; /* Open Firmware Device */
459 struct ehea_mc_list *mc_list; /* Multicast MAC addresses */ 459 struct ehea_mc_list *mc_list; /* Multicast MAC addresses */
460 struct vlan_group *vgrp;
461 struct ehea_eq *qp_eq; 460 struct ehea_eq *qp_eq;
462 struct work_struct reset_task; 461 struct work_struct reset_task;
463 struct mutex port_lock; 462 struct mutex port_lock;
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 3fd5a2400348..be2cb4ab8b4f 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -683,24 +683,13 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
683static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, 683static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe,
684 struct sk_buff *skb) 684 struct sk_buff *skb)
685{ 685{
686 int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && 686 if (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT)
687 pr->port->vgrp); 687 __vlan_hwaccel_put_tag(skb, cqe->vlan_tag);
688 688
689 if (skb->dev->features & NETIF_F_LRO) { 689 if (skb->dev->features & NETIF_F_LRO)
690 if (vlan_extracted) 690 lro_receive_skb(&pr->lro_mgr, skb, cqe);
691 lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, 691 else
692 pr->port->vgrp, 692 netif_receive_skb(skb);
693 cqe->vlan_tag,
694 cqe);
695 else
696 lro_receive_skb(&pr->lro_mgr, skb, cqe);
697 } else {
698 if (vlan_extracted)
699 vlan_hwaccel_receive_skb(skb, pr->port->vgrp,
700 cqe->vlan_tag);
701 else
702 netif_receive_skb(skb);
703 }
704} 693}
705 694
706static int ehea_proc_rwqes(struct net_device *dev, 695static int ehea_proc_rwqes(struct net_device *dev,
@@ -2339,32 +2328,6 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
2339 return NETDEV_TX_OK; 2328 return NETDEV_TX_OK;
2340} 2329}
2341 2330
2342static void ehea_vlan_rx_register(struct net_device *dev,
2343 struct vlan_group *grp)
2344{
2345 struct ehea_port *port = netdev_priv(dev);
2346 struct ehea_adapter *adapter = port->adapter;
2347 struct hcp_ehea_port_cb1 *cb1;
2348 u64 hret;
2349
2350 port->vgrp = grp;
2351
2352 cb1 = (void *)get_zeroed_page(GFP_KERNEL);
2353 if (!cb1) {
2354 pr_err("no mem for cb1\n");
2355 goto out;
2356 }
2357
2358 hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
2359 H_PORT_CB1, H_PORT_CB1_ALL, cb1);
2360 if (hret != H_SUCCESS)
2361 pr_err("modify_ehea_port failed\n");
2362
2363 free_page((unsigned long)cb1);
2364out:
2365 return;
2366}
2367
2368static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 2331static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
2369{ 2332{
2370 struct ehea_port *port = netdev_priv(dev); 2333 struct ehea_port *port = netdev_priv(dev);
@@ -2406,8 +2369,6 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
2406 int index; 2369 int index;
2407 u64 hret; 2370 u64 hret;
2408 2371
2409 vlan_group_set_device(port->vgrp, vid, NULL);
2410
2411 cb1 = (void *)get_zeroed_page(GFP_KERNEL); 2372 cb1 = (void *)get_zeroed_page(GFP_KERNEL);
2412 if (!cb1) { 2373 if (!cb1) {
2413 pr_err("no mem for cb1\n"); 2374 pr_err("no mem for cb1\n");
@@ -3202,7 +3163,6 @@ static const struct net_device_ops ehea_netdev_ops = {
3202 .ndo_validate_addr = eth_validate_addr, 3163 .ndo_validate_addr = eth_validate_addr,
3203 .ndo_set_multicast_list = ehea_set_multicast_list, 3164 .ndo_set_multicast_list = ehea_set_multicast_list,
3204 .ndo_change_mtu = ehea_change_mtu, 3165 .ndo_change_mtu = ehea_change_mtu,
3205 .ndo_vlan_rx_register = ehea_vlan_rx_register,
3206 .ndo_vlan_rx_add_vid = ehea_vlan_rx_add_vid, 3166 .ndo_vlan_rx_add_vid = ehea_vlan_rx_add_vid,
3207 .ndo_vlan_rx_kill_vid = ehea_vlan_rx_kill_vid, 3167 .ndo_vlan_rx_kill_vid = ehea_vlan_rx_kill_vid,
3208 .ndo_tx_timeout = ehea_tx_watchdog, 3168 .ndo_tx_timeout = ehea_tx_watchdog,