			README File
		Cavium 45000 and 41000 series 
25/40 Gigabit Ethernet Adapter RDMA iWARP/RoCE(v1) Driver for FreeBSD 10.4 and 11.1

	Copyright (c) 2017-2019 Cavium Inc.,  All rights reserved. 


Table of Contents

1. Package Contents 
2. OS Support
3. Supported Features
4. Using the Driver
   4.1 Building the driver
   4.2 OFED modules required
   4.3 Installing the rdma driver
   4.4 Removing the rdma driver
   4.5 Enabling Debug traces
   4.6 krping
   4.7 rping
   4.8 ibstat

5. Applications Tested
6. Known issues
7. Contacting Support

1. Package Contents 
   * Documentation 
     - README (this document) version:1.0
     - Release Notes Version:1.0
   * Driver Sources

2. OS Support

   The Qlogic 41000/45000 25/40 Gigabit Ethernet iWARP RDMA driver is compatible
   with the following OS platforms:
    * FreeBSD 11.1(64-bit) [Intel EM64T, AMD64]

3. Supported Features

   iWARP/RoCE(v1) RDMA NIC/CNA driver supports OFED incorporated in the above FreeBSD
   releases in Kernel Mode Only.

4. Using the driver

   iWARP/RoCE(v1) driver uses the interfaces exported by the ethernet driver(qlnxe).
   In order to use the RDMA driver you need to make sure you build the
   ethernet driver with the following compile flags enabled.

   SRCS+=ecore_rdma.c
   SRCS+=ecore_roce.c
   SRCS+=ecore_iwarp.c
   SRCS+=ecore_ooo.c
   SRCS+=ecore_ll2.c
   SRCS+=qlnx_rdma.c

   CFLAGS += -DCONFIG_ECORE_LL2
   CFLAGS += -DCONFIG_ECORE_ROCE
   CFLAGS += -DCONFIG_ECORE_IWARP
   CFLAGS += -DCONFIG_ECORE_RDMA
   CFLAGS += -DQLNX_ENABLE_IWARP

 4.1 Building the driver

     #tar zxvf qlnx.version.tar.gz
     #cd qlnx.version
     #make

 4.2 OFED modules required

   4.2.1 Installing OFED on FreeBSD11.1

     In order to run iWARP/RoCE(v1) you need to install OFED which involves loading
     several kernel modules

     Please run the following script for FreeBSD 11.1

     ============ Script Start ============
        #cd /usr/src/sys/modules/ibcore
        #make cleandir && make
        #cd /usr/src/sys/modules/linuxkpi
        #make cleandir && make
        #cd ..
        #kldload -v ./linuxkpi/linuxkpi.ko
        #kldload -v ./ibcore/ibcore.ko
     ============ Script End ==============

   4.2.2 Installing OFED on FreeBSD10.4

     Please run the following commands to do so

     4.2.2.1 Create /usr/src/sys/amd64/conf/MYKERNEL

         #touch /usr/src/sys/amd64/conf/MYKERNEL

     4.2.2.2 Add the following lines to /usr/src/sys/amd64/conf/MYKERNEL

         #--------
         include         GENERIC
         ident           MYKERNEL
         options         OFED
         #--------

     4.2.2.3 Rebuild the kernel

         #make -j 24 buildkernel KERNCONF=MYKERNEL WITH_OFED=yes

     4.2.2.4 Install the kernel and reboot

         #make -j 24 installkernel KERNCONF=MYKERNEL WITH_OFED=yes
         #reboot


 4.3 Installing the rdma driver

     - Install the L2 driver 

         #kldload -v ./qlnxe/if_qlnxe.ko

     - Please make sure that the OFED kernel modules are loaded

     - Configure the RDMA personality 

         If the RDMA personality is already configured in the NVRAM 
	 you need not do anything.
	 If you want to override the personality on a specific device
	 please do the folowing. (Please note that the device number 
         is the function number assigned to the device during the pci
	 device scan.)

	 The personality is set using the
		sysctl hw.qlnxe.rdma_configuration in file /boot/loader.conf
	 Each personality is for device n is set as 4bit field at
		(PERSONALITY << n) in the above sysctl

	 where "PERSONALITY" can have the following values:
		0 : use personality in NVRAM
		1 : Override with ETH_ONLY
		2 : Override with ETH_IWARP
		3 : Override with ETH_ROCE

     - Install the iWARP/RoCE(v1) Driver

	 #kldload -v ./qlnxr/qlnxr.ko

 4.4 Removing the rdma driver
 
     - #kldunload qlnxr.ko

 4.5 Enabling Debug traces

     - To enable ecore RDMA traces 

	#sysctl dev.ql.[interface #].dp_level = 0;
	#sysctl dev.ql.[interface #].dp_module = 0x4000000;

     - To enable Driver traces.

	For function entry/exit
		#sysctl dev.ql.[interface #].debug = 0x800

	For errors
		#sysctl dev.ql.[interface #].debug = 0x400

	For both errors and function entry/exit
		#sysctl dev.ql.[interface #].debug = 0xC00

 4.6 krping

     - To Run krping you need to build and install krping.

	#cd /usr/src/sys/modules/rdma
	#make cleandir && make
	#cd ..
	#kldload -v ./rdma/krping/krping.ko

     - On the server side

	#echo "server,addr=IP_Address,port=PORT#,verbose" > /dev/krping

	For Example
	   #echo "server,addr=192.168.1.1,port=9997,verbose" > /dev/krping

     - On the client side

	#echo "client,addr=IP_Address,port=PORT#,count=NUM_PINGS" > /dev/krping

	For Example
	   #echo "client,addr=192.168.1.1,port=9997,count=100" > /dev/krping
 4.7 rping

     - To Run rping, the library librdmacm has to be installed
        #cd /usr/src/contrib/ofed/librdmacm/
        #make clean WITH_OFED=yes; make WITH_OFED=yes ; make install
	WITH_OFED=yes

     - On the server side
	#rping -s -a <IP_Addr> -v -C <PACKET_COUNT> -p <PORT#>
	For Example
	   #rping -s -a 192.168.1.1 -v -C 100 -p 9999

     - On the client side
	#rping -c -a <IP_Addr> -v -C <PACKET_COUNT> -p <PORT#>
	For Example
	   #rping -c -a 192.168.1.1 -v -C 100 -p 9999

 4.8 ibstat

     - ibstat is a utility to query the basic status of an infiniband device.
       Which makes it usable only with a RoCE device.

     - To build and install ibstat :
	#cd /usr/src/contrib/ofed/usr.bin
        #make clean WITH_OFED=yes; make WITH_OFED=yes ; make install
	WITH_OFED=yes

     - To run ibstat
	#ibstat

5. Applications Tested

   iWARP:

   Please note krping is the only kernel application being tested since it is
   the only one available with FreeBSD Distributions.

   RoCE:
   Presently, we have tested RoCEv1 traffic over krping and rping (section 4.6
   and section 4.7).
   For RoCE device status, we can use ibstat (section 4.8).

6. Known issues
  
   Please note that SW Updates with improved stability will be provided when
   appropriate.
   Here are the known issues (in debug or validation). Please note that
   SW Updates with improved stability will be provided when appropriate.

   - When the interface is configured to be of RoCE personality, the port number used
     in krping does not get released by krping server, after completion of krping
     cycle.


7. Contacting Support 
   Please feel free to contact your Cavium approved reseller or Cavium
   Technical Support at any phase of integration for assistance. Cavium
   Technical Support can be reached by the following methods:
   E-mail: support@cavium.com
   (c) Copyright 2019 Cavium Inc. All rights reserved worldwide.


