| 244 | == 2. Installing NetFPGA Drivers == |
| 245 | Steps described by the NetFPGA tunneling page: |
| 246 | 1. Install base package |
| 247 | 2. Install !OpenFlow components |
| 248 | |
| 249 | === 1. Installing base package === |
| 250 | |
| 251 | 1. Download the tarballs from http://netfpga.org/beta/distributions/ [[BR]] |
| 252 | For this you need a !FosWiki account (register [http://www.netfpga.org/foswiki/bin/view/System/UserRegistration?skin= here]). Download the newest netfpga_base_beta package (currently 2.0.0). Untar: |
| 253 | |
| 254 | tar -xvf netfpga_base_beta_2_0_0.tar.gz |
| 255 | |
| 256 | Untarring the package will create the directory NF2. |
| 257 | |
| 258 | 2. Edit files/ symlinks as per compatibility page [[BR]] |
| 259 | |
| 260 | Create links: |
| 261 | {{{ |
| 262 | ln /usr/bin/lspci /sbin/lspci |
| 263 | ln /usr/bin/setpci /sbin/setpci |
| 264 | ln -s /usr/lib/libpcap.so.0.8 /usr/lib/libpcap.so.0.8.3 |
| 265 | }}} |
| 266 | |
| 267 | test_loopback_drop/run has been renamed run.pl in the most recent package. In this file you just need to change 'usleep 250' to 'sleep 0.00025'. |
| 268 | |
| 269 | NF2/lib/C/kernel/Makefile is already in working condition - you don't need to modify it. |
| 270 | |
| 271 | *Stopped at this point: The IRQF_SHARED flag is deprecated in kernels greater than 2.6.24. Instead, the SA_SHIRQ flag is used in include/linux/interrupt.h . in Ubuntu compatibility page** |
| 272 | |
| 273 | 3. Allocate more kernel memory [[BR]] |
| 274 | The NetFPGA requires 256M memory allocated. This can be done through /boot/grub/menu.lst on older kernels. For the newer versions of Ubuntu (e.g. 9.10), which uses Grub 2, you need to edit /boot/grub/grub.cfg from |
| 275 | {{{ |
| 276 | GRUB_CMDLINE_LINUX_DEFAULT="quiet splash |
| 277 | }}} |
| 278 | to |
| 279 | {{{ |
| 280 | GRUB_CMDLINE_LINUX_DEFAULT="vmalloc=256M |
| 281 | }}} |
| 282 | |
| 283 | 4. Edit and run user_account_setup.pl [[BR]] |
| 284 | The script sets environmental variables. It is located under /NF2/lib/scripts/user_account_setup/ . Running it as is will throw an error saying |
| 285 | |
| 286 | cat: /usr/local/NF2/bashrc_addon: No such file or directory |
| 287 | |
| 288 | The easiest thing to do is to edit the script to contain the exact path to your NF2 directory and bashrc_addon: |
| 289 | {{{ |
| 290 | else |
| 291 | { |
| 292 | print "Copying the NF2 directory to your user account\n"; |
| 293 | `cp -r /home/netfpga/NF2 ~`; |
| 294 | } |
| 295 | |
| 296 | print "Adding the NetFPGA Enviornment Variables to your .bashrc\n"; |
| 297 | `cat /home/netfpga/NF2/bashrc_addon >> ~/.bashrc\n`; |
| 298 | }}} |
| 299 | Then it will run correctly (here NF2 is already in the home directory) |
| 300 | {{{ |
| 301 | $ ./user_account_setup.pl NF2 directory already exists copy has been canceled |
| 302 | Adding the NetFPGA Enviornment Variables to your .bashrc |
| 303 | }}} |
| 304 | |
| 305 | |
| 306 | trying to use the 9.10 compatible stuff, found in http://www.netfpga.org/foswiki/bin/view/NetFPGA/OneGig/RealTimeSwitch |
| 307 | |
| 308 | ---- |
| 309 | ---- |
| 310 | = Installing Ubuntu, ~~take 3~~ take 4 = |
| 311 | After installing 9.10 server (AMD64) and 9.10 server 32 bit, we realized that there may be a "few" complications coming from the changes that were made in the more recent versions of Ubuntu (e.g. Grub 2, discarding "antiquated" libraries, ect), so things were rolled back to installing Ubuntu 9.04 server 32 bit. This should simplify *many* things. Hopefully. |
| 312 | |
| 313 | == 1. Installation of the OS == |
| 314 | 1. Go to the BIOS settings, make CD drive highest boot priority |
| 315 | |
| 316 | 2. Follow the default choices given for intallation, save the following few: |
| 317 | |
| 318 | * no setup of LVM for disk partitioning |
| 319 | * additional packages - install OpenSSH server |
| 320 | * hostname: netfpga1 |
| 321 | * user: netfpga |
| 322 | |
| 323 | 3. When rebooting, go back to the BIOS settings to make sure the HDD is included in the boot priority list. 'x' adds excluded devices to the boot priority list. |
| 324 | |
| 325 | 4. Who's afraid of a little command line? If you are, y' shoulda stuck with desktop edition. |
| 326 | |
| 327 | === Host info === |
| 328 | From past experience, the following info will come in handy when troubleshooting stuff... |
| 329 | * uname -a shows: 2.6.28-11-server i686 GNU/Linux |
| 330 | * IP address: 192.168.203.187 (DHCP - May change) |
| 331 | * bootloader: grub |
| 332 | |
| 333 | == 2. Installing drivers (NetFPGA) == |
| 334 | The host is named "Netfpga1" because it will be a NetFPGA host. So this is sort of important. |
| 335 | |
| 336 | * Ubuntu Compatibility |
| 337 | * http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/Guide |
| 338 | |
| 339 | 0. Get a Foswiki account so you can download the packages you need at their [http://www.netfpga.org/foswiki/bin/view/System/UserRegistration?skin= registration page]. |
| 340 | |
| 341 | 1. Update packages, then install the following dependencies as per the [http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/UbuntuCompatibility Comaptibility page]: |
257 | | == 2. Installing NetFPGA Drivers == |
258 | | Steps described by the NetFPGA tunneling page: |
259 | | 1. Install base package |
260 | | 2. Install !OpenFlow components |
261 | | |
262 | | === 1. Installing base package === |
263 | | |
264 | | 1. Download the tarballs from http://netfpga.org/beta/distributions/ [[BR]] |
265 | | For this you need a !FosWiki account (register [http://www.netfpga.org/foswiki/bin/view/System/UserRegistration?skin= here]). Download the newest netfpga_base_beta package (currently 2.0.0). Untar: |
266 | | |
267 | | tar -xvf netfpga_base_beta_2_0_0.tar.gz |
268 | | |
269 | | Untarring the package will create the directory NF2. |
270 | | |
271 | | 2. Edit files/ symlinks as per compatibility page [[BR]] |
272 | | |
273 | | Create links: |
| 355 | 2. Download the base package. The newest is netfpga_base_beta_2_0_0. Untar: |
| 356 | {{{ |
| 357 | tar xvf netfpga_base_beta_2_0_0.tar.gz |
| 358 | }}} |
| 359 | This will create a directory called NF2 in your home directory. |
| 360 | |
| 361 | 3. create symlinks: |
278 | | }}} |
279 | | |
280 | | test_loopback_drop/run has been renamed run.pl in the most recent package. In this file you just need to change 'usleep 250' to 'sleep 0.00025'. |
281 | | |
282 | | NF2/lib/C/kernel/Makefile is already in working condition - you don't need to modify it. |
283 | | |
284 | | *Stopped at this point: The IRQF_SHARED flag is deprecated in kernels greater than 2.6.24. Instead, the SA_SHIRQ flag is used in include/linux/interrupt.h . in Ubuntu compatibility page** |
285 | | |
286 | | 3. Allocate more kernel memory [[BR]] |
287 | | The NetFPGA requires 256M memory allocated. This can be done through /boot/grub/menu.lst on older kernels. For the newer versions of Ubuntu (e.g. 9.10), which uses Grub 2, you need to edit /boot/grub/grub.cfg from |
288 | | {{{ |
289 | | GRUB_CMDLINE_LINUX_DEFAULT="quiet splash |
290 | | }}} |
291 | | to |
292 | | {{{ |
293 | | GRUB_CMDLINE_LINUX_DEFAULT="vmalloc=256M |
294 | | }}} |
295 | | |
296 | | 4. Edit and run user_account_setup.pl [[BR]] |
297 | | The script sets environmental variables. It is located under /NF2/lib/scripts/user_account_setup/ . Running it as is will throw an error saying |
298 | | |
299 | | cat: /usr/local/NF2/bashrc_addon: No such file or directory |
300 | | |
301 | | The easiest thing to do is to edit the script to contain the exact path to your NF2 directory and bashrc_addon: |
302 | | {{{ |
303 | | else |
304 | | { |
305 | | print "Copying the NF2 directory to your user account\n"; |
306 | | `cp -r /home/netfpga/NF2 ~`; |
307 | | } |
308 | | |
309 | | print "Adding the NetFPGA Enviornment Variables to your .bashrc\n"; |
310 | | `cat /home/netfpga/NF2/bashrc_addon >> ~/.bashrc\n`; |
312 | | Then it will run correctly (here NF2 is already in the home directory) |
313 | | {{{ |
314 | | $ ./user_account_setup.pl NF2 directory already exists copy has been canceled |
315 | | Adding the NetFPGA Enviornment Variables to your .bashrc |
316 | | }}} |
317 | | |
318 | | **stopped here: The IRQF_SHARED flag is deprecated in kernels greater than 2.6.24. Instead, the SA_SHIRQ flag is used in include/linux/interrupt.h . in Ubuntu compatibility page ** |
319 | | ---- |
320 | | = METHOD 2 = |
321 | | |
322 | | trying to use the 9.10 compatible stuff, found in http://www.netfpga.org/foswiki/bin/view/NetFPGA/OneGig/RealTimeSwitch |
323 | | |
| 367 | |
| 368 | 4. Edit files by following the compatibility page. Some of the stuff there is outdated, so keep an eye out for the following: |
| 369 | |
| 370 | * /test_loopback_drop/run is /test_loopback_drop/run.pl |
| 371 | * edit "usleep 250" to "sleep 0.00025" in /test_loopback_drop/run.pl |
| 372 | * Don't change anything on /NF2/lib/C/kernel/Makefile |
| 373 | * Likewise, NF2/lib/C/download/nf2_download.c need not be edited. |
| 374 | |
| 375 | 5. Edit /boot/grub/menu.lst to allocate more kernel memory: |
| 376 | {{{ |
| 377 | title Ubuntu 9.04, kernel 2.6.28-16-generic |
| 378 | uuid (BIG number here) |
| 379 | kernel /vmlinuz-2.6.28-16-generic root=UUID=(BIG number here) ro quiet splash vmalloc=256M |
| 380 | }}} |
| 381 | |
| 382 | 6. Edit rkd.cc to include limits.h |
| 383 | |
| 384 | 7. Replace asm/semaphores with linux/semaphores |
| 385 | |
| 386 | 8. `make` and `make install` in user's NF2 directory (you need to be root) |
| 387 | |
| 388 | == Testing that NetFPGA works == |
| 389 | 1. Reprogram CPCI |
| 390 | |
| 391 | In cpci_reprogram.pl line 216, change the offset from 5 to 4: |
| 392 | {{{ |
| 393 | # Search for the NetFPGA device ID |
| 394 | if ($words[4] eq $NF2_device_id) <<---over here |
| 395 | { |
| 396 | push (@device_list, $words[0]); |
| 397 | } |
| 398 | }}} |
| 399 | |
| 400 | Then run cpci_reprogram.pl (run from user home directory): |
| 401 | {{{ |
| 402 | /home/netfpga/NF2/lib/scripts/cpci_reprogram/cpci_reprogram.pl --all |
| 403 | }}} |
| 404 | Add the same command to /etc/rc.local so this is done automatically each time the machine is rebooted. |
| 405 | |
| 406 | 2. Rename interfaces. |
| 407 | |
| 408 | Since you need eth1 and 2 for the regression test, you need to change eth0 to eth2. Change "eth0" to "eth2" in /etc/udev/rules.d/70-persistent-net.rules so it looks similar to this: |
| 409 | {{{ |
| 410 | SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:48:b1:9d:a9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" |
| 411 | |
| 412 | # PCI device 0x8086:0x109a (e1000e) |
| 413 | SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:48:b1:9d:a8", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2" |
| 414 | }}} |
| 415 | |
| 416 | The changes will take effect after you reboot the machine. |
| 417 | |
| 418 | |
| 419 | |