From: Matti Linnanvuori <mattilinnanvuori@yahoo.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: netdev@vger.kernel.org
Subject: Re: hard_start_xmit struct sk_buff read-only?
Date: Sat, 22 Dec 2007 10:18:08 +0100 (CET) [thread overview]
Message-ID: <166884.22908.qm@web52012.mail.re2.yahoo.com> (raw)
In-Reply-To: <476CCFBA.2010305@garzik.org>
--- Jeff Garzik <jeff@garzik.org> schrieb:
> This begs the question, what are you trying to do?
> ;-)
I have seen network drivers whose hard_start_xmit
function calls skb_push or skb_put to extend the used
data area of the struct skb_buff passed to the
function. That avoids allocating a new buffer and
copying the whole data area to it. The drivers
apparently do that because the device expects a
specific header or suffix in the DMA buffer it
handles.
> In terms of object lifetimes, control passes to the
> net driver when
> ->hard_start_xmit() is called, but that does not
> mean you can freely
> scribble over things -- the skb may have been
> cloned, its destructor
> callback still needs to be called (via
> dev_kfree_skb), etc.
So I assume modifying the data or header area of
struct sk_buff is incorrect because it can break
cloned buffers.
Heute schon einen Blick in die Zukunft von E-Mails wagen? www.yahoo.de/mail
prev parent reply other threads:[~2007-12-22 9:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-22 6:32 hard_start_xmit struct sk_buff read-only? Matti Linnanvuori
2007-12-22 8:50 ` Jeff Garzik
2007-12-22 9:18 ` Matti Linnanvuori [this message]
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=166884.22908.qm@web52012.mail.re2.yahoo.com \
--to=mattilinnanvuori@yahoo.com \
--cc=jeff@garzik.org \
--cc=netdev@vger.kernel.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.