diff options
author | Anton Blanchard <anton@samba.org> | 2011-10-14 01:31:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-17 19:00:55 -0400 |
commit | 2cb1deb56f5bf413da83491e0cb5a0474393c8ef (patch) | |
tree | 8305a957a114d49fec1f4c6af1009e9acd754b0b /drivers/net/ethernet/ibm | |
parent | 239c562c94dcdd2aeb3d0c0e604627dec043183e (diff) |
ehea: Remove LRO support
In preparation for adding GRO to ehea, remove LRO.
v3:
[cascardo] fixed conflict with vlan cleanup
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ibm')
-rw-r--r-- | drivers/net/ethernet/ibm/ehea/ehea.h | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/ibm/ehea/ehea_ethtool.c | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/ibm/ehea/ehea_main.c | 61 |
3 files changed, 1 insertions, 83 deletions
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h index c9dbe5258ca..410d6a1984e 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea.h +++ b/drivers/net/ethernet/ibm/ehea/ehea.h | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/ethtool.h> | 33 | #include <linux/ethtool.h> |
34 | #include <linux/vmalloc.h> | 34 | #include <linux/vmalloc.h> |
35 | #include <linux/if_vlan.h> | 35 | #include <linux/if_vlan.h> |
36 | #include <linux/inet_lro.h> | ||
37 | 36 | ||
38 | #include <asm/ibmebus.h> | 37 | #include <asm/ibmebus.h> |
39 | #include <asm/abs_addr.h> | 38 | #include <asm/abs_addr.h> |
@@ -58,7 +57,6 @@ | |||
58 | #define EHEA_MIN_ENTRIES_QP 127 | 57 | #define EHEA_MIN_ENTRIES_QP 127 |
59 | 58 | ||
60 | #define EHEA_SMALL_QUEUES | 59 | #define EHEA_SMALL_QUEUES |
61 | #define EHEA_LRO_MAX_AGGR 64 | ||
62 | 60 | ||
63 | #ifdef EHEA_SMALL_QUEUES | 61 | #ifdef EHEA_SMALL_QUEUES |
64 | #define EHEA_MAX_CQE_COUNT 1023 | 62 | #define EHEA_MAX_CQE_COUNT 1023 |
@@ -85,8 +83,6 @@ | |||
85 | #define EHEA_RQ2_PKT_SIZE 2048 | 83 | #define EHEA_RQ2_PKT_SIZE 2048 |
86 | #define EHEA_L_PKT_SIZE 256 /* low latency */ | 84 | #define EHEA_L_PKT_SIZE 256 /* low latency */ |
87 | 85 | ||
88 | #define MAX_LRO_DESCRIPTORS 8 | ||
89 | |||
90 | /* Send completion signaling */ | 86 | /* Send completion signaling */ |
91 | 87 | ||
92 | /* Protection Domain Identifier */ | 88 | /* Protection Domain Identifier */ |
@@ -382,8 +378,6 @@ struct ehea_port_res { | |||
382 | u64 tx_bytes; | 378 | u64 tx_bytes; |
383 | u64 rx_packets; | 379 | u64 rx_packets; |
384 | u64 rx_bytes; | 380 | u64 rx_bytes; |
385 | struct net_lro_mgr lro_mgr; | ||
386 | struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS]; | ||
387 | int sq_restart_flag; | 381 | int sq_restart_flag; |
388 | }; | 382 | }; |
389 | 383 | ||
@@ -468,7 +462,6 @@ struct ehea_port { | |||
468 | u32 msg_enable; | 462 | u32 msg_enable; |
469 | u32 sig_comp_iv; | 463 | u32 sig_comp_iv; |
470 | u32 state; | 464 | u32 state; |
471 | u32 lro_max_aggr; | ||
472 | u8 phy_link; | 465 | u8 phy_link; |
473 | u8 full_duplex; | 466 | u8 full_duplex; |
474 | u8 autoneg; | 467 | u8 autoneg; |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c b/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c index d185016c79e..05b7359bde8 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c | |||
@@ -205,9 +205,6 @@ static const char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = { | |||
205 | {"PR13 free_swqes"}, | 205 | {"PR13 free_swqes"}, |
206 | {"PR14 free_swqes"}, | 206 | {"PR14 free_swqes"}, |
207 | {"PR15 free_swqes"}, | 207 | {"PR15 free_swqes"}, |
208 | {"LRO aggregated"}, | ||
209 | {"LRO flushed"}, | ||
210 | {"LRO no_desc"}, | ||
211 | }; | 208 | }; |
212 | 209 | ||
213 | static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data) | 210 | static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data) |
@@ -264,19 +261,6 @@ static void ehea_get_ethtool_stats(struct net_device *dev, | |||
264 | 261 | ||
265 | for (k = 0; k < 16; k++) | 262 | for (k = 0; k < 16; k++) |
266 | data[i++] = atomic_read(&port->port_res[k].swqe_avail); | 263 | data[i++] = atomic_read(&port->port_res[k].swqe_avail); |
267 | |||
268 | for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++) | ||
269 | tmp |= port->port_res[k].lro_mgr.stats.aggregated; | ||
270 | data[i++] = tmp; | ||
271 | |||
272 | for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++) | ||
273 | tmp |= port->port_res[k].lro_mgr.stats.flushed; | ||
274 | data[i++] = tmp; | ||
275 | |||
276 | for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++) | ||
277 | tmp |= port->port_res[k].lro_mgr.stats.no_desc; | ||
278 | data[i++] = tmp; | ||
279 | |||
280 | } | 264 | } |
281 | 265 | ||
282 | const struct ethtool_ops ehea_ethtool_ops = { | 266 | const struct ethtool_ops ehea_ethtool_ops = { |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index a0a3c5f747c..3b8e6574da0 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
@@ -62,8 +62,6 @@ static int rq2_entries = EHEA_DEF_ENTRIES_RQ2; | |||
62 | static int rq3_entries = EHEA_DEF_ENTRIES_RQ3; | 62 | static int rq3_entries = EHEA_DEF_ENTRIES_RQ3; |
63 | static int sq_entries = EHEA_DEF_ENTRIES_SQ; | 63 | static int sq_entries = EHEA_DEF_ENTRIES_SQ; |
64 | static int use_mcs = 1; | 64 | static int use_mcs = 1; |
65 | static int use_lro; | ||
66 | static int lro_max_aggr = EHEA_LRO_MAX_AGGR; | ||
67 | static int prop_carrier_state; | 65 | static int prop_carrier_state; |
68 | 66 | ||
69 | module_param(msg_level, int, 0); | 67 | module_param(msg_level, int, 0); |
@@ -73,8 +71,6 @@ module_param(rq3_entries, int, 0); | |||
73 | module_param(sq_entries, int, 0); | 71 | module_param(sq_entries, int, 0); |
74 | module_param(prop_carrier_state, int, 0); | 72 | module_param(prop_carrier_state, int, 0); |
75 | module_param(use_mcs, int, 0); | 73 | module_param(use_mcs, int, 0); |
76 | module_param(use_lro, int, 0); | ||
77 | module_param(lro_max_aggr, int, 0); | ||
78 | 74 | ||
79 | MODULE_PARM_DESC(msg_level, "msg_level"); | 75 | MODULE_PARM_DESC(msg_level, "msg_level"); |
80 | MODULE_PARM_DESC(prop_carrier_state, "Propagate carrier state of physical " | 76 | MODULE_PARM_DESC(prop_carrier_state, "Propagate carrier state of physical " |
@@ -94,11 +90,6 @@ MODULE_PARM_DESC(sq_entries, " Number of entries for the Send Queue " | |||
94 | MODULE_PARM_DESC(use_mcs, " Multiple receive queues, 1: enable, 0: disable, " | 90 | MODULE_PARM_DESC(use_mcs, " Multiple receive queues, 1: enable, 0: disable, " |
95 | "Default = 1"); | 91 | "Default = 1"); |
96 | 92 | ||
97 | MODULE_PARM_DESC(lro_max_aggr, " LRO: Max packets to be aggregated. Default = " | ||
98 | __MODULE_STRING(EHEA_LRO_MAX_AGGR)); | ||
99 | MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, " | ||
100 | "Default = 0"); | ||
101 | |||
102 | static int port_name_cnt; | 93 | static int port_name_cnt; |
103 | static LIST_HEAD(adapter_list); | 94 | static LIST_HEAD(adapter_list); |
104 | static unsigned long ehea_driver_flags; | 95 | static unsigned long ehea_driver_flags; |
@@ -656,47 +647,13 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq, | |||
656 | return 0; | 647 | return 0; |
657 | } | 648 | } |
658 | 649 | ||
659 | static int get_skb_hdr(struct sk_buff *skb, void **iphdr, | ||
660 | void **tcph, u64 *hdr_flags, void *priv) | ||
661 | { | ||
662 | struct ehea_cqe *cqe = priv; | ||
663 | unsigned int ip_len; | ||
664 | struct iphdr *iph; | ||
665 | |||
666 | /* non tcp/udp packets */ | ||
667 | if (!cqe->header_length) | ||
668 | return -1; | ||
669 | |||
670 | /* non tcp packet */ | ||
671 | skb_reset_network_header(skb); | ||
672 | iph = ip_hdr(skb); | ||
673 | if (iph->protocol != IPPROTO_TCP) | ||
674 | return -1; | ||
675 | |||
676 | ip_len = ip_hdrlen(skb); | ||
677 | skb_set_transport_header(skb, ip_len); | ||
678 | *tcph = tcp_hdr(skb); | ||
679 | |||
680 | /* check if ip header and tcp header are complete */ | ||
681 | if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb)) | ||
682 | return -1; | ||
683 | |||
684 | *hdr_flags = LRO_IPV4 | LRO_TCP; | ||
685 | *iphdr = iph; | ||
686 | |||
687 | return 0; | ||
688 | } | ||
689 | |||
690 | static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, | 650 | static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, |
691 | struct sk_buff *skb) | 651 | struct sk_buff *skb) |
692 | { | 652 | { |
693 | if (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) | 653 | if (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) |
694 | __vlan_hwaccel_put_tag(skb, cqe->vlan_tag); | 654 | __vlan_hwaccel_put_tag(skb, cqe->vlan_tag); |
695 | 655 | ||
696 | if (skb->dev->features & NETIF_F_LRO) | 656 | netif_receive_skb(skb); |
697 | lro_receive_skb(&pr->lro_mgr, skb, cqe); | ||
698 | else | ||
699 | netif_receive_skb(skb); | ||
700 | } | 657 | } |
701 | 658 | ||
702 | static int ehea_proc_rwqes(struct net_device *dev, | 659 | static int ehea_proc_rwqes(struct net_device *dev, |
@@ -786,8 +743,6 @@ static int ehea_proc_rwqes(struct net_device *dev, | |||
786 | } | 743 | } |
787 | cqe = ehea_poll_rq1(qp, &wqe_index); | 744 | cqe = ehea_poll_rq1(qp, &wqe_index); |
788 | } | 745 | } |
789 | if (dev->features & NETIF_F_LRO) | ||
790 | lro_flush_all(&pr->lro_mgr); | ||
791 | 746 | ||
792 | pr->rx_packets += processed; | 747 | pr->rx_packets += processed; |
793 | pr->rx_bytes += processed_bytes; | 748 | pr->rx_bytes += processed_bytes; |
@@ -1611,15 +1566,6 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr, | |||
1611 | 1566 | ||
1612 | netif_napi_add(pr->port->netdev, &pr->napi, ehea_poll, 64); | 1567 | netif_napi_add(pr->port->netdev, &pr->napi, ehea_poll, 64); |
1613 | 1568 | ||
1614 | pr->lro_mgr.max_aggr = pr->port->lro_max_aggr; | ||
1615 | pr->lro_mgr.max_desc = MAX_LRO_DESCRIPTORS; | ||
1616 | pr->lro_mgr.lro_arr = pr->lro_desc; | ||
1617 | pr->lro_mgr.get_skb_header = get_skb_hdr; | ||
1618 | pr->lro_mgr.features = LRO_F_NAPI | LRO_F_EXTRACT_VLAN_ID; | ||
1619 | pr->lro_mgr.dev = port->netdev; | ||
1620 | pr->lro_mgr.ip_summed = CHECKSUM_UNNECESSARY; | ||
1621 | pr->lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY; | ||
1622 | |||
1623 | ret = 0; | 1569 | ret = 0; |
1624 | goto out; | 1570 | goto out; |
1625 | 1571 | ||
@@ -3082,9 +3028,6 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | |||
3082 | NETIF_F_IP_CSUM; | 3028 | NETIF_F_IP_CSUM; |
3083 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; | 3029 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; |
3084 | 3030 | ||
3085 | if (use_lro) | ||
3086 | dev->features |= NETIF_F_LRO; | ||
3087 | |||
3088 | INIT_WORK(&port->reset_task, ehea_reset_port); | 3031 | INIT_WORK(&port->reset_task, ehea_reset_port); |
3089 | INIT_DELAYED_WORK(&port->stats_work, ehea_update_stats); | 3032 | INIT_DELAYED_WORK(&port->stats_work, ehea_update_stats); |
3090 | 3033 | ||
@@ -3098,8 +3041,6 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | |||
3098 | goto out_unreg_port; | 3041 | goto out_unreg_port; |
3099 | } | 3042 | } |
3100 | 3043 | ||
3101 | port->lro_max_aggr = lro_max_aggr; | ||
3102 | |||
3103 | ret = ehea_get_jumboframe_status(port, &jumbo); | 3044 | ret = ehea_get_jumboframe_status(port, &jumbo); |
3104 | if (ret) | 3045 | if (ret) |
3105 | netdev_err(dev, "failed determining jumbo frame status\n"); | 3046 | netdev_err(dev, "failed determining jumbo frame status\n"); |