[Devel] [PATCH 03/14] net: Port diff-ve-net-af_packet-use-nonpksb

Kirill Tkhai ktkhai at odin.com
Mon Jun 8 07:20:29 PDT 2015


This patch is from 2.6.32 kernel. It makes packet_alloc_skb()
to allocate linear skb (all data is placed in header, and no
additional discontinuous pages is used).

It's an old commit, and CVS doesn't contain any comments about
it. I can suggest, it was used to improve performance on some
problems, but it's only suggestion. So I leave it up to Konstantin
if he knows why we did that.

Signed-off-by: Kirill Tkhai <ktkhai at odin.com>
---
 net/packet/af_packet.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 58688c2..a497efe 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2216,12 +2216,8 @@ static struct sk_buff *packet_alloc_skb(struct sock *sk, size_t prepad,
 {
 	struct sk_buff *skb;
 
-	/* Under a page?  Don't bother with paged skb. */
-	if (prepad + len < PAGE_SIZE || !linear)
-		linear = len;
-
-	skb = sock_alloc_send_pskb(sk, prepad + linear, len - linear, noblock,
-				   err);
+	linear = len;
+	skb = sock_alloc_send_skb(sk, prepad + linear, noblock, err);
 	if (!skb)
 		return NULL;
 




More information about the Devel mailing list