Difference between skbuff and frag_list fragments

sk_buff has two places where it can store the following fragmentation data:

skb_shinfo(head)->frag_list 
skb_shinfo(head)->frags[]

Can someone explain the differences between the two methods of handling fragmentation.

Thanks and best regards!

+5
source share
2 answers

Both are used for different occasions.

frags []

/ , , .., frags[] 2- n- . data tail . frags[]. , .

frag_list

IP. ip_push_pending_frames. , sk_buffs

sk_buff0->next = sk_buff1
sk_buff1->next = sk_buff2
...
sk_buffn-1->next = sk_buffn

ip_push_pending_frames

sk_buff0->frag_list = sk_buff1
sk_buff1->next = sk_buff2
...
sk_buffn-1->next = sk_buffn

  • frags[] /
  • frag_list ip
+6

skb_shinfo () → []

NIC SG I/O, __ip_append_data skb_shinfo (head) → frags; NIC (, ixgbe_add_rx_frag) [] ; , frags [] . [] + (skb-> data ~ skb-> tail).

skb_shinfo () → frag_list

IP- . __ip_make_skb(), frag_list skbs sk-> sk_write_queue; NIC frag_list . /skb frag_list ; tcp_v4_send_ack → ip_send_unicast_reply → ip_push_pending_frames → ip_finish_skb → __ ip_make_skb;

+2

All Articles