Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

stephen hemminger and committed by
David S. Miller
24245a1b da131ddb

-196
-23
include/linux/inet_lro.h
··· 133 133 void lro_receive_skb(struct net_lro_mgr *lro_mgr, 134 134 struct sk_buff *skb, 135 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 137 * Forward all aggregated SKBs held by lro_mgr to network stack 158 138 */ 159 139 160 140 void lro_flush_all(struct net_lro_mgr *lro_mgr); 161 - 162 - void lro_flush_pkt(struct net_lro_mgr *lro_mgr, 163 - struct iphdr *iph, struct tcphdr *tcph); 164 141 165 142 #endif
-173
net/ipv4/inet_lro.c
··· 230 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 234 static int lro_check_tcp_conn(struct net_lro_desc *lro_desc, 258 235 struct iphdr *iph, ··· 348 371 return 1; 349 372 } 350 373 351 - 352 - static struct sk_buff *lro_gen_skb(struct net_lro_mgr *lro_mgr, 353 - struct skb_frag_struct *frags, 354 - int len, int true_size, 355 - void *mac_hdr, 356 - int hlen, __wsum sum, 357 - u32 ip_summed) 358 - { 359 - struct sk_buff *skb; 360 - struct skb_frag_struct *skb_frags; 361 - int data_len = len; 362 - int hdr_len = min(len, hlen); 363 - 364 - skb = netdev_alloc_skb(lro_mgr->dev, hlen + lro_mgr->frag_align_pad); 365 - if (!skb) 366 - return NULL; 367 - 368 - skb_reserve(skb, lro_mgr->frag_align_pad); 369 - skb->len = len; 370 - skb->data_len = len - hdr_len; 371 - skb->truesize += true_size; 372 - skb->tail += hdr_len; 373 - 374 - memcpy(skb->data, mac_hdr, hdr_len); 375 - 376 - skb_frags = skb_shinfo(skb)->frags; 377 - while (data_len > 0) { 378 - *skb_frags = *frags; 379 - data_len -= skb_frag_size(frags); 380 - skb_frags++; 381 - frags++; 382 - skb_shinfo(skb)->nr_frags++; 383 - } 384 - 385 - skb_shinfo(skb)->frags[0].page_offset += hdr_len; 386 - skb_frag_size_sub(&skb_shinfo(skb)->frags[0], hdr_len); 387 - 388 - skb->ip_summed = ip_summed; 389 - skb->csum = sum; 390 - skb->protocol = eth_type_trans(skb, lro_mgr->dev); 391 - return skb; 392 - } 393 - 394 - static struct sk_buff *__lro_proc_segment(struct net_lro_mgr *lro_mgr, 395 - struct skb_frag_struct *frags, 396 - int len, int true_size, 397 - void *priv, __wsum sum) 398 - { 399 - struct net_lro_desc *lro_desc; 400 - struct iphdr *iph; 401 - struct tcphdr *tcph; 402 - struct sk_buff *skb; 403 - u64 flags; 404 - void *mac_hdr; 405 - int mac_hdr_len; 406 - int hdr_len = LRO_MAX_PG_HLEN; 407 - int vlan_hdr_len = 0; 408 - 409 - if (!lro_mgr->get_frag_header || 410 - lro_mgr->get_frag_header(frags, (void *)&mac_hdr, (void *)&iph, 411 - (void *)&tcph, &flags, priv)) { 412 - mac_hdr = skb_frag_address(frags); 413 - goto out1; 414 - } 415 - 416 - if (!(flags & LRO_IPV4) || !(flags & LRO_TCP)) 417 - goto out1; 418 - 419 - hdr_len = (int)((void *)(tcph) + TCP_HDR_LEN(tcph) - mac_hdr); 420 - mac_hdr_len = (int)((void *)(iph) - mac_hdr); 421 - 422 - lro_desc = lro_get_desc(lro_mgr, lro_mgr->lro_arr, iph, tcph); 423 - if (!lro_desc) 424 - goto out1; 425 - 426 - if (!lro_desc->active) { /* start new lro session */ 427 - if (lro_tcp_ip_check(iph, tcph, len - mac_hdr_len, NULL)) 428 - goto out1; 429 - 430 - skb = lro_gen_skb(lro_mgr, frags, len, true_size, mac_hdr, 431 - hdr_len, 0, lro_mgr->ip_summed_aggr); 432 - if (!skb) 433 - goto out; 434 - 435 - if ((skb->protocol == htons(ETH_P_8021Q)) && 436 - !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID)) 437 - vlan_hdr_len = VLAN_HLEN; 438 - 439 - iph = (void *)(skb->data + vlan_hdr_len); 440 - tcph = (void *)((u8 *)skb->data + vlan_hdr_len 441 - + IP_HDR_LEN(iph)); 442 - 443 - lro_init_desc(lro_desc, skb, iph, tcph); 444 - LRO_INC_STATS(lro_mgr, aggregated); 445 - return NULL; 446 - } 447 - 448 - if (lro_desc->tcp_next_seq != ntohl(tcph->seq)) 449 - goto out2; 450 - 451 - if (lro_tcp_ip_check(iph, tcph, len - mac_hdr_len, lro_desc)) 452 - goto out2; 453 - 454 - lro_add_frags(lro_desc, len, hdr_len, true_size, frags, iph, tcph); 455 - LRO_INC_STATS(lro_mgr, aggregated); 456 - 457 - if ((skb_shinfo(lro_desc->parent)->nr_frags >= lro_mgr->max_aggr) || 458 - lro_desc->parent->len > (0xFFFF - lro_mgr->dev->mtu)) 459 - lro_flush(lro_mgr, lro_desc); 460 - 461 - return NULL; 462 - 463 - out2: /* send aggregated packets to the stack */ 464 - lro_flush(lro_mgr, lro_desc); 465 - 466 - out1: /* Original packet has to be posted to the stack */ 467 - skb = lro_gen_skb(lro_mgr, frags, len, true_size, mac_hdr, 468 - hdr_len, sum, lro_mgr->ip_summed); 469 - out: 470 - return skb; 471 - } 472 - 473 374 void lro_receive_skb(struct net_lro_mgr *lro_mgr, 474 375 struct sk_buff *skb, 475 376 void *priv) ··· 361 506 } 362 507 EXPORT_SYMBOL(lro_receive_skb); 363 508 364 - void lro_receive_frags(struct net_lro_mgr *lro_mgr, 365 - struct skb_frag_struct *frags, 366 - int len, int true_size, void *priv, __wsum sum) 367 - { 368 - struct sk_buff *skb; 369 - 370 - skb = __lro_proc_segment(lro_mgr, frags, len, true_size, priv, sum); 371 - if (!skb) 372 - return; 373 - 374 - if (lro_mgr->features & LRO_F_NAPI) 375 - netif_receive_skb(skb); 376 - else 377 - netif_rx(skb); 378 - } 379 - EXPORT_SYMBOL(lro_receive_frags); 380 - 381 509 void lro_flush_all(struct net_lro_mgr *lro_mgr) 382 510 { 383 511 int i; ··· 372 534 } 373 535 } 374 536 EXPORT_SYMBOL(lro_flush_all); 375 - 376 - void lro_flush_pkt(struct net_lro_mgr *lro_mgr, 377 - struct iphdr *iph, struct tcphdr *tcph) 378 - { 379 - struct net_lro_desc *lro_desc; 380 - 381 - lro_desc = lro_get_desc(lro_mgr, lro_mgr->lro_arr, iph, tcph); 382 - if (lro_desc->active) 383 - lro_flush(lro_mgr, lro_desc); 384 - } 385 - EXPORT_SYMBOL(lro_flush_pkt);