Skip to content

NIC Driver Quick Start

manihatn edited this page Feb 27, 2013 · 9 revisions

System Requirements

The NetFPGA-10G team develops on the Fedora 14 (x86_64) platform. The instructions in Reference Operating System will help you to set up a Fedora 14 (x86_64) development system.

Building the Driver

To build the driver, simply enter the driver's root directory and type the following:

make nf10_eth_driver

At the end of the build process you'll find the driver (*.ko file) in the bin/ directory. If you're interested in the intermediate outputs of the build process, you can find them in the build/$(shell date +%Y%m%d_%H%M)/ directory, named according to the time of the build.

To clean up a make, do:

make clean

Which will erase everything in the bin/ and build/ directories.

Building the Driver's Tools and Utilities (Optional)

The driver comes with some other nifty stuff that you can use to do things like read and write registers from userspace. This nifty stuff, however, depends on a generic netlink library that facilitates communication with the driver. Therefore to compile the driver's tools and utilities, we must first compile and install this library.

sudo yum install libnl3-devel

Alternatively, you can build it yourself.

cd lib/libnl-3.0/ ./configure make sudo make install`

Once this finishes successfully the libraries have been compiled and installed into /usr/local/lib on your system. To use them you need to tell software where to find them by setting the LD_LIBRARY_PATH environment variable, which you can do with the following command:

export LD_LIBRARY_PATH=/usr/local/lib

Tip: To make this automatically set every time you open a new terminal you can add that line to your ~/.bashrc file.

Once you've done this, you should be able to compile not only the driver, but also all the other nifty stuff too with the following command executed in the driver's root directory:

make

Again, to clean things up, do:

make clean

To learn how to use these extra nifty things please see their separate documentation pages.

Using the Driver

To use the driver, first make sure that you have programmed the NetFPGA-10G hardware properly and rebooted the computer. To make sure that your computer has detected the programmed hardware after a reboot, issue the following command:

lspci | grep Xilinx

At the time of writing, you should see something like the following:

03:00.0 RAM memory: Xilinx Corporation Device 4243 (rev 02)

If you don't see anything like this then you'll want to resolve this issue first before proceeding.

Now insert the driver into the kernel with the following command:

sudo insmod bin/nf10_eth_driver.ko

Then check the output messages with this command:

dmesg

At the time of writing, you should see something similar to this:

[13393.029644] nf10_eth_driver: Found NetFPGA-10G device with vendor_id: 0x10ee, device_id: 0x4243

[13393.029665] nf10_eth_driver: pci_driver 0000:03:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

[13393.029676] nf10_eth_driver: pci_driver 0000:03:00.0: setting latency timer to 64

[13393.036086] nf10_eth_driver: NetFPGA-10G Ethernet Driver version 1.1.9 Loaded.

If everything looks ok, bring up the interfaces with the following commands:

sudo ifconfig nf0 up

sudo ifconfig nf1 up

sudo ifconfig nf2 up

sudo ifconfig nf3 up

Alternatively you can do this for short:

for i in 0 1 2 3; do sudo ifconfig nf$i up; done

Check that the interfaces are up by looking at the output of this command:

ifconfig

You should see all the interfaces displayed there. It should look something like this:

nf0  Link encap:Ethernet  HWaddr 00:4E:46:30:00:00 

inet6 addr: fe80::24e:46ff:fe30:0/64 Scope:Link

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:6 errors:0 dropped:0 overruns:0 frame:0

TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:468 (468.0 b)  TX bytes:468 (468.0 b)

nf1  Link encap:Ethernet  HWaddr 00:4E:46:31:00:00 

inet6 addr: fe80::24e:46ff:fe31:0/64 Scope:Link

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:6 errors:0 dropped:0 overruns:0 frame:0

TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:468 (468.0 b)  TX bytes:468 (468.0 b)

nf2  Link encap:Ethernet  HWaddr 00:4E:46:32:00:00 

inet6 addr: fe80::24e:46ff:fe32:0/64 Scope:Link

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:6 errors:0 dropped:0 overruns:0 frame:0

TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:468 (468.0 b)  TX bytes:468 (468.0 b)

nf3  Link encap:Ethernet  HWaddr 00:4E:46:33:00:00 

inet6 addr: fe80::24e:46ff:fe33:0/64 Scope:Link

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:6 errors:0 dropped:0 overruns:0 frame:0

TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:468 (468.0 b)  TX bytes:468 (468.0 b)

For the above output, the interfaces were connected like this before they were brought up: nf0<->nf1, nf2<->nf3. This is why the interfaces have received exactly the number of packets that their neighbor has sent.

If all that worked OK then you're done, you've now got a 4 port 10G NIC up and running. Congratulations! You are now free to stand up and do a little jig in celebration.

Clone this wiki locally