From: "Sirotkin, Alexander" <demiurg@ti.com>
To: linux-kernel@vger.kernel.org
Subject: network driver that uses skb destructor
Date: Mon, 29 Dec 2003 18:53:59 +0200 [thread overview]
Message-ID: <3FF05C27.5030706@ti.com> (raw)
I would like to write a network driver that uses DMA and manages it's
own memory.
The most common approach (in RX) seem to be to allocate the memory for
DMA transfer using dev_alloc_skb(), get the HW DMA engine to transfer
the packet into this skb buffer and later free it using dev_kfree_skb().
For various reasons (mainly to support legacy source code) I would like
to allocate and free the buffer using my own functions. Theoretically, I
could get away by using skb->destructor.
When I receive a packet I could allocate a zero length skb, point
skb->data to my (already allocated) buffer which contains the packet and
register the skb->destructor callback. Later, when this skb would be
freed my destructor callback would be called and it would return the
buffer to driver's pool.
It seems to me that it should work, but I'm a little bit cautions
because I could not find a single network driver (in 2.4 kernel) that
uses such an approach and I'm not extremely eager to be the first one to
try.
Anybody tried to implement similar approach ?
Any thoughts why this would (or would not) work ?
Thanks a lot.
--
Alexander Sirotkin
SW Engineer
Texas Instruments
Broadband Communications Israel (BCIL)
Tel: +972-9-9706587
________________________________________________________________________
"Those who do not understand Unix are condemned to reinvent it, poorly."
-- Henry Spencer
next reply other threads:[~2003-12-29 16:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-29 16:53 Sirotkin, Alexander [this message]
2003-12-29 17:24 ` network driver that uses skb destructor Muli Ben-Yehuda
2003-12-30 9:13 ` Adrian Cox
2003-12-30 9:36 ` Muli Ben-Yehuda
2004-01-01 19:09 ` [RFC/PATCH] skb destructor chaining [was Re: network driver that uses skb destructor] Muli Ben-Yehuda
2003-12-30 9:48 ` network driver that uses skb destructor Duncan Sands
2003-12-30 15:02 ` [Linux-ATM-General] " chas williams
2003-12-29 19:10 ` Jeff Garzik
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=3FF05C27.5030706@ti.com \
--to=demiurg@ti.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox