From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 10:46:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A24A106564A; Tue, 22 Jun 2010 10:46:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19B768FC12; Tue, 22 Jun 2010 10:46:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MAkvKN020840; Tue, 22 Jun 2010 10:46:57 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MAkvIq020837; Tue, 22 Jun 2010 10:46:57 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006221046.o5MAkvIq020837@svn.freebsd.org> From: Robert Watson Date: Tue, 22 Jun 2010 10:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209429 - head/tools/tools/netrate/tcpp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 10:46:58 -0000 Author: rwatson Date: Tue Jun 22 10:46:57 2010 New Revision: 209429 URL: http://svn.freebsd.org/changeset/base/209429 Log: Add TCP scalability testing wrapper scripts for tcpp. Sponsored by: Juniper Networks MFC after: 1 week Added: head/tools/tools/netrate/tcpp/parallelism.csh (contents, props changed) head/tools/tools/netrate/tcpp/runit.pl (contents, props changed) Added: head/tools/tools/netrate/tcpp/parallelism.csh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netrate/tcpp/parallelism.csh Tue Jun 22 10:46:57 2010 (r209429) @@ -0,0 +1,28 @@ +#!/bin/csh +# +# $FreeBSD$ +# +# Run tcpp -s -p 8 on the server, then this on the client. +# +# Note awkwardly hard-coded IP address below. +# +# Accepts two arguments: [filename] [csvprefix] +# + +set totalbytes=4800000 # Bytes per connection +set cores=8 +set trials=6 +set ptcps=24 # Max TCPs concurrently +set ntcps=240 # Total TCPs over test +set nips=4 # Number of local IP addresses to use +set baseip=192.168.100.200 # First IP address to use + +foreach core (`jot $cores`) + foreach trial (`jot $trials`) + set mflag=`echo $ptcps / $core | bc` + set tflag=`echo $ntcps / $core | bc` + echo -n $2,${core},${trial}, >> $1 + ./tcpp -c 192.168.100.102 -p $core -b $totalbytes -m $mflag \ + -t $tflag -M $nips -l $baseip >> $1 + end +end Added: head/tools/tools/netrate/tcpp/runit.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netrate/tcpp/runit.pl Tue Jun 22 10:46:57 2010 (r209429) @@ -0,0 +1,64 @@ +#!/usr/bin/perl +# +# $FreeBSD$ +# + +if ($#ARGV != 0) { + print "runit.pl kernelname\n"; + exit(-1); +} + +$tcpp_dir = "/rwatson/svn/base/head/tools/tools/netrate/tcpp"; + +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +$mon++; +$year += 1900; +$date = sprintf("%04d%02d%02d", $year, $mon, $mday); + +$kernel = $ARGV[0]; +$outfile = $date."_".$kernel.".csv"; +unlink($outfile); +open(OUTFILE, ">".$outfile) || die $outfile; +print OUTFILE "# $kernel $date\n"; +print OUTFILE "# hydra1: ".`ssh root\@hydra1 uname -a`."\n"; +print OUTFILE "# hydra2: ".`ssh root\@hydra2 uname -a`."\n"; +print OUTFILE "#\n"; +print OUTFILE "kernel,tso,lro,mtu,cores,trial,"; +print OUTFILE "bytes,seconds,conns,bandwidth,user,nice,sys,intr,idle\n"; +close(OUTFILE); + +system("ssh root\@hydra1 killall tcpp"); +system("ssh root\@hydra2 killall tcpp"); +sleep(1); +system("ssh root\@hydra2 ${tcpp_dir}/tcpp -s -p 8&"); +sleep(1); + +sub test { + my ($kernel, $tso, $lro, $mtu) = @_; + + $prefix = "$kernel,$tso,$lro,$mtu"; + print "Configuring $prefix\n"; + + system("ssh root\@hydra1 ifconfig cxgb0 $tso $lro mtu $mtu"); + + system("ssh root\@hydra2 ifconfig cxgb0 $tso $lro mtu $mtu"); + + print "Running $prefix\n"; + system("ssh root\@hydra1 '(cd $tcpp_dir ; csh parallelism.csh ". + "$outfile $prefix)'"); +} + +# Frobbing MTU requires resetting the host cache, which we don't do, +# so don't frob MTU. +@mtu_options = ("1500"); +@tso_options = ("tso", "-tso"); +@lro_options = ("lro", "-lro"); + +foreach $mtu (@mtu_options) { + foreach $tso (@tso_options) { + foreach $lro (@lro_options) { + sleep(5); + test($kernel, $tso, $lro, $mtu); + } + } +}