Skip to contentSkip to conversation

UDP receive path: is this safe?

DISCUSSION devnetfs 1 participant 1 message Aug 24, 2003

Subsystems (2)
lore
Share & tools
lore

devnetfs

author
#0 lore raw

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