Re: [RFC][PATCH 1/3] net: per skb control messages

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Herbert Xu <herbert@...>
Cc: <netdev@...>
Date: Thursday, July 24, 2008 - 9:34 am

On Thursday 24 July 2008, Herbert Xu wrote:

Hi Herbert,

Thanks for taking the time for the review. 


Initially I tried putting the new member directly into the skb, but then I
run into issues with cloned packets, since I needed a reference
counter to know when to delete the cmsg queue.

I've noticed that the shared info already has a reference counter and I've 
though that taking advantage of it would be better then doing it myself. 

The shinfo seems to be the right place also because the cmsg queue can not be 
modified once the skb has been pushed into the network stack. It sort of is 
like data, only with special meaning.

Is this approach wrong? Or is there a better way of doing it?


From what I understand, the shinfo remains shared, thus there is no need to do 
the copy here.


In copy_skb_header we do a pointer copy. This should be enough for packets 
that are cloned or partially cloned.

The only problem is when we do a full copy of the packet, where shinfo should 
be also copied. skb_cmsg_copy is called only in these cases.


I think this is only touching the skb header, not the shinfo. Thus we should 
be safe?

BTW: I have a dilemma with regard to fully copied skbs: should we copy the 
cmsg queue as well, or should we just prune it in the copy? I don't see a 
real usecase for doing the copy at this point, but since these is at core 
level, maybe it is a good idea to be conservative and do the copying?

Thanks,
tavi
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][PATCH 0/3] net: per skb control messages, Octavian Purdila, (Wed Jul 23, 6:01 pm)
[RFC][PATCH 1/3] net: per skb control messages, Octavian Purdila, (Wed Jul 23, 6:01 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, Herbert Xu, (Thu Jul 24, 8:46 am)
Re: [RFC][PATCH 1/3] net: per skb control messages, Octavian Purdila, (Thu Jul 24, 9:34 am)
Re: [RFC][PATCH 1/3] net: per skb control messages, Herbert Xu, (Thu Jul 24, 11:01 am)
Re: [RFC][PATCH 1/3] net: per skb control messages, Octavian Purdila, (Thu Jul 24, 12:22 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, David Miller, (Thu Jul 24, 4:28 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, Octavian Purdila, (Thu Jul 24, 5:49 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, David Miller, (Thu Jul 24, 5:56 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, Octavian Purdila, (Thu Jul 24, 6:12 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, David Miller, (Thu Jul 24, 6:17 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, Octavian Purdila, (Thu Jul 24, 7:14 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, David Miller, (Thu Jul 24, 7:18 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, Octavian Purdila, (Thu Jul 24, 7:26 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, Stephen Hemminger, (Thu Jul 24, 5:58 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, Octavian Purdila, (Thu Jul 24, 6:35 pm)
Re: [RFC][PATCH 1/3] net: per skb control messages, Stephen Hemminger, (Thu Jul 24, 7:05 pm)
[RFC][PATCH 3/3] net: add SKB_SOL control messages, Octavian Purdila, (Wed Jul 23, 6:01 pm)