From: bluhm Date: Sat, 11 Jan 2014 14:33:48 +0000 (+0000) Subject: When I created UDP socket splicing, I added the goto nextpkt loop X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d980d716fa9abc4c8aead2b490f8adae654ac1b3;p=openbsd When I created UDP socket splicing, I added the goto nextpkt loop to splice multiple UDP packets in the m_nextpkt list. Some profiling with TCP splicing showed that checking so_rcv.sb_mb is wrong. It causes several useless runs through the loop. Better check for nextrecord which contains the original m_nextpkt value of the mbuf. OK mikeb@ --- diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index ae9e88c471c..1a6579c454b 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.120 2013/12/10 21:44:50 mikeb Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.121 2014/01/11 14:33:48 bluhm Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -1405,7 +1405,7 @@ somove(struct socket *so, int wait) so->so_splicelen += len; /* Move several packets if possible. */ - if (!maxreached && so->so_rcv.sb_mb) + if (!maxreached && nextrecord) goto nextpkt; release: