~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/core/skbuff.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
#include <linux/init.h>
58
58
#include <linux/scatterlist.h>
59
59
#include <linux/errqueue.h>
 
60
#include <linux/prefetch.h>
60
61
 
61
62
#include <net/protocol.h>
62
63
#include <net/dst.h>
523
524
        new->ip_summed          = old->ip_summed;
524
525
        skb_copy_queue_mapping(new, old);
525
526
        new->priority           = old->priority;
526
 
        new->deliver_no_wcard   = old->deliver_no_wcard;
527
527
#if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE)
528
528
        new->ipvs_property      = old->ipvs_property;
529
529
#endif
2268
2268
 * of bytes already consumed and the next call to
2269
2269
 * skb_seq_read() will return the remaining part of the block.
2270
2270
 *
2271
 
 * Note 1: The size of each block of data returned can be arbitary,
 
2271
 * Note 1: The size of each block of data returned can be arbitrary,
2272
2272
 *       this limitation is the cost for zerocopy seqeuental
2273
2273
 *       reads of potentially non linear data.
2274
2274
 *
2434
2434
                        return -ENOMEM;
2435
2435
 
2436
2436
                /* initialize the next frag */
2437
 
                sk->sk_sndmsg_page = page;
2438
 
                sk->sk_sndmsg_off = 0;
2439
2437
                skb_fill_page_desc(skb, frg_cnt, page, 0, 0);
2440
2438
                skb->truesize += PAGE_SIZE;
2441
2439
                atomic_add(PAGE_SIZE, &sk->sk_wmem_alloc);
2455
2453
                        return -EFAULT;
2456
2454
 
2457
2455
                /* copy was successful so update the size parameters */
2458
 
                sk->sk_sndmsg_off += copy;
2459
2456
                frag->size += copy;
2460
2457
                skb->len += copy;
2461
2458
                skb->data_len += copy;
2498
2495
 *      a pointer to the first in a list of new skbs for the segments.
2499
2496
 *      In case of error it returns ERR_PTR(err).
2500
2497
 */
2501
 
struct sk_buff *skb_segment(struct sk_buff *skb, int features)
 
2498
struct sk_buff *skb_segment(struct sk_buff *skb, u32 features)
2502
2499
{
2503
2500
        struct sk_buff *segs = NULL;
2504
2501
        struct sk_buff *tail = NULL;
2508
2505
        unsigned int offset = doffset;
2509
2506
        unsigned int headroom;
2510
2507
        unsigned int len;
2511
 
        int sg = features & NETIF_F_SG;
 
2508
        int sg = !!(features & NETIF_F_SG);
2512
2509
        int nfrags = skb_shinfo(skb)->nr_frags;
2513
2510
        int err = -ENOMEM;
2514
2511
        int i = 0;
2997
2994
        skb->destructor = sock_rmem_free;
2998
2995
        atomic_add(skb->truesize, &sk->sk_rmem_alloc);
2999
2996
 
 
2997
        /* before exiting rcu section, make sure dst is refcounted */
 
2998
        skb_dst_force(skb);
 
2999
 
3000
3000
        skb_queue_tail(&sk->sk_error_queue, skb);
3001
3001
        if (!sock_flag(sk, SOCK_DEAD))
3002
3002
                sk->sk_data_ready(sk, skb->len);