All of lore.kernel.org
 help / color / mirror / Atom feed
From: lxlenovostar@gmail.com (lx)
To: kernelnewbies@lists.kernelnewbies.org
Subject: hi , question function of net_rx(struct net_device *dev)
Date: Fri, 18 Jul 2014 17:04:38 +0800	[thread overview]
Message-ID: <53C8E326.5080805@gmail.com> (raw)

hi :
     the source code of net_rx(struct net_device *dev) is:
http://lxr.oss.org.cn/source/drivers/net/ethernet/cirrus/cs89x0.c#L670

I can't understand codes about malloc buffer.
##########################################
684         /* Malloc up new buffer. */
685         skb = netdev_alloc_skb(dev, length + 2);
686         if (skb == NULL) {
687                 dev->stats.rx_dropped++;
688                 return;
689         }
690         skb_reserve(skb, 2);    /* longword align L3 header */
##########################################

How to explain 'length + 2' in line of 685? Why add 2 ?

Thank you.

             reply	other threads:[~2014-07-18  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18  9:04 lx [this message]
2014-07-18 10:05 ` hi , question function of net_rx(struct net_device *dev) Denis Kirjanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C8E326.5080805@gmail.com \
    --to=lxlenovostar@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.