diff options
author | Or Gerlitz <ogerlitz@voltaire.com> | 2011-01-10 20:41:54 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2011-01-10 20:41:54 -0500 |
commit | 19e364f6801e38972673278adedaab1abf6f854c (patch) | |
tree | ba2d39f4f449e9b1e911e6d5cbc39e08e54410c3 /drivers/infiniband/ulp/ipoib/ipoib_main.c | |
parent | 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (diff) |
IPoIB: Remove LRO support
As a first step in moving from LRO to GRO, revert commit af40da894e9
("IPoIB: add LRO support"). Also eliminate the ethtool set_flags
callback which isn't needed anymore. Finally, we need to include
<linux/sched.h> directly to get the declaration of restart_syscall()
(which used to be included implicitly through <linux/inet_lro.h>).
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Vladimir Sokolovsky <vlad@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_main.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 9ff7bc73ed95..c434a856a787 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -60,15 +60,6 @@ MODULE_PARM_DESC(send_queue_size, "Number of descriptors in send queue"); | |||
60 | module_param_named(recv_queue_size, ipoib_recvq_size, int, 0444); | 60 | module_param_named(recv_queue_size, ipoib_recvq_size, int, 0444); |
61 | MODULE_PARM_DESC(recv_queue_size, "Number of descriptors in receive queue"); | 61 | MODULE_PARM_DESC(recv_queue_size, "Number of descriptors in receive queue"); |
62 | 62 | ||
63 | static int lro; | ||
64 | module_param(lro, bool, 0444); | ||
65 | MODULE_PARM_DESC(lro, "Enable LRO (Large Receive Offload)"); | ||
66 | |||
67 | static int lro_max_aggr = IPOIB_LRO_MAX_AGGR; | ||
68 | module_param(lro_max_aggr, int, 0644); | ||
69 | MODULE_PARM_DESC(lro_max_aggr, "LRO: Max packets to be aggregated " | ||
70 | "(default = 64)"); | ||
71 | |||
72 | #ifdef CONFIG_INFINIBAND_IPOIB_DEBUG | 63 | #ifdef CONFIG_INFINIBAND_IPOIB_DEBUG |
73 | int ipoib_debug_level; | 64 | int ipoib_debug_level; |
74 | 65 | ||
@@ -976,54 +967,6 @@ static const struct header_ops ipoib_header_ops = { | |||
976 | .create = ipoib_hard_header, | 967 | .create = ipoib_hard_header, |
977 | }; | 968 | }; |
978 | 969 | ||
979 | static int get_skb_hdr(struct sk_buff *skb, void **iphdr, | ||
980 | void **tcph, u64 *hdr_flags, void *priv) | ||
981 | { | ||
982 | unsigned int ip_len; | ||
983 | struct iphdr *iph; | ||
984 | |||
985 | if (unlikely(skb->protocol != htons(ETH_P_IP))) | ||
986 | return -1; | ||
987 | |||
988 | /* | ||
989 | * In the future we may add an else clause that verifies the | ||
990 | * checksum and allows devices which do not calculate checksum | ||
991 | * to use LRO. | ||
992 | */ | ||
993 | if (unlikely(skb->ip_summed != CHECKSUM_UNNECESSARY)) | ||
994 | return -1; | ||
995 | |||
996 | /* Check for non-TCP packet */ | ||
997 | skb_reset_network_header(skb); | ||
998 | iph = ip_hdr(skb); | ||
999 | if (iph->protocol != IPPROTO_TCP) | ||
1000 | return -1; | ||
1001 | |||
1002 | ip_len = ip_hdrlen(skb); | ||
1003 | skb_set_transport_header(skb, ip_len); | ||
1004 | *tcph = tcp_hdr(skb); | ||
1005 | |||
1006 | /* check if IP header and TCP header are complete */ | ||
1007 | if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb)) | ||
1008 | return -1; | ||
1009 | |||
1010 | *hdr_flags = LRO_IPV4 | LRO_TCP; | ||
1011 | *iphdr = iph; | ||
1012 | |||
1013 | return 0; | ||
1014 | } | ||
1015 | |||
1016 | static void ipoib_lro_setup(struct ipoib_dev_priv *priv) | ||
1017 | { | ||
1018 | priv->lro.lro_mgr.max_aggr = lro_max_aggr; | ||
1019 | priv->lro.lro_mgr.max_desc = IPOIB_MAX_LRO_DESCRIPTORS; | ||
1020 | priv->lro.lro_mgr.lro_arr = priv->lro.lro_desc; | ||
1021 | priv->lro.lro_mgr.get_skb_header = get_skb_hdr; | ||
1022 | priv->lro.lro_mgr.features = LRO_F_NAPI; | ||
1023 | priv->lro.lro_mgr.dev = priv->dev; | ||
1024 | priv->lro.lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY; | ||
1025 | } | ||
1026 | |||
1027 | static const struct net_device_ops ipoib_netdev_ops = { | 970 | static const struct net_device_ops ipoib_netdev_ops = { |
1028 | .ndo_open = ipoib_open, | 971 | .ndo_open = ipoib_open, |
1029 | .ndo_stop = ipoib_stop, | 972 | .ndo_stop = ipoib_stop, |
@@ -1067,8 +1010,6 @@ static void ipoib_setup(struct net_device *dev) | |||
1067 | 1010 | ||
1068 | priv->dev = dev; | 1011 | priv->dev = dev; |
1069 | 1012 | ||
1070 | ipoib_lro_setup(priv); | ||
1071 | |||
1072 | spin_lock_init(&priv->lock); | 1013 | spin_lock_init(&priv->lock); |
1073 | 1014 | ||
1074 | mutex_init(&priv->vlan_mutex); | 1015 | mutex_init(&priv->vlan_mutex); |
@@ -1218,9 +1159,6 @@ int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca) | |||
1218 | priv->dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; | 1159 | priv->dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; |
1219 | } | 1160 | } |
1220 | 1161 | ||
1221 | if (lro) | ||
1222 | priv->dev->features |= NETIF_F_LRO; | ||
1223 | |||
1224 | if (priv->dev->features & NETIF_F_SG && priv->hca_caps & IB_DEVICE_UD_TSO) | 1162 | if (priv->dev->features & NETIF_F_SG && priv->hca_caps & IB_DEVICE_UD_TSO) |
1225 | priv->dev->features |= NETIF_F_TSO; | 1163 | priv->dev->features |= NETIF_F_TSO; |
1226 | 1164 | ||