netdev
[Top] [All Lists]

Re: [PATCH] Handle shared SKBs in VLAN receive code

To: Tommy Christensen <tommy.christensen@xxxxxxxxx>
Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code
From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Sat, 11 Oct 2003 12:03:52 -0700
Cc: netdev@xxxxxxxxxxx
In-reply-to: <3F874A30.6010700@xxxxxxxxx>
Organization: Candela Technologies
References: <3F87430D.2040000@xxxxxxxxx> <3F87464B.1020908@xxxxxxxxxxxxxxx> <3F874A30.6010700@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827
Tommy Christensen wrote:
Ben Greear wrote:

-        if (skb_shared(skb) || skb_cloned(skb)) {
-            struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
-            kfree(skb);
-            skb = nskb;
-        }
+        skb = skb_unshare(skb, GFP_ATOMIC);



On 2.4.22, at least, skb_unshare only checks skb_cloned(), so do we
also need to check skb_shared()? Or was that check in the old patch above
not needed?


skb_shared() is now taken care of by skb_share_check(), called earlier in the
receive routine.

Maybe we should have a method called:  skb_get_me_an_skb_that_I_can_modify(skb);

Then the subtle differences between sharing, cloning, etc can be handled
by the skb code internally...

Ben

--
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com



<Prev in Thread] Current Thread [Next in Thread>