skbuff.c (99d5851eefe589346c976a4b539ee498267bc5fd) skbuff.c (c9af6db4c11ccc6c3e7f19bbc15d54023956f97c)
1/*
2 * Routines having to do with the 'struct sk_buff' memory handlers.
3 *
4 * Authors: Alan Cox <alan@lxorguk.ukuu.org.uk>
5 * Florian La Roche <rzsfl@rz.uni-sb.de>
6 *
7 * Fixes:
8 * Alan Cox : Fixed the worst of the load

--- 2312 unchanged lines hidden (view full) ---

2321 * @skb: the buffer to split
2322 * @skb1: the buffer to receive the second part
2323 * @len: new length for skb
2324 */
2325void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len)
2326{
2327 int pos = skb_headlen(skb);
2328
1/*
2 * Routines having to do with the 'struct sk_buff' memory handlers.
3 *
4 * Authors: Alan Cox <alan@lxorguk.ukuu.org.uk>
5 * Florian La Roche <rzsfl@rz.uni-sb.de>
6 *
7 * Fixes:
8 * Alan Cox : Fixed the worst of the load

--- 2312 unchanged lines hidden (view full) ---

2321 * @skb: the buffer to split
2322 * @skb1: the buffer to receive the second part
2323 * @len: new length for skb
2324 */
2325void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len)
2326{
2327 int pos = skb_headlen(skb);
2328
2329 skb_shinfo(skb1)->gso_type = skb_shinfo(skb)->gso_type;
2330
2329 skb_shinfo(skb)->tx_flags = skb_shinfo(skb1)->tx_flags & SKBTX_SHARED_FRAG;
2331 if (len < pos) /* Split line is inside header. */
2332 skb_split_inside_header(skb, skb1, len, pos);
2333 else /* Second chunk has no header, nothing to copy. */
2334 skb_split_no_header(skb, skb1, len, pos);
2335}
2336EXPORT_SYMBOL(skb_split);
2337
2338/* Shifting from/to a cloned skb is a no-go.

--- 489 unchanged lines hidden (view full) ---

2828 continue;
2829 }
2830
2831 frag = skb_shinfo(nskb)->frags;
2832
2833 skb_copy_from_linear_data_offset(skb, offset,
2834 skb_put(nskb, hsize), hsize);
2835
2330 if (len < pos) /* Split line is inside header. */
2331 skb_split_inside_header(skb, skb1, len, pos);
2332 else /* Second chunk has no header, nothing to copy. */
2333 skb_split_no_header(skb, skb1, len, pos);
2334}
2335EXPORT_SYMBOL(skb_split);
2336
2337/* Shifting from/to a cloned skb is a no-go.

--- 489 unchanged lines hidden (view full) ---

2827 continue;
2828 }
2829
2830 frag = skb_shinfo(nskb)->frags;
2831
2832 skb_copy_from_linear_data_offset(skb, offset,
2833 skb_put(nskb, hsize), hsize);
2834
2836 skb_shinfo(nskb)->gso_type = skb_shinfo(skb)->gso_type;
2835 skb_shinfo(nskb)->tx_flags = skb_shinfo(skb)->tx_flags & SKBTX_SHARED_FRAG;
2837
2838 while (pos < offset + len && i < nfrags) {
2839 *frag = skb_shinfo(skb)->frags[i];
2840 __skb_frag_ref(frag);
2841 size = skb_frag_size(frag);
2842
2843 if (pos < offset) {
2844 frag->page_offset += offset - pos;

--- 615 unchanged lines hidden ---
2836
2837 while (pos < offset + len && i < nfrags) {
2838 *frag = skb_shinfo(skb)->frags[i];
2839 __skb_frag_ref(frag);
2840 size = skb_frag_size(frag);
2841
2842 if (pos < offset) {
2843 frag->page_offset += offset - pos;

--- 615 unchanged lines hidden ---