Re: [RFC][PATCH 0/3] net: a lighter UDP-Lite (RFC 3828)
From: Arnaldo Carvalho de Melo <hidden>
Date: 2006-08-28 12:48:18
Also in:
lkml
On 8/28/06, gerrit@erg.abdn.ac.uk [off-list ref] wrote:
quoted hunk ↗ jump to hunk
[NET/IPv4]: update for udp.c only, to match 2.6.18-rc4-mm3 This is an update only, as the previous patch can not cope with recent changes to udp.c (all other files remain the same). Up-to-date, complete patches can always be taken from http://www.erg.abdn.ac.uk/users/gerrit/udp-lite/files/udplite_linux.tar.gz Signed-off-by: Gerrit Renker <redacted> --- udp.c | 606 ++++++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 410 insertions(+), 196 deletions(-)diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 514c1e9..4ddd8e6 100644
quoted hunk ↗ jump to hunk
@@ -731,12 +801,12 @@ out: } /* - * IOCTL requests applicable to the UDP protocol + * IOCTL requests applicable to the UDP(-Lite) protocol */
Avoid these changes to reduce patch file size, please
-
+
int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
{
- switch(cmd)
+ switch(cmd)Ditto
-/* - * This should be easy, if there is something there we - * return it, otherwise we block. +/** + * udp_recvmsg - generic UDP/-Lite receive processing + * + * This routine is udplite-aware and works for both protocols.
quoted hunk ↗ jump to hunk
@@ -980,7 +1055,11 @@ #else #endif } -/* returns: +/** + * udp_queue_rcv_skb - receive queue processing + * + * This routine is udplite-aware and works on both sockets.
quoted hunk ↗ jump to hunk
if (up->encap_type) {@@ -1010,7 +1087,7 @@ static int udp_queue_rcv_skb(struct sock * If it's an encapsulateed packet, then pass it to the * IPsec xfrm input and return the response * appropriately. Otherwise, just fall through and - * pass this up the UDP socket. + * pass this up the UDP/-Lite socket. */
- /* FALLTHROUGH -- it's a UDP Packet */
+ /* FALLTHROUGH -- it's a UDP/-Lite Packet */
}/* - * All we need to do is get the socket, and then do a checksum. + * All we need to do is get the socket, and then do a checksum. */ -
Huh, what was this one? trailing whitespace? Can you leave this for another cset doing just the reformatting?
quoted hunk ↗ jump to hunk
@@ -1219,7 +1363,7 @@ static int udp_destroy_sock(struct sock } /* - * Socket option code for UDP + * Socket option code for UDP and UDP-Lite (shared). */
#endif + /** - * udp_poll - wait for a UDP event. + * udp_poll - wait for a UDP(-Lite) event.
See next comment
quoted hunk ↗ jump to hunk
* @file - file struct * @sock - socket * @wait - poll table@@ -1348,11 +1528,14 @@ #endif * then it could get return from select indicating data available * but then block when reading it. Add special case code * to work around these arguably broken applications. + * + * The routine is udplite-aware and works for both protocols.
I guess these comments can go as well, as one can quickly realise the
functions handles UDP lite with all the "IS_UDPLITE(sk)" calls and
"is_{udp}lite" variables :-)
*/
unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
{
unsigned int mask = datagram_poll(file, sock, wait);
struct sock *sk = sock->sk;
+ int is_lite = IS_UDPLITE(sk);Regards, - Arnaldo