[netperf-dev] netperf2 commit notice r515 - in trunk: . src
raj at netperf.org
raj at netperf.org
Mon Dec 5 16:34:36 PST 2011
Author: raj
Date: 2011-12-05 16:34:36 -0800 (Mon, 05 Dec 2011)
New Revision: 515
Modified:
trunk/Release_Notes
trunk/src/netlib.c
trunk/src/netsh.c
trunk/src/netsh.h
trunk/src/nettest_bsd.h
trunk/src/nettest_omni.c
Log:
enable setting a fill file name on the remote via the netperf command line
Modified: trunk/Release_Notes
===================================================================
--- trunk/Release_Notes 2011-12-03 00:53:35 UTC (rev 514)
+++ trunk/Release_Notes 2011-12-06 00:34:36 UTC (rev 515)
@@ -1,5 +1,8 @@
These are the Release Notes for post Revision 2.5.0 top-of-trunk netperf:
+*) The global -F option can now be used specify a local and/or remote
+ fill file.
+
*) It is now possible to set/get the TCP congestion control algorithm
being used by either end of the test connection when using the omni
code. The output selectors are LOCAL_CONG_CONTROL and
Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c 2011-12-03 00:53:35 UTC (rev 514)
+++ trunk/src/netlib.c 2011-12-06 00:34:36 UTC (rev 515)
@@ -1451,16 +1451,17 @@
/* did the user wish to have the buffers pre-filled with data from a */
/* particular source? */
- if (strcmp(fill_file,"") == 0) {
+ if (strcmp(local_fill_file,"") == 0) {
do_fill = 0;
fill_source = NULL;
}
else {
do_fill = 1;
- fill_source = (FILE *)fopen(fill_file,"r");
+ fill_source = (FILE *)fopen(local_fill_file,"r");
if (fill_source == (FILE *)NULL) {
- perror("Could not open requested fill file");
- exit(1);
+ fprintf(where,"Could not open requested fill file: %s\n",
+ strerror(errno));
+ fflush(where);
}
}
@@ -1590,8 +1591,8 @@
send or receive operations. each of these buffers will be aligned
and offset as per the users request. the circumference of this ring
will be controlled by the setting of send_width. the buffers will
- be filled with data from the file specified in fill_file. if
- fill_file is an empty string, the buffers will not be filled with
+ be filled with data from the file specified in local_fill_file. if
+ local_fill_file is an empty string, the buffers will not be filled with
any particular data */
struct ring_elt *
@@ -1617,12 +1618,12 @@
/* did the user wish to have the buffers pre-filled with data from a */
/* particular source? */
- if (strcmp (fill_file, "") == 0) {
+ if (strcmp (local_fill_file, "") == 0) {
do_fill = 0;
fill_source = NULL;
} else {
do_fill = 1;
- fill_source = (FILE *) fopen (fill_file, "r");
+ fill_source = (FILE *) fopen (local_fill_file, "r");
if (fill_source == (FILE *) NULL) {
perror ("Could not open requested fill file");
exit (1);
@@ -1753,7 +1754,7 @@
/* if the user has not specified a file with the -F option, we will
fail the test. otherwise, go ahead and try to open the
file. 08/2000 */
- if (strcmp(fill_file,"") == 0) {
+ if (strcmp(local_fill_file,"") == 0) {
/* use an temp file for the fill file */
char temp_file[] = {"netperfXXXXXX\0"};
int *temp_buffer;
@@ -1810,7 +1811,7 @@
}
else {
/* the user pointed us at a file, so try it */
- fildes = open(fill_file , O_RDONLY);
+ fildes = open(local_fill_file , O_RDONLY);
if (fildes == -1){
perror("alloc_sendfile_buf_ring: Could not open requested file");
exit(1);
@@ -1819,7 +1820,7 @@
complete ring. that way we do not need additional logic in the
ring setup to deal with wrap-around issues. we might want that
someday, but not just now. 08/2000 */
- if (stat(fill_file,&statbuf) != 0) {
+ if (stat(local_fill_file,&statbuf) != 0) {
perror("alloc_sendfile_buf_ring: could not stat file");
exit(1);
}
Modified: trunk/src/netsh.c
===================================================================
--- trunk/src/netsh.c 2011-12-03 00:53:35 UTC (rev 514)
+++ trunk/src/netsh.c 2011-12-06 00:34:36 UTC (rev 515)
@@ -112,7 +112,8 @@
local_address_family = AF_UNSPEC; /* which address family local */
/* the source of data for filling the buffers */
-char fill_file[BUFSIZ] = "";
+char local_fill_file[BUFSIZ] = "";
+char remote_fill_file[32] = ""; /* size limited for control message */
/* output controlling variables */
int
@@ -266,7 +267,7 @@
-D [secs,units] * Display interim results at least every secs seconds\n\
using units as the initial guess for units per second\n\
-f G|M|K|g|m|k Set the output units\n\
- -F fill_file Pre-fill buffers with data from fill_file\n\
+ -F lfill[,rfill]* Pre-fill buffers with data from specified file\n\
-h Display this text\n\
-H name|ip,fam * Specify the target machine and/or local ip and family\n\
-i max,min Specify the max and min number of iterations (15,1)\n\
@@ -699,8 +700,16 @@
libfmt = *optarg;
break;
case 'F':
- /* set the fill_file variable for pre-filling buffers */
- strcpy(fill_file,optarg);
+ /* set the fill_file variables for pre-filling buffers */
+ break_args_explicit(optarg,arg1,arg2);
+ if (arg1[0]) {
+ strncpy(local_fill_file,arg1,sizeof(local_fill_file));
+ local_fill_file[sizeof(local_fill_file) - 1] = '\0';
+ }
+ if (arg2[0]) {
+ strncpy(remote_fill_file,arg2,sizeof(remote_fill_file));
+ remote_fill_file[sizeof(remote_fill_file) - 1] = '\0';
+ }
break;
case 'i':
/* set the iterations min and max for confidence intervals */
Modified: trunk/src/netsh.h
===================================================================
--- trunk/src/netsh.h 2011-12-03 00:53:35 UTC (rev 514)
+++ trunk/src/netsh.h 2011-12-06 00:34:36 UTC (rev 515)
@@ -194,7 +194,8 @@
test_name[BUFSIZ];
extern char
- fill_file[BUFSIZ];
+ local_fill_file[BUFSIZ],
+ remote_fill_file[32];
extern char *
result_brand;
Modified: trunk/src/nettest_bsd.h
===================================================================
--- trunk/src/nettest_bsd.h 2011-12-03 00:53:35 UTC (rev 514)
+++ trunk/src/nettest_bsd.h 2011-12-06 00:34:36 UTC (rev 515)
@@ -88,6 +88,7 @@
adjust the define below */
#define OMNI_REQUEST_CONV_CUTOFF 38
char cong_control[16]; /* the requested congestion control alg */
+ char fill_file[32]; /* file from which netserver fills bufs */
};
struct omni_response_struct {
Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c 2011-12-03 00:53:35 UTC (rev 514)
+++ trunk/src/nettest_omni.c 2011-12-06 00:34:36 UTC (rev 515)
@@ -681,6 +681,8 @@
REMOTE_SOCKET_TOS,
LOCAL_CONG_CONTROL,
REMOTE_CONG_CONTROL,
+ LOCAL_FILL_FILE,
+ REMOTE_FILL_FILE,
COMMAND_LINE, /* COMMAND_LINE should always be "last" */
OUTPUT_END,
NETPERF_OUTPUT_MAX
@@ -1297,6 +1299,10 @@
return "LOCAL_CONG_CONTROL";
case REMOTE_CONG_CONTROL:
return "REMOTE_CONG_CONTROL";
+ case LOCAL_FILL_FILE:
+ return "LOCAL_FILL_FILE";
+ case REMOTE_FILL_FILE:
+ return "REMOTE_FILL_FILE";
case OUTPUT_END:
return "OUTPUT_END";
default:
@@ -2303,6 +2309,12 @@
"Algorithm", "%s", remote_cong_control, 0,
OMNI_WANT_REM_CONG);
+ set_output_elt(LOCAL_FILL_FILE, "Local", "Fill", "File", "", "%s",
+ local_fill_file,0,0);
+
+ set_output_elt(REMOTE_FILL_FILE, "Remote", "Fill", "File", "", "%s",
+ remote_fill_file,0,0);
+
set_output_elt(OUTPUT_END, "This", "Is", "The", "End", "%s",
NULL, 0, 0);
@@ -3638,7 +3650,11 @@
if (debug > 1) {
fprintf(where,"netperf: send_omni: requesting OMNI test\n");
}
-
+
+ strncpy(omni_request->fill_file,
+ remote_fill_file,
+ sizeof(omni_request->fill_file));
+
send_request_n(OMNI_REQUEST_CONV_CUTOFF);
@@ -4715,6 +4731,12 @@
connection_test = omni_request->flags & OMNI_CONNECT_TEST;
direction = omni_request->direction;
+ /* let's be quite certain the fill file string is null terminated */
+ omni_request->fill_file[sizeof(omni_request->fill_file) - 1] = '\0';
+ strncpy(local_fill_file,
+ omni_request->fill_file,
+ sizeof(local_fill_file));
+
/* kludgy, because I have no way at present to say how many bytes
needed to be swapped around for the request from which this is
pulled, and it is probably all wrong for IPv6 :( */
More information about the netperf-dev
mailing list