# Problems compiling latest msk into 8.0-RELEASE kernel



## kollektiv (Mar 15, 2010)

Hi, I am trying to add a fix to my kernel as the last step to fix my fileserver. I've ran into many issues with zfs and the Marvell Yukon 88E8056 Gigabit controller. 

The first issue I faced was zfs causing a kernel crash when transferring at an average of 50 MB/s using Samba. Occasionally I would get this. 


```
panic: kmem_malloc(131072): kmem_map too small: 1346445312 total allocated
cpuid = 0
Uptime: 24m20s
Physical memory: 4066 MB
Dumping 2825 MB: 2810 2794 278 2762
```

After some Googling, http://old.nabble.com/Repeatable-ZFS-"kmem-map-too-small"-panic-on-8.0-STABLE-td27262408.html, suggested adding vm.kmem_size="20G". This seemed to fix it. Surprisingly, my Samba transfer rate increased to 75 MB/s.

But, this was only half of the problem. The other half of the time I would get this error after transferring for about 15 minutes on Samba.


```
msk0: watchdog timeout (missed Tx interrupts)
```

So after a lot more Googling I found this http://www.freebsd.org/cgi/query-pr.cgi?pr=116853. And it seems that would fix my Gigabit controller. Now, I am trying to add in the latest msk sources from http://svn.freebsd.org/viewvc/base/head/sys/dev/msk/. But, I've ran into compilation issues. I copied over the SVN versions of if_msk.c and if_regmsk.h into /usr/src/sys/dev/msk. My kernel source is the one that comes with 8.0-RELEASE-amd64-dvd1.is.gz.

The default if_msk.c and if_regmsk.h came from revision 198475 (10/25/2009)

I followed the instructions on http://www.freebsd.org/doc/handbook/kernelconfig-building.html on how to build the kernel. I'm using the GENERIC conf in amd64. The command I typed in was "make buildkernel KERNCONF=MYKERNEL"

However, it fails on compiling if_msk.c. Here is the output of stderr


```
./aicasm: 880 instructions used
./aicasm: 826 instructions used
../aicasm/aicasm: 880 instructions used
../aicasm/aicasm: 826 instructions used
/usr/src/sys/dev/msk/if_msk.c: In function 'msk_ioctl':
/usr/src/sys/dev/msk/if_msk.c:1093: error: 'IFCAP_VLAN_HWTSO' undeclared (first use in this function)
/usr/src/sys/dev/msk/if_msk.c:1093: error: (Each undeclared identifier is reported only once
/usr/src/sys/dev/msk/if_msk.c:1093: error: for each function it appears in.)
cc1: warnings being treated as errors
/usr/src/sys/dev/msk/if_msk.c: In function 'mskc_reset':
/usr/src/sys/dev/msk/if_msk.c:1448: warning: implicit declaration of function 'pci_get_max_read_req'
/usr/src/sys/dev/msk/if_msk.c:1448: warning: nested extern declaration of 'pci_get_max_read_req'
/usr/src/sys/dev/msk/if_msk.c:1449: warning: implicit declaration of function 'pci_set_max_read_req'
/usr/src/sys/dev/msk/if_msk.c:1449: warning: nested extern declaration of 'pci_set_max_read_req'
/usr/src/sys/dev/msk/if_msk.c: In function 'msk_attach':
/usr/src/sys/dev/msk/if_msk.c:1618: error: 'IFCAP_VLAN_HWTSO' undeclared (first use in this function)
```

Are there any other source files I need to copy over to make this work? Thanks for taking the time to read.


----------

