diff options
author | stephen hemminger <stephen@networkplumber.org> | 2013-12-29 14:43:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-29 16:34:25 -0500 |
commit | 24245a1b055df246dc94517c1a8b1fdfe7668da0 (patch) | |
tree | 0a9b41969faceff001ad4d1a4f2c99a59ef3cd9b | |
parent | da131ddbffae0d225f36e0651b8cf7014a576c0e (diff) |
lro: remove dead code
Remove leftover code that is not used anywhere in current tree.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/inet_lro.h | 23 | ||||
-rw-r--r-- | net/ipv4/inet_lro.c | 173 |
2 files changed, 0 insertions, 196 deletions
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h index 2cf55afbcd4e..9a715cfa1fe3 100644 --- a/include/linux/inet_lro.h +++ b/include/linux/inet_lro.h | |||
@@ -133,33 +133,10 @@ struct net_lro_mgr { | |||
133 | void lro_receive_skb(struct net_lro_mgr *lro_mgr, | 133 | void lro_receive_skb(struct net_lro_mgr *lro_mgr, |
134 | struct sk_buff *skb, | 134 | struct sk_buff *skb, |
135 | void *priv); | 135 | void *priv); |
136 | |||
137 | /* | ||
138 | * Processes a fragment list | ||
139 | * | ||
140 | * This functions aggregate fragments and generate SKBs do pass | ||
141 | * the packets to the stack. | ||
142 | * | ||
143 | * @lro_mgr: LRO manager to use | ||
144 | * @frags: Fragment to be processed. Must contain entire header in first | ||
145 | * element. | ||
146 | * @len: Length of received data | ||
147 | * @true_size: Actual size of memory the fragment is consuming | ||
148 | * @priv: Private data that may be used by driver functions | ||
149 | * (for example get_tcp_ip_hdr) | ||
150 | */ | ||
151 | |||
152 | void lro_receive_frags(struct net_lro_mgr *lro_mgr, | ||
153 | struct skb_frag_struct *frags, | ||
154 | int len, int true_size, void *priv, __wsum sum); | ||
155 | |||
156 | /* | 136 | /* |
157 | * Forward all aggregated SKBs held by lro_mgr to network stack | 137 | * Forward all aggregated SKBs held by lro_mgr to network stack |
158 | */ | 138 | */ |
159 | 139 | ||
160 | void lro_flush_all(struct net_lro_mgr *lro_mgr); | 140 | void lro_flush_all(struct net_lro_mgr *lro_mgr); |
161 | 141 | ||
162 | void lro_flush_pkt(struct net_lro_mgr *lro_mgr, | ||
163 | struct iphdr *iph, struct tcphdr *tcph); | ||
164 | |||
165 | #endif | 142 | #endif |
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c index 1975f52933c5..f17ea49b28fb 100644 --- a/net/ipv4/inet_lro.c +++ b/net/ipv4/inet_lro.c | |||
@@ -230,29 +230,6 @@ static void lro_add_packet(struct net_lro_desc *lro_desc, struct sk_buff *skb, | |||
230 | lro_desc->last_skb = skb; | 230 | lro_desc->last_skb = skb; |
231 | } | 231 | } |
232 | 232 | ||
233 | static void lro_add_frags(struct net_lro_desc *lro_desc, | ||
234 | int len, int hlen, int truesize, | ||
235 | struct skb_frag_struct *skb_frags, | ||
236 | struct iphdr *iph, struct tcphdr *tcph) | ||
237 | { | ||
238 | struct sk_buff *skb = lro_desc->parent; | ||
239 | int tcp_data_len = TCP_PAYLOAD_LENGTH(iph, tcph); | ||
240 | |||
241 | lro_add_common(lro_desc, iph, tcph, tcp_data_len); | ||
242 | |||
243 | skb->truesize += truesize; | ||
244 | |||
245 | skb_frags[0].page_offset += hlen; | ||
246 | skb_frag_size_sub(&skb_frags[0], hlen); | ||
247 | |||
248 | while (tcp_data_len > 0) { | ||
249 | *(lro_desc->next_frag) = *skb_frags; | ||
250 | tcp_data_len -= skb_frag_size(skb_frags); | ||
251 | lro_desc->next_frag++; | ||
252 | skb_frags++; | ||
253 | skb_shinfo(skb)->nr_frags++; | ||
254 | } | ||
255 | } | ||
256 | 233 | ||
257 | static int lro_check_tcp_conn(struct net_lro_desc *lro_desc, | 234 | static int lro_check_tcp_conn(struct net_lro_desc *lro_desc, |
258 | struct iphdr *iph, | 235 | struct iphdr *iph, |
@@ -371,128 +348,6 @@ out: | |||
371 | return 1; | 348 | return 1; |
372 | } | 349 | } |
373 | 350 | ||
374 | |||
375 | static struct sk_buff *lro_gen_skb(struct net_lro_mgr *lro_mgr, | ||
376 | struct skb_frag_struct *frags, | ||
377 | int len, int true_size, | ||
378 | void *mac_hdr, | ||
379 | int hlen, __wsum sum, | ||
380 | u32 ip_summed) | ||
381 | { | ||
382 | struct sk_buff *skb; | ||
383 | struct skb_frag_struct *skb_frags; | ||
384 | int data_len = len; | ||
385 | int hdr_len = min(len, hlen); | ||
386 | |||
387 | skb = netdev_alloc_skb(lro_mgr->dev, hlen + lro_mgr->frag_align_pad); | ||
388 | if (!skb) | ||
389 | return NULL; | ||
390 | |||
391 | skb_reserve(skb, lro_mgr->frag_align_pad); | ||
392 | skb->len = len; | ||
393 | skb->data_len = len - hdr_len; | ||
394 | skb->truesize += true_size; | ||
395 | skb->tail += hdr_len; | ||
396 | |||
397 | memcpy(skb->data, mac_hdr, hdr_len); | ||
398 | |||
399 | skb_frags = skb_shinfo(skb)->frags; | ||
400 | while (data_len > 0) { | ||
401 | *skb_frags = *frags; | ||
402 | data_len -= skb_frag_size(frags); | ||
403 | skb_frags++; | ||
404 | frags++; | ||
405 | skb_shinfo(skb)->nr_frags++; | ||
406 | } | ||
407 | |||
408 | skb_shinfo(skb)->frags[0].page_offset += hdr_len; | ||
409 | skb_frag_size_sub(&skb_shinfo(skb)->frags[0], hdr_len); | ||
410 | |||
411 | skb->ip_summed = ip_summed; | ||
412 | skb->csum = sum; | ||
413 | skb->protocol = eth_type_trans(skb, lro_mgr->dev); | ||
414 | return skb; | ||
415 | } | ||
416 | |||
417 | static struct sk_buff *__lro_proc_segment(struct net_lro_mgr *lro_mgr, | ||
418 | struct skb_frag_struct *frags, | ||
419 | int len, int true_size, | ||
420 | void *priv, __wsum sum) | ||
421 | { | ||
422 | struct net_lro_desc *lro_desc; | ||
423 | struct iphdr *iph; | ||
424 | struct tcphdr *tcph; | ||
425 | struct sk_buff *skb; | ||
426 | u64 flags; | ||
427 | void *mac_hdr; | ||
428 | int mac_hdr_len; | ||
429 | int hdr_len = LRO_MAX_PG_HLEN; | ||
430 | int vlan_hdr_len = 0; | ||
431 | |||
432 | if (!lro_mgr->get_frag_header || | ||
433 | lro_mgr->get_frag_header(frags, (void *)&mac_hdr, (void *)&iph, | ||
434 | (void *)&tcph, &flags, priv)) { | ||
435 | mac_hdr = skb_frag_address(frags); | ||
436 | goto out1; | ||
437 | } | ||
438 | |||
439 | if (!(flags & LRO_IPV4) || !(flags & LRO_TCP)) | ||
440 | goto out1; | ||
441 | |||
442 | hdr_len = (int)((void *)(tcph) + TCP_HDR_LEN(tcph) - mac_hdr); | ||
443 | mac_hdr_len = (int)((void *)(iph) - mac_hdr); | ||
444 | |||
445 | lro_desc = lro_get_desc(lro_mgr, lro_mgr->lro_arr, iph, tcph); | ||
446 | if (!lro_desc) | ||
447 | goto out1; | ||
448 | |||
449 | if (!lro_desc->active) { /* start new lro session */ | ||
450 | if (lro_tcp_ip_check(iph, tcph, len - mac_hdr_len, NULL)) | ||
451 | goto out1; | ||
452 | |||
453 | skb = lro_gen_skb(lro_mgr, frags, len, true_size, mac_hdr, | ||
454 | hdr_len, 0, lro_mgr->ip_summed_aggr); | ||
455 | if (!skb) | ||
456 | goto out; | ||
457 | |||
458 | if ((skb->protocol == htons(ETH_P_8021Q)) && | ||
459 | !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID)) | ||
460 | vlan_hdr_len = VLAN_HLEN; | ||
461 | |||
462 | iph = (void *)(skb->data + vlan_hdr_len); | ||
463 | tcph = (void *)((u8 *)skb->data + vlan_hdr_len | ||
464 | + IP_HDR_LEN(iph)); | ||
465 | |||
466 | lro_init_desc(lro_desc, skb, iph, tcph); | ||
467 | LRO_INC_STATS(lro_mgr, aggregated); | ||
468 | return NULL; | ||
469 | } | ||
470 | |||
471 | if (lro_desc->tcp_next_seq != ntohl(tcph->seq)) | ||
472 | goto out2; | ||
473 | |||
474 | if (lro_tcp_ip_check(iph, tcph, len - mac_hdr_len, lro_desc)) | ||
475 | goto out2; | ||
476 | |||
477 | lro_add_frags(lro_desc, len, hdr_len, true_size, frags, iph, tcph); | ||
478 | LRO_INC_STATS(lro_mgr, aggregated); | ||
479 | |||
480 | if ((skb_shinfo(lro_desc->parent)->nr_frags >= lro_mgr->max_aggr) || | ||
481 | lro_desc->parent->len > (0xFFFF - lro_mgr->dev->mtu)) | ||
482 | lro_flush(lro_mgr, lro_desc); | ||
483 | |||
484 | return NULL; | ||
485 | |||
486 | out2: /* send aggregated packets to the stack */ | ||
487 | lro_flush(lro_mgr, lro_desc); | ||
488 | |||
489 | out1: /* Original packet has to be posted to the stack */ | ||
490 | skb = lro_gen_skb(lro_mgr, frags, len, true_size, mac_hdr, | ||
491 | hdr_len, sum, lro_mgr->ip_summed); | ||
492 | out: | ||
493 | return skb; | ||
494 | } | ||
495 | |||
496 | void lro_receive_skb(struct net_lro_mgr *lro_mgr, | 351 | void lro_receive_skb(struct net_lro_mgr *lro_mgr, |
497 | struct sk_buff *skb, | 352 | struct sk_buff *skb, |
498 | void *priv) | 353 | void *priv) |
@@ -506,23 +361,6 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr, | |||
506 | } | 361 | } |
507 | EXPORT_SYMBOL(lro_receive_skb); | 362 | EXPORT_SYMBOL(lro_receive_skb); |
508 | 363 | ||
509 | void lro_receive_frags(struct net_lro_mgr *lro_mgr, | ||
510 | struct skb_frag_struct *frags, | ||
511 | int len, int true_size, void *priv, __wsum sum) | ||
512 | { | ||
513 | struct sk_buff *skb; | ||
514 | |||
515 | skb = __lro_proc_segment(lro_mgr, frags, len, true_size, priv, sum); | ||
516 | if (!skb) | ||
517 | return; | ||
518 | |||
519 | if (lro_mgr->features & LRO_F_NAPI) | ||
520 | netif_receive_skb(skb); | ||
521 | else | ||
522 | netif_rx(skb); | ||
523 | } | ||
524 | EXPORT_SYMBOL(lro_receive_frags); | ||
525 | |||
526 | void lro_flush_all(struct net_lro_mgr *lro_mgr) | 364 | void lro_flush_all(struct net_lro_mgr *lro_mgr) |
527 | { | 365 | { |
528 | int i; | 366 | int i; |
@@ -534,14 +372,3 @@ void lro_flush_all(struct net_lro_mgr *lro_mgr) | |||
534 | } | 372 | } |
535 | } | 373 | } |
536 | EXPORT_SYMBOL(lro_flush_all); | 374 | EXPORT_SYMBOL(lro_flush_all); |
537 | |||
538 | void lro_flush_pkt(struct net_lro_mgr *lro_mgr, | ||
539 | struct iphdr *iph, struct tcphdr *tcph) | ||
540 | { | ||
541 | struct net_lro_desc *lro_desc; | ||
542 | |||
543 | lro_desc = lro_get_desc(lro_mgr, lro_mgr->lro_arr, iph, tcph); | ||
544 | if (lro_desc->active) | ||
545 | lro_flush(lro_mgr, lro_desc); | ||
546 | } | ||
547 | EXPORT_SYMBOL(lro_flush_pkt); | ||