From 918414274548d0741ba963109f8072ac72167291 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 21 Mar 2012 17:50:15 +0000 Subject: [PATCH] Bring in some logic from IPMI plugin to get a better assurance of optimal receive buffer behavior git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11936 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/SLP.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/perl-xCAT/xCAT/SLP.pm b/perl-xCAT/xCAT/SLP.pm index e57338c63..ffeb342e1 100644 --- a/perl-xCAT/xCAT/SLP.pm +++ b/perl-xCAT/xCAT/SLP.pm @@ -41,6 +41,16 @@ sub dodiscover { } else { $args{'socket'} = IO::Socket::INET->new(Proto => 'udp'); } + #make an extra effort to request biggest receive buffer OS is willing to give us + if (-r "/proc/sys/net/core/rmem_max") { # we can detect the maximum allowed socket, read it. + my $sysctl; + open ($sysctl,"<","/proc/sys/net/core/rmem_max"); + my $maxrcvbuf=<$sysctl>; + my $rcvbuf = $socket->sockopt(SO_RCVBUF); + if ($maxrcvbuf > $rcvbuf) { + $socket->sockopt(SO_RCVBUF,$maxrcvbuf/2); + } + } } unless ($args{SrvTypes}) { croak "SrvTypes argument is required for xCAT::SLP::Dodiscover"; } setsockopt($args{'socket'},SOL_SOCKET,SO_BROADCAST,1); #allow for broadcasts to be sent, we know what we are doing