Building the latest Intel ixgbe driver (1.9.0) on FreeBSD 7.1
This is a short note of what needed to be changes to get the Intel ixgbe driver build for the FreeBSD 7.1 kernel. I needed to build a product, INE Ultra, for a customer and the product is built on FreeBSD 7.1 with an Intel 10 Gigabit XF SR Dual Port Ethernet card.
When I booted the machine, there were no sign of Intel network devices apart from the motherboard ones. Then I found out, the card requires ixgbe driver which is not configured as part of the kernel compilation.
So I edited the /usr/src/sys/amd64/compile/<KERNEL NAME> file to include the module.
device ixgb # Intel PRO/10GbE Ethernet Card device ixgbe # Intel 10 Gigabit XF SR Dual Port Card <-- Add this line device le # AMD Am7900 LANCE and Am79C9xx PCnet
Then did the usual business of running /usr/sbin/config, makedepend and make clean. An error is reported during the make clean process.
rm -f .newdep
make -V CFILES -V SYSTEM_CFILES -V GEN_CFILES ........ -ffreestanding
In file included from ../../../dev/ixgbe/ixgbe.c:39:
../../../dev/ixgbe/ixgbe.h:87:21: error: tcp_lro.h: No such file or directory
This wasn’t a good sign. So I thought, I may as well download the latest ixgbe driver from the Intel website, ixgbe-1.9.0
Unpacked the source code and restarted the compilation. There were several problems in building the module because the driver code generated several warnings which is not allowed in the default settings for the kernel compilation.
First warning problem,
cc -c -O2 -frename ..... -ffreestanding -Werror ../../../dev/ixgbe/ixgbe_phy.c -I../../../dev/ixgbe
cc1: warnings being treated as errors
In file included from ../../../dev/ixgbe/ixgbe_phy.c:36:
../../../dev/ixgbe/ixgbe_common.h:76: warning: redundant redeclaration of 'ixgbe_add_uc_addr'
../../../dev/ixgbe/ixgbe_api.h:99: warning: previous declaration of 'ixgbe_add_uc_addr' was here
*** Error code 1
In ixgbe_common.h, I commented out the line and recompiled
s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, u8 *addr_list, u32 addr_count, ixgbe_mc_addr_itr func); /* void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq); */ <--- Comment or remove this line s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw);
Oh dear, another warning problem,
cc -c -O2 -frename-registers ..... -ffreestanding -Werror ../../../dev/ixgbe/ixgbe_82598.c -I../../../dev/ixgbe
cc1: warnings being treated as errors
../../../dev/ixgbe/ixgbe_82598.c:87: warning: no previous prototype for 'ixgbe_set_pcie_completion_timeout'
*** Error code 1
Added the function prototype in ixgbe_82598.c and finger crossed…
void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw); void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw); <-- Add this line
Ooops, what the hell?? Linking problem.
MAKE=make sh ../../../conf/newvers.sh GENERIC
cc -c -O2 -frename-registers -pipe ..... -ffreestanding -Werror vers.c
linking kernel.debug
ixgbe_api.o(.text+0x975): In function `ixgbe_init_shared_code':
../../../dev/ixgbe/ixgbe_api.c:69: undefined reference to `ixgbe_init_ops_82599'
After sniffing a little bit of the code, I realised that the ixgbe_82599.c file wasn’t include in the build process. So edited the /usr/src/sys/conf/files
dev/ixgbe/ixgbe_common.c optional ixgbe \
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
dev/ixgbe/ixgbe_82598.c optional ixgbe \
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
dev/ixgbe/ixgbe_82599.c optional ixgbe \ <--------- Add this line
compile-with "${NORMAL_C} -I$S/dev/ixgbe" <--------- Add this line
Restarted the whole compilation again from /usr/sbin/config to make.
Then of course, hit another warning issue….
cc -c -O2 ........ -ffreestanding -Werror ../../../dev/ixgbe/ixgbe_82599.c -I../../../dev/ixgbe
cc1: warnings being treated as errors
../../../dev/ixgbe/ixgbe_82599.c:1127: warning: no previous prototype for 'ixgbe_find_vlvf_slot'
Added another function prototype in ixgbe_82599.c, and compiled again
s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps); static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); s32 ixgbe_find_vlvf_slot(struct ixgbe_hw *hw, u32 vlan); <--- Add this line
After all, the whole compilation went fine. Installed the new kernel and rebooted.
Run ifconfig -a. Bingo, ix0 and ix1.

Although incorporating the latest driver code didn’t go as smooth as I expected, however the changes were only trivial.
I work for iTrinegy and here are my other FreeBSD technical blogs





Hi ,
Could you help me to install a tool named pahole on freebsd .the tool suggests holes in structure definiton .I want use it to optimize performance