You mean a "fail open", a "fail closed" will block traffic if/when things fail (it's "closed" when it fails; hence the name 'fail closed').I've been trying to find a "supported" fail closed bridge card (card still passes traffic even if the machine is off or not working)
-MD -MF.depend.bp_mod.o -MTbp_mod.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length -mno-aes -mno-avx -std=iso9899:1999 -c bp_mod.c -o bp_mod.o
In file included from bp_mod.c:74:
./bypass.h:274:27: error: field has incomplete type 'struct callout_handle'
struct callout_handle bp_timer;
^
./bypass.h:274:12: note: forward declaration of 'struct callout_handle'
struct callout_handle bp_timer;
^
./bypass.h:285:27: error: field has incomplete type 'struct callout_handle'
struct callout_handle bp_tpl_timer;
^
./bypass.h:274:12: note: forward declaration of 'struct callout_handle'
struct callout_handle bp_timer;
^
bp_mod.c:3200:25: error: implicit declaration of function 'timeout' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pbpctl_dev->bp_timer= timeout(wd_reset_timer, pbpctl_dev, 1);
^
bp_mod.c:3207:25: error: implicit declaration of function 'timeout' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pbpctl_dev->bp_timer= timeout(wd_reset_timer, pbpctl_dev, (pbpctl_dev->reset_time*hz)/1000);
^
bp_mod.c:4434:3: error: implicit declaration of function 'untimeout' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
untimeout(wd_reset_timer, pbpctl_dev, pbpctl_dev->bp_timer);
^
bp_mod.c:5866:29: error: implicit declaration of function 'timeout' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pbpctl_dev->bp_tpl_timer = timeout(bp_tpl_timer_fn, pbpctl_dev, BP_LINK_MON_DELAY*hz);
^
bp_mod.c:5876:3: error: implicit declaration of function 'untimeout' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
untimeout(bp_tpl_timer_fn, pbpctl_dev, pbpctl_dev->bp_tpl_timer);
^
bp_mod.c:5900:30: error: implicit declaration of function 'timeout' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pbpctl_dev->bp_tpl_timer= timeout(bp_tpl_timer_fn, pbpctl_dev, 1);
^
8 errors generated.
*** Error code 1
-MD -MF.depend.bp_mod.o -MTbp_mod.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=address -Wno-error=aggressive-loop-optimizations -Wno-error=array-bounds -Wno-error=attributes -Wno-error=cast-qual -Wno-error=enum-compare -Wno-error=inline -Wno-error=maybe-uninitialized -Wno-error=misleading-indentation -Wno-error=nonnull-compare -Wno-error=overflow -Wno-error=sequence-point -Wno-error=shift-overflow -Wno-error=tautological-compare -Wno-unused-but-set-variable -Wno-format-zero-length -finline-limit=8000 -fms-extensions --param inline-unit-growth=100 --param large-function-growth=1000 -std=iso9899:1999 -c bp_mod.c -o bp_mod.o
gcc48: error: unrecognized command line option '-fformat-extensions'
*** Error code 1
Stop.
make[1]: stopped in /usr/home/gmarco/bp_ctl-4.0.2/driver
*** Error code 1
Stop.
make: stopped in /usr/home/gmarco/bp_ctl-4.0.2
/home/gmarco/bp_ctl-4.0.2# gcc -v
Using built-in specs.
Target: i386-undermydesk-freebsd
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]
Drivers support:
================
Intel based bypass product currently support the following OS:
Linux kernel 2.4.x & 2.6.x & 3.x, 4.x
FreeBSD 4.7, 4.9, 4.11, 5.3, 5.4, 6.x, 7.x, 8x, 9.x
Windows 2008 and Windows 2003
VMware ESX_4_0, ESXi_4_0, ESX_i_4_1, ESX_4_1, ESXi_5_0, ESXi_5_1, ESXi_5_5, ESXi_6_0, ESXi 6_5
Citrix XenServer 5.6 FP 1 (2.6.32.12)
Yes that would be my guess. The releases of bp-ctl are rather frequent. So this program looks active.it is only old
objcopy --strip-debug bpmod.ko
===> util (all)
cc -O2 -pipe bpctl_util.c -o bpctl_util
bpctl_util.c:1160:20: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
printf(bp_cap_array[i].desc);
^~~~~~~~~~~~~~~~~~~~
bpctl_util.c:1160:20: note: treat the string as an argument to avoid this
printf(bp_cap_array[i].desc);
^
"%s",
1 warning generated.
Yes that would be my guess. The releases of bp-ctl are rather frequent. So this program looks active.
I did not compile this when I made the comments. I did download the source to confirm it still exists.
The last time I actually experimented with this was 3 years ago.
So I went ahead and compiled it for you on FreeBSD 12.2 to see if it works.
Code:objcopy --strip-debug bpmod.ko ===> util (all) cc -O2 -pipe bpctl_util.c -o bpctl_util bpctl_util.c:1160:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security] printf(bp_cap_array[i].desc); ^~~~~~~~~~~~~~~~~~~~ bpctl_util.c:1160:20: note: treat the string as an argument to avoid this printf(bp_cap_array[i].desc); ^ "%s", 1 warning generated.
I am pretty sure this warning is not a dealbreaker. You can work around this compiler complaining.
Looking for the files I see bpctl_util is built
:~/Silicom/FreeBSD/BP_Control/bp_ctl-4.0.2/util # ./bpctl_util
Can't open device file: bpmod
Looks like the module is the issue.
root@sily:/home/gmarco# kldload /boot/modules/bpmod.ko
kldload: an error occurred while loading module /boot/modules/bpmod.ko. Please check dmesg(8) for more details.
root@sily:/home/gmarco# kldstat
Id Refs Address Size Name
1 10 0xffffffff80200000 1f11f28 kernel
2 2 0xffffffff82113000 8178 bridgestp.ko
3 1 0xffffffff8211c000 fc48 if_bridge.ko
4 1 0xffffffff82320000 3250 ichsmb.ko
5 1 0xffffffff82324000 2180 smbus.ko
root@sily:/home/gmarco# tail -f /var/log/messages
Jan 8 19:20:17 sily kernel: Silicom Bypass Control driver v4.0.3
Jan 8 19:20:17 sily kernel: No such device
Jan 8 19:20:17 sily kernel: module_register_init: MOD_LOAD (bpmod, 0xffffffff8232cdc0, 0) error 19
kldload bpmod.ko
:~ # cc -v
FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2)
Target: x86_64-unknown-freebsd12.2
Thread model: posix
InstalledDir: /usr/bin
:~/Silicom/FreeBSD/BP_Control/bp_ctl-4.0.2 # make
===> driver (all)
machine -> /usr/src/sys/amd64/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/pci/pci_if.m -h
:> opt_bdg.h
Warning: Object directory not changed from original /Silicom/FreeBSD/BP_Control/bp_ctl-4.0.2/driver
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD -MF.depend.bp_mod.o -MTbp_mod.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 -c bp_mod.c -o bp_mod.o
ld -m elf_x86_64_fbsd -d -warn-common --build-id=sha1 -r -d -o bpmod.ko bp_mod.o
:> export_syms
awk -f /usr/src/sys/conf/kmod_syms.awk bpmod.ko export_syms | xargs -J% objcopy % bpmod.ko
objcopy --strip-debug bpmod.ko
===> util (all)
cc -O2 -pipe bpctl_util.c -o bpctl_util
bpctl_util.c:1160:20: warning: format string is not a string literal (potentially insecure)
[-Wformat-security]
printf(bp_cap_array[i].desc);
^~~~~~~~~~~~~~~~~~~~
bpctl_util.c:1160:20: note: treat the string as an argument to avoid this
printf(bp_cap_array[i].desc);
^
"%s",
1 warning generated.
:~/Silicom/FreeBSD/BP_Control/bp_ctl-4.0.2 #
This is the same message I get.kldload: an error occurred while loading module /boot/modules/bpmod.ko. Please check dmesg(8) for more details.
My bad. I missed this.Silicom staff send us the driver :
My bad. I missed this.
It is nice to have the source too. Should make debugging easier.
$ make
===> driver (all)
machine -> /usr/src/sys/amd64/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/pci/pci_if.m -h
? opt_bdg.h
Warning: Object directory not changed from original /usr/home/deri/gianmarco/bp_ctl-4.0.2/driver
make[1]: /usr/home/deri/gianmarco/bp_ctl-4.0.2/driver/.depend.bp_mod.o, 62: ignoring stale .depend for machine/pcpu_aux.h
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.bp_mod.o -MTbp_mod.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 -c bp_mod.c -o bp_mod.o
ld -m elf_x86_64_fbsd -d -warn-common --build-id=sha1 -r -d -o bpmod.ko bp_mod.o
? export_syms
awk -f /usr/src/sys/conf/kmod_syms.awk bpmod.ko export_syms | xargs -J% objcopy % bpmod.ko
objcopy --strip-debug bpmod.ko
===> util (all)
cc -O2 -pipe bpctl_util.c -o bpctl_util
bpctl_util.c:1160:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
printf(bp_cap_array[i].desc);
^~~~~~~~~~~~~~~~~~~~
bpctl_util.c:1160:20: note: treat the string as an argument to avoid this
printf(bp_cap_array[i].desc);
^
"%s",
1 warning generated.
root@sily:/usr/home/gmarco/drivers/bp_ctl-4.0.2# freebsd-version -kru
12.3-RELEASE
12.3-RELEASE
12.3-RELEASE
root@sily:/usr/home/gmarco/drivers/bp_ctl-4.0.2# make
===> driver (all)
machine -> /usr/src/sys/amd64/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
[...]
===> util (all)
cc -O2 -pipe bpctl_util.c -o bpctl_util
bpctl_util.c:1160:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
printf(bp_cap_array[i].desc);
^~~~~~~~~~~~~~~~~~~~
bpctl_util.c:1160:20: note: treat the string as an argument to avoid this
printf(bp_cap_array[i].desc);
^
"%s",
1 warning generated.
root@sily:/usr/home/gmarco/drivers/bp_ctl-4.0.2# make install
===> driver (install)
install -T release -o root -g wheel -m 555 bpmod.ko /boot/modules/
kldxref /boot/modules
===> util (install)
install bpctl_util /bin
root@sily:/usr/home/gmarco/drivers/bp_ctl-4.0.2# kldload /boot/modules/bpmod.ko
kldload: an error occurred while loading module /boot/modules/bpmod.ko. Please check dmesg(8) for more details.
root@sily:/usr/home/gmarco/drivers/bp_ctl-4.0.2# tail -3 /var/log/messages
Jan 9 17:52:48 sily kernel: Silicom Bypass Control driver v4.0.2
Jan 9 17:52:48 sily kernel: No such device
Jan 9 17:52:48 sily kernel: module_register_init: MOD_LOAD (bpmod, 0xffffffff82726d10, 0) error 19
root@sily:/usr/home/gmarco/drivers/bp_ctl-4.0.2# pciconf -vl | grep -A4 igb
igb2@pci0:0:20:0: class=0x020000 card=0x1f418086 chip=0x1f418086 rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = 'Ethernet Connection I354'
class = network
subclass = ethernet
igb3@pci0:0:20:1: class=0x020000 card=0x1f418086 chip=0x1f418086 rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = 'Ethernet Connection I354'
class = network
subclass = ethernet
igb4@pci0:0:20:2: class=0x020000 card=0x1f418086 chip=0x1f418086 rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = 'Ethernet Connection I354'
class = network
subclass = ethernet
igb5@pci0:0:20:3: class=0x020000 card=0x1f418086 chip=0x1f418086 rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = 'Ethernet Connection I354'
class = network
subclass = ethernet
igb0@pci0:3:0:0: class=0x020000 card=0x00008086 chip=0x15398086 rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = 'I211 Gigabit Network Connection'
class = network
subclass = ethernet
igb1@pci0:4:0:0: class=0x020000 card=0x00008086 chip=0x15398086 rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = 'I211 Gigabit Network Connection'
class = network
subclass = ethernet