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