netdev
[Top] [All Lists]

UDP receive path: is this safe?

To: netdev@xxxxxxxxxxx, linux-net@xxxxxxxxxxxxxxx
Subject: UDP receive path: is this safe?
From: devnetfs <devnetfs@xxxxxxxxx>
Date: Sat, 23 Aug 2003 23:46:12 -0700 (PDT)
Sender: netdev-bounce@xxxxxxxxxxx
Hello,

I've created an in-kernel udp socket and set sock->data_ready to
my function foo(). inside foo() i do a skb_recv_datagram() to get
(in noblock mode) the skb's received on the socket. 

is this safe/correct to do?  

as sock->data_ready() path for udp is:
udp_rcv() -> udp_queue_rcv_skb() -> sock_queue_rcv_skb() ->
data_ready()

and skb_recv_datagram() calls skb_dequeue()...

any possible races? as i think there can be multiples callers inside
foo() at the same time (correct?). but then skb_dequeue() should be
safe. but i am unsure of call-path from udp_rcv() to data_ready()?

please enlighten. 

i want to avoid the overhead of converting an skb to iovec (by 
calling udp_recvmsg) and hence pursuing this path.


thanks in advance,
A.



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

<Prev in Thread] Current Thread [Next in Thread>
  • UDP receive path: is this safe?, devnetfs <=