Obtain Hardware
- Buy the NetFPGA stuff
- Obtain a PC to use as the host Machine
Installing from git
-
git clone git@github.com:Caustic/netfpga.git
-
You’ll need some bitfiles from the netfpga wiki Copy the
cpci*.bit
bitfiles from the tgz release. Just copy all bitfiles from their bitfile directory into your ~/netfpga/bitfiles. -
Plug in the NetFPGA and boot up!
-
Add
vmalloc=256M
to/boot/grub/grub.conf
or edit/etc/default/grub
and rungrub2-mkconfig
. Failing to complete this step will result in the NetFPGA interfaces not getting initialized. -
Add the necessary NF_ Environment variables:
source bashrc_addon.sh
-
Create simlinks for system binaries.
# ln -s ~/netfpga /usr/local/netfpga # ln -s /usr/local/netfpga/lib/scripts/cpci_config_reg_access/loadregs.sh /usr/lcoal/sbin/loadregs.sh # ln -s /usr/local/netfpga/lib/scripts/cpci_config_reg_access/dumpregs.sh /usr/local/sbin/dumpregs.sh
-
Install the driver
$ cd ~/netfpga/lib/C $ make $ sudo make install $ modprobe nf2
-
Reboot.
-
Check to see if things work
$ ~/netfpga/lib/scripts/cpci_config_reg_access/dumpregs.sh -f ~/defaultregs # for problem recovery $ ~/netfpga/lib/scripts/cpci_config_reg_access/loadregs.sh -f ~/defaultregs # do this if cpci_reprogram fails half way $ sudo ~/netfpga/lib/scripts/cpci_reprogram/cpci_reprogram.pl $ sudo /usr/local/bin/nf_download /usr/local/netfpga/bitfiles/reference_nic.bit # ifconfig nf2c[0-3] 10.0.1[0-3].1/24 for the 4 ports
Sources:
Issues I had and how I fixed them (Fedora 17 vanilla install):
# Error
Can't locate XML/Simple.pm in @INC
$ sudo yum install cpan
# Error
Can't locate Switch.pm in @INC
# Copied Switch.pm from my ubuntu machine to the perl lib on fedora
# Error
/usr/bin/ld: cannot find -lncurses
$ sudo yum install ncurses-static
# Error
fatal error: libnet.h: No such file or directory
$ sudo yum install libnet-devel
TODO:
- Run Selftests
- Run Regression Tests