lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 25 Sep 2008 06:03:03 -0700
From:	Ram.Natarajan@...lex.Com
To:	<netdev@...r.kernel.org>
Subject: Using skb_get() to recycle skbs


In our netdev driver, we preallocate a pool of skb which are
used by our h/w to DMA frames.

Normally, when we indicate a packet to stack (netif_rx),
the stack ends up freeing it. If we do a skb_get() prior
to that, then the stack just reduces the use_count,
and our driver is able to re-use it. We do have to use
caution to see that stack has dropped it's reference
(atomic_read(skb->users) <= 1) prior to returning
the buffer to our h/w.

Is this a valid approach? It so it could save some
CPU cycles which are used in alloc_skb(). If this
can be done, how come more drivers in tree are not
doing it, is there any flip side to it? One could be
that stack may not free it in time (we could starve
the hardware of free buffers), but in that case
we can drop our reference, and let the stack
free it up, and force an allocation instead of
reuse.

Thanks for your response.

Ram Natarajan
Emulex Corporation
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ