Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/net/lib/libsockin for udp sockets crank snd/rcvbufs...
details: https://anonhg.NetBSD.org/src/rev/d656d7a557ed
branches: trunk
changeset: 748215:d656d7a557ed
user: pooka <pooka%NetBSD.org@localhost>
date: Fri Oct 16 23:17:46 2009 +0000
description:
for udp sockets crank snd/rcvbufsize to 64k
diffstat:
sys/rump/net/lib/libsockin/sockin.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diffs (51 lines):
diff -r e74fa5974328 -r d656d7a557ed sys/rump/net/lib/libsockin/sockin.c
--- a/sys/rump/net/lib/libsockin/sockin.c Fri Oct 16 22:45:18 2009 +0000
+++ b/sys/rump/net/lib/libsockin/sockin.c Fri Oct 16 23:17:46 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sockin.c,v 1.16 2009/09/02 19:04:51 pooka Exp $ */
+/* $NetBSD: sockin.c,v 1.17 2009/10/16 23:17:46 pooka Exp $ */
/*
* Copyright (c) 2008, 2009 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.16 2009/09/02 19:04:51 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.17 2009/10/16 23:17:46 pooka Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -352,6 +352,7 @@
case PRU_ATTACH:
{
int news, dummy;
+ int sbsize;
sosetlock(so);
if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
@@ -365,6 +366,16 @@
if (news == -1)
break;
+ /* for UDP sockets, make sure we can send&recv max */
+ if (so->so_proto->pr_type == SOCK_DGRAM) {
+ sbsize = SOCKIN_SBSIZE;
+ rumpuser_net_setsockopt(news, SOL_SOCKET, SO_SNDBUF,
+ &sbsize, sizeof(sbsize), &error);
+ sbsize = SOCKIN_SBSIZE;
+ rumpuser_net_setsockopt(news, SOL_SOCKET, SO_RCVBUF,
+ &sbsize, sizeof(sbsize), &error);
+ }
+
if ((error = registersock(so, news)) != 0)
rumpuser_close(news, &dummy);
@@ -410,7 +421,6 @@
iov[i].iov_base = m2->m_data;
iov[i].iov_len = m2->m_len;
tot += m2->m_len;
-
}
mhdr.msg_iov = iov;
mhdr.msg_iovlen = i;
Home |
Main Index |
Thread Index |
Old Index