From: Stan Smith Date: Wed, 14 Apr 2010 00:12:31 +0000 (+0000) Subject: [OFED\WIX] rename OFED\WIX\SDK_Samples\ DDK --> WDK VS --> cmtest X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=44935a6591e154bf15e376c97d79e4827da6b0a0;p=~shefty%2Frdma-win.git [OFED\WIX] rename OFED\WIX\SDK_Samples\ DDK --> WDK VS --> cmtest git-svn-id: svn://openib.tc.cornell.edu/gen1@2780 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/OFED/WIX/SDK_Samples/WDK/README.txt b/trunk/OFED/WIX/SDK_Samples/WDK/README.txt new file mode 100644 index 00000000..9c5257d2 --- /dev/null +++ b/trunk/OFED/WIX/SDK_Samples/WDK/README.txt @@ -0,0 +1,102 @@ + +WDK (Windows Driver Kit) Build Environment Example [4-08-10] +----------------------------------------------------------------- + +Install the Windows WDK see + http://www.microsoft.com/whdc/Devtools/wdk/default.mspx + +Why use the WDK? WDK (600.16385.0) is what's used to build the OFED for Windows +distribution. +Installing the WDK first requires burning a CD of the downloaded WDK - sigh... + +Due to the problematic nature of spaces in path names, the Windows Driver Kit +does not allow spaces in pathnames; Due to the spaces in %ProgramFiles%\OFED +path, the OFED_SDK is not installed under %ProgramFiles%\OFED. +See %SystemDrive%\OFED_SDK\ + + +Building CM test example +------------------------ + +Start a 'Free/Release' type WDK command window for you respective architecture +[x86,amd64,ia64]; assumed OS is Windows Server 2008 R2 (aka win7). + +cd to %SystemDrive%\OFED_SDK\Samples\DDK + +Set the 'OPENIB_REV' env variable to the svn version number; any # will work. +Hold the mouse-point over the file 'C:\Program Files\OFED\opensm.exe'. +The last field of the 'File Version' field is the svn revision number. + +example: set OPENIB_REV=917 + +If building an 32-bit cmtest version on an x64 platform, edit Sources file by +adding '32' to ibal.lib and complib.lib, resulting in 'ibal32.lib' and +'complib32.lib'. +Note - executable will be appear as 'objfre_win7_x86\i386\cmtest.exe'. + +build /wg + +The executable will be created in a processor specific directory: + + x64 (Release/Free) example: + %SystemDrive%\OFED_SDK\Samples\DDK\objfre_win7_amd64\amd64\cmtest.exe + + x64 (Checked/Debug)) example: + %SystemDrive%\OFED_SDK\Samples\DDK\objchk_win7_amd64\amd64\cmtest.exe + + x86 (Release/Free) example: + %SystemDrive%\OFED_SDK\Samples\DDK\objfre_win7_x86\i386\cmtest.exe + +Executing cmtest.exe +-------------------- + +cmtest.exe passes messages between the server and client over a reliable IB +queue-pair connection (RC). +Connection end-points (hosts) are identified by IB port LID (hex integer, as +displayed by the vstat command). + +Note: are not allowed between command line switch and it's argument. + +Server side: cmtest -s -l0xlll -r0xrrr -m1024 -n100 + +Client side: cmtest.exe -l0xlll -r0xrrr -m1024 -n100 + +where: + lll == local port lid as displayed by vstat command. + rrr == Remote port lid as displayed by vstat command; + lll == rrr for local loopback operation. + -m == bytes per message + -n == number of messages to send. + -c == number of connections (default is -c1) + cmtest -h reveals all... + + +Example cmtest invocation +------------------------- + +cmdWin> vstat + + hca_idx=0 + uplink={BUS=UNRECOGNIZED (33)} + vendor_id=0x02c9 + vendor_part_id=0x6278 + hw_ver=0xa0 + fw_ver=4.08.0200 + PSID=_00A0000001 + node_guid=0002:c902:0020:1d74 + num_phys_ports=2 + port=1 + port_state=PORT_ACTIVE (4) <==== Must be active! + link_speed=2.5Gbps (1) + link_width=4x (2) + rate=10 + sm_lid=0x0001 + port_lid=0x0020 <==== -l0x20 + port_lmc=0x0 + max_mtu=2048 (4) + + +Separate processes for server & client (different cmd windows). + +server: cmtest -s -l0x20 -r0x20 -m8192 -n400 +client: cmtest -l0x20 -r0x20 -m8192 -n400 diff --git a/trunk/OFED/WIX/SDK_Samples/WDK/SOURCES b/trunk/OFED/WIX/SDK_Samples/WDK/SOURCES new file mode 100644 index 00000000..160f23fd --- /dev/null +++ b/trunk/OFED/WIX/SDK_Samples/WDK/SOURCES @@ -0,0 +1,21 @@ +TARGETNAME=cmtest +TARGETPATH=obj$(BUILD_ALT_DIR) +TARGETTYPE=PROGRAM +UMTYPE=console +USE_MSVCRT=1 +_LIBS=C:\OFED_SDK\Lib + +SOURCES=cmtest.c cmtest.rc + +INCLUDES=C:\OFED_SDK\Inc; + +TARGETLIBS= \ +!if $(FREEBUILD) + $(_LIBS)\complib.lib \ + $(_LIBS)\ibal.lib +!else + $(_LIBS)\complibd.lib \ + $(_LIBS)\ibald.lib +!endif + +MSC_WARNING_LEVEL= /W3 diff --git a/trunk/OFED/WIX/SDK_Samples/WDK/cmtest.rc b/trunk/OFED/WIX/SDK_Samples/WDK/cmtest.rc new file mode 100644 index 00000000..3c02ca9b --- /dev/null +++ b/trunk/OFED/WIX/SDK_Samples/WDK/cmtest.rc @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2007 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + + +#include + +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT2_UNKNOWN + +#if DBG +#define VER_FILEDESCRIPTION_STR "Connection Manager Test (Debug)" +#define VER_INTERNALNAME_STR "cmtest.exe" +#define VER_ORIGINALFILENAME_STR "cmtest.exe" +#else +#define VER_FILEDESCRIPTION_STR "Connection Manager Test (Release)" +#define VER_INTERNALNAME_STR "cmtest.exe" +#define VER_ORIGINALFILENAME_STR "cmtest.exe" +#endif + +#include diff --git a/trunk/OFED/WIX/SDK_Samples/WDK/makefile b/trunk/OFED/WIX/SDK_Samples/WDK/makefile new file mode 100644 index 00000000..46abe2e5 --- /dev/null +++ b/trunk/OFED/WIX/SDK_Samples/WDK/makefile @@ -0,0 +1,7 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the driver components of the OpenIB Windows project. +# + +!INCLUDE C:\OFED_SDK\Inc\openib.def diff --git a/trunk/OFED/WIX/SDK_Samples/cmtest/Makefile.x64 b/trunk/OFED/WIX/SDK_Samples/cmtest/Makefile.x64 new file mode 100644 index 00000000..a09bb5e1 --- /dev/null +++ b/trunk/OFED/WIX/SDK_Samples/cmtest/Makefile.x64 @@ -0,0 +1,97 @@ +# +#********************************************************************* +# +# NMAKE Options (passed as macro) +# +# Select a Visual Studio command window from the start menu +# vcvarsall X64 - sets X64 processor compilation env, X86 | IA64 +# +#*********************************************************************/ + + +#********************************************************************* +# +# Dot Directives +# +#*********************************************************************/ + +.SUFFIXES : # clear the .SUFFIXES list +.SUFFIXES : .c # initialize .SUFFIXES list + + +#********************************************************************* +# +# Macros +# +#*********************************************************************/ + +SRC=cmtest + +LIB_PATH=C:\OFED_SDK\Lib +INC_PATH=C:\OFED_SDK\Inc + +IB_LIBS=ibal.lib complib.lib + +DEFS= /D_WIN64 /D_X64_ /D_AMD64_ + +ARCH=x64 + +OBJS = $(SRC).obj +EXEC = $(SRC).exe + +# +# Compiler +# + +CC = cl + +INC_FLAGS = /I $(INC_PATH) + +UNUSED_CL=/Zp1 /Od +UNUSED_LINKER= /DEBUG /incremental:no + +CC_FLAGS= /nologo /Gy /W3 /Gm- \ + /GR- /GF /O2 /Oi /Oy- /D_CRT_SECURE_NO_WARNINGS \ + $(DEFS) $(INC_FLAGS) + +# +# Linker +# + +LINK = link + +LIBS = ws2_32.lib advapi32.lib User32.lib + +LINK_FLAGS = /nologo /subsystem:console /machine:$(ARCH) $(LIBS) \ + /libpath:$(LIB_PATH) $(IB_LIBS) + +# +# System Utilities +# + +RM = del /Q + + +#********************************************************************* +# Inference Rules +# +#*********************************************************************/ + +.c.obj: + $(CC) $(CC_FLAGS) /Fo$@ /c $< + + +#********************************************************************* +# +# Description Blocks +# +#*********************************************************************/ + +all : $(EXEC) + + +$(EXEC) : $(OBJS) $0 + $(LINK) $(LINK_FLAGS) /out:$(EXEC) $(OBJS) + +clean: + -$(RM) *.exe *.pdb *.obj diff --git a/trunk/OFED/WIX/SDK_Samples/cmtest/Makefile.x86 b/trunk/OFED/WIX/SDK_Samples/cmtest/Makefile.x86 new file mode 100644 index 00000000..3631e063 --- /dev/null +++ b/trunk/OFED/WIX/SDK_Samples/cmtest/Makefile.x86 @@ -0,0 +1,100 @@ +# +#********************************************************************* +# +# NMAKE Options (passed as macro) +# +# Select a Visual Studio command window from the start menu +# vcvarsall X86 - sets X86 processor compilation env, X64 | IA64 +# +#*********************************************************************/ + + +#********************************************************************* +# +# Dot Directives +# +#*********************************************************************/ + +.SUFFIXES : # clear the .SUFFIXES list +.SUFFIXES : .c # initialize .SUFFIXES list + + +#********************************************************************* +# +# Macros +# +#*********************************************************************/ + +SRC=cmtest + +LIB_PATH=C:\OFED_SDK\Lib +INC_PATH=C:\OFED_SDK\Inc + +# For x86 on x64 system: IB_LIBS=ibal32.lib complib32.lib +# For x86 on x86 system: IB_LIBS=ibal.lib complib.lib + +IB_LIBS=ibal32.lib complib32.lib + +DEFS= /D_WIN32 + +ARCH=x86 + +OBJS = $(SRC).obj +EXEC = $(SRC).exe + +# +# Compiler +# + +CC = cl + +INC_FLAGS = /I $(INC_PATH) + +UNUSED_CL=/Zp1 /Od +UNUSED_LINKER= /DEBUG /incremental:no + +CC_FLAGS= /nologo /Gy /W3 /Gm- \ + /GR- /GF /O2 /Oi /Oy- /D_CRT_SECURE_NO_WARNINGS \ + $(DEFS) $(INC_FLAGS) + +# +# Linker +# + +LINK = link + +LIBS = ws2_32.lib advapi32.lib User32.lib + +LINK_FLAGS = /nologo /subsystem:console /machine:$(ARCH) $(LIBS) \ + /libpath:$(LIB_PATH) $(IB_LIBS) + +# +# System Utilities +# + +RM = del /Q + + +#********************************************************************* +# Inference Rules +# +#*********************************************************************/ + +.c.obj: + $(CC) $(CC_FLAGS) /Fo$@ /c $< + + +#********************************************************************* +# +# Description Blocks +# +#*********************************************************************/ + +all : $(EXEC) + + +$(EXEC) : $(OBJS) $0 + $(LINK) $(LINK_FLAGS) /out:$(EXEC) $(OBJS) + +clean: + -$(RM) *.exe *.pdb *.obj diff --git a/trunk/OFED/WIX/SDK_Samples/cmtest/README.txt b/trunk/OFED/WIX/SDK_Samples/cmtest/README.txt new file mode 100644 index 00000000..67e901bc --- /dev/null +++ b/trunk/OFED/WIX/SDK_Samples/cmtest/README.txt @@ -0,0 +1,113 @@ + +Visual Studio (C++) Build Environment [4-07-10] +----------------------------------------------------------------- + +Install Microsoft Visual Studio 10 (C++ env) + + +**** WARNING - win32 application building **** + +Disregard if building x64 application. + +The Visual Studio default x86 calling convention is '__cdecl' (/Gd). +The 32-bit versions of ibal32.lib & complib32.lib are built using '__stdcall' +as the default calling convention (AL_API & CL_API). +Make _sure_ 'all' user-defined ibal and complib callback routines match the +callback function declaration [AL_API or CL_API calling conventions]. +The VS compiler will note a C-style cast is required if the calling conventions +do not match. +The other option is to force __stdcall (/Gz) as the 'default' calling +convention for your 'win32' InfiniBand application. + + +Building CM test example from a cmd.exe window +---------------------------------------------- + + +cd to %SystemDrive%\OFED_SDK\Samples\VS + + +Makefile Solution +----------------- + +Assuming Visual Studio is installed, select a Visual Studio 2005 command +window from the start menu. + +vcvarsall X64 - sets X64 processor compilation env, X86 | IA64 + +nmake -f Makefile.x64 + +If building a win32 application on a 64-bit platform then link with +lbal32[d].lib & complib32[d].lib. + + + +Visual Studio Solution +---------------------- + +Double-click cmtest.c + +Create a New Solution 'Project from Existing Code', using cmtest.c & cmtest.rc +Select a C++ console application project. + +Salient Solution points: + compile as a C program + set additional Include path as C:\OFED_SDK\Inc + set additional Resource Include path as C:\OFED_SDK\Inc + Set additional Library path as C:\OFED_SDK\Lib . + Link with additional libraries ibal.lib & complib.lib . + If building a win32 application on a 64-bit platform then link with + lbal32[d].lib & complib32[d].lib + + +Executing cmtest.exe +-------------------- + +cmtest.exe passes messages between the server and client over a reliable +IB queue-pair connection (RC). +Connection end-points (hosts) are identified by IB port LID (hex integer, +as displayed by the vstat command). + +Note: are not allowed between command line switch and it's argument. + +Server side: cmtest -s -l0xlll -r0xrrr -m1024 -n100 + +Client side: cmtest.exe -l0xlll -r0xrrr -m1024 -n100 + +where: + lll == local port lid as displayed by vstat command. + rrr == Remote port lid as displayed by vstat; lll == rrr for local loopback + operation. + -m == bytes per message + -n == number of messages to send. + -c == number of connections (default is -c1) + cmtest -h reveals all... + +Example cmtest invocation: local loopback test + +cmdWin> vstat + + hca_idx=0 + uplink={BUS=UNRECOGNIZED (33)} + vendor_id=0x02c9 + vendor_part_id=0x6278 + hw_ver=0xa0 + fw_ver=4.08.0200 + PSID=_00A0000001 + node_guid=0002:c902:0020:1d74 + num_phys_ports=2 + port=1 + port_state=PORT_ACTIVE (4) <==== Must be active! + link_speed=2.5Gbps (1) + link_width=4x (2) + rate=10 + sm_lid=0x0001 + port_lid=0x0020 <=== -l0x20 + port_lmc=0x0 + max_mtu=2048 (4) + + +Separate processes for server & client (different cmd windows). + +server: cmtest -s -l0x20 -r0x20 -m8192 -n400 +client: cmtest -l0x20 -r0x20 -m8192 -n400 diff --git a/trunk/OFED/WIX/SDK_Samples/cmtest/cmtest.rc b/trunk/OFED/WIX/SDK_Samples/cmtest/cmtest.rc new file mode 100644 index 00000000..b0a596b0 --- /dev/null +++ b/trunk/OFED/WIX/SDK_Samples/cmtest/cmtest.rc @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2007 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +#define IB_COMPANYNAME "OpenFabricsAlliance\x20Windows" +#define IB_PRODUCTNAME "WinOF" +#define VER_FILEMAJORVERSION 1 +#define VER_FILEMINORVERSION 0 +#define VER_FILEBUILD 1 +#define VER_FILEREV 906 + +#include + +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT2_UNKNOWN + + +#if DBG +#define VER_FILEDESCRIPTION_STR "Connection Manager Test (Debug)" +#define VER_INTERNALNAME_STR "cmtest.exe" +#define VER_ORIGINALFILENAME_STR "cmtest.exe" +#else +#define VER_FILEDESCRIPTION_STR "Connection Manager Test (Release)" +#define VER_INTERNALNAME_STR "cmtest.exe" +#define VER_ORIGINALFILENAME_STR "cmtest.exe" +#endif + +#include