Skip to content

Commit 29cf808

Browse files
committed
add sume(4)
1 parent 7afc6ec commit 29cf808

12 files changed

Lines changed: 1994 additions & 22 deletions

File tree

share/man/man4/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ MAN= aac.4 \
533533
stf.4 \
534534
stg.4 \
535535
stge.4 \
536+
${_sume.4} \
536537
sym.4 \
537538
syncache.4 \
538539
syncer.4 \
@@ -884,12 +885,14 @@ _qlxgbe.4= qlxgbe.4
884885
_qlnxe.4= qlnxe.4
885886
_sfxge.4= sfxge.4
886887
_smartpqi.4= smartpqi.4
888+
_sume.4= sume.4
887889

888890
MLINKS+=qlxge.4 if_qlxge.4
889891
MLINKS+=qlxgb.4 if_qlxgb.4
890892
MLINKS+=qlxgbe.4 if_qlxgbe.4
891893
MLINKS+=qlnxe.4 if_qlnxe.4
892894
MLINKS+=sfxge.4 if_sfxge.4
895+
MLINKS+=sume.4 if_sume.4
893896

894897
.if ${MK_BHYVE} != "no"
895898
_bhyve.4= bhyve.4

share/man/man4/sume.4

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
.\"-
2+
.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3+
.\"
4+
.\" Copyright (c) 2020 Denis Salopek
5+
.\"
6+
.\" Redistribution and use in source and binary forms, with or without
7+
.\" modification, are permitted provided that the following conditions
8+
.\" are met:
9+
.\" 1. Redistributions of source code must retain the above copyright
10+
.\" notice, this list of conditions and the following disclaimer.
11+
.\" 2. Redistributions in binary form must reproduce the above copyright
12+
.\" notice, this list of conditions and the following disclaimer in the
13+
.\" documentation and/or other materials provided with the distribution.
14+
.\"
15+
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16+
.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18+
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19+
.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20+
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21+
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22+
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23+
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24+
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25+
.\" POSSIBILITY OF SUCH DAMAGE.
26+
.\"
27+
.\" $FreeBSD$
28+
.\"
29+
.Dd August 30, 2020
30+
.Dt SUME 4
31+
.Os
32+
.Sh NAME
33+
.Nm sume
34+
.Nd "NetFPGA SUME 4x10Gb Ethernet driver"
35+
.Sh SYNOPSIS
36+
To compile this driver into the kernel, place the following lines
37+
in your kernel configuration file:
38+
.Bd -ragged -offset indent
39+
.Cd "device sume"
40+
.Ed
41+
.Pp
42+
Alternatively, to load the driver as a module at boot time, place
43+
the following line in
44+
.Xr loader.conf 5 :
45+
.Bd -literal -offset indent
46+
if_sume_load="YES"
47+
.Ed
48+
.Sh DESCRIPTION
49+
The
50+
.Nm
51+
driver provides support for NetFPGA SUME Virtex-7 FPGA Development Board
52+
with the reference NIC bitstream loaded onto it.
53+
The HDL design for the reference NIC project uses the RIFFA based DMA
54+
engine to communicate with the host machine over PCIe.
55+
Every packet is transmitted to / from the board via a single DMA
56+
transaction, taking up to two or three interrupts per one transaction
57+
which yields low performance.
58+
.Pp
59+
There is no support for Jumbo frames as the hardware is capable of
60+
dealing only with frames with maximum size of 1514 bytes.
61+
The hardware does not support multicast filtering, provides no checksums,
62+
and offers no other offloading.
63+
.Sh SEE ALSO
64+
.Xr arp 4 ,
65+
.Xr netgraph 4 ,
66+
.Xr netintro 4 ,
67+
.Xr ng_ether 4 ,
68+
.Xr vlan 4 ,
69+
.Xr ifconfig 8
70+
.Sh AUTHORS
71+
The Linux
72+
.Nm
73+
driver was originally written by
74+
.An -nosplit
75+
.An Bjoern A. Zeeb .
76+
The
77+
.Fx version and this manual page were written by
78+
.An Denis Salopek
79+
as a GSoC project.
80+
More information about the project can be found here:
81+
.Pa https://wiki.freebsd.org/SummerOfCode2020Projects/NetFPGA_SUME_Driver
82+
.Sh BUGS
83+
The reference NIC hardware design provides no mechanism for quiescing
84+
inbound traffic from interfaces configured as DOWN.
85+
All packets from administratively disabled interfaces are transferred to
86+
main memory, leaving the driver with the task of dropping such packets,
87+
thus consuming PCI bandwidth, interrupts and CPU cycles in vain.
88+
.Pp
89+
Pre-built FPGA bitstream from the NetFPGA project may not work correctly.
90+
At higher RX packet rates, the newly incoming packets can overwrite the
91+
ones in an internal FIFO so the packets would arrive in main memory
92+
corrupted, until a physical reset of the board.
93+
.Pp
94+
Occasionally, the driver can get stuck in a non-IDLE TX state due to
95+
a missed interrupt.
96+
The driver includes a watchdog function which monitors for such a
97+
condition and resets the board automatically.
98+
For more details, visit the NetFPGA SUME project site.

sys/conf/config.mk

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $FreeBSD: stable/11/sys/conf/config.mk 303314 2016-07-25 18:25:19Z bdrewery $
1+
# $FreeBSD$
22
#
33
# Common code to marry kernel config(8) goo and module building goo.
44
#
@@ -19,6 +19,10 @@ opt_inet.h:
1919
opt_inet6.h:
2020
@echo "#define INET6 1" > ${.TARGET}
2121
.endif
22+
.if ${MK_IPSEC_SUPPORT} != "no"
23+
opt_ipsec.h:
24+
@echo "#define IPSEC_SUPPORT 1" > ${.TARGET}
25+
.endif
2226
.if ${MK_EISA} != "no"
2327
opt_eisa.h:
2428
@echo "#define DEV_EISA 1" > ${.TARGET}
@@ -46,6 +50,9 @@ KERN_OPTS+= INET TCP_OFFLOAD
4650
.if ${MK_INET6_SUPPORT} != "no"
4751
KERN_OPTS+= INET6
4852
.endif
53+
.if ${MK_IPSEC_SUPPORT} != "no"
54+
KERN_OPTS+= IPSEC_SUPPORT
55+
.endif
4956
.if ${MK_EISA} != "no"
5057
KERN_OPTS+= DEV_EISA
5158
.endif

sys/conf/files

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ contrib/ipfilter/netinet/ip_lookup.c optional ipfilter inet \
564564
contrib/ipfilter/netinet/ip_pool.c optional ipfilter inet \
565565
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
566566
contrib/ipfilter/netinet/ip_htable.c optional ipfilter inet \
567-
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
567+
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}"
568568
contrib/ipfilter/netinet/ip_sync.c optional ipfilter inet \
569569
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
570570
contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \

sys/conf/files.amd64

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ dev/smartpqi/smartpqi_response.c optional smartpqi
467467
dev/smartpqi/smartpqi_sis.c optional smartpqi
468468
dev/smartpqi/smartpqi_tag.c optional smartpqi
469469
dev/speaker/spkr.c optional speaker
470+
dev/sume/if_sume.c optional sume
470471
dev/syscons/apm/apm_saver.c optional apm_saver apm
471472
dev/syscons/scterm-teken.c optional sc
472473
dev/syscons/scvesactl.c optional sc vga vesa

sys/conf/kern.mk

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,25 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
1717
# kernel where fixing them is more trouble than it is worth, or where there is
1818
# a false positive.
1919
.if ${COMPILER_TYPE} == "clang"
20-
NO_WCONSTANT_CONVERSION= -Wno-constant-conversion
20+
NO_WCONSTANT_CONVERSION= -Wno-error=constant-conversion
2121
NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative
2222
NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow
2323
NO_WSELF_ASSIGN= -Wno-self-assign
24-
NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration
25-
NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized
26-
NO_WCAST_QUAL= -Wno-cast-qual
24+
NO_WUNNEEDED_INTERNAL_DECL= -Wno-error=unneeded-internal-declaration
25+
NO_WSOMETIMES_UNINITIALIZED= -Wno-error=sometimes-uninitialized
26+
NO_WCAST_QUAL= -Wno-error=cast-qual
27+
NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare
2728
# Several other warnings which might be useful in some cases, but not severe
2829
# enough to error out the whole kernel build. Display them anyway, so there is
2930
# some incentive to fix them eventually.
30-
CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \
31-
-Wno-error-parentheses-equality -Wno-error-unused-function \
32-
-Wno-error-pointer-sign
31+
CWARNEXTRA?= -Wno-error=tautological-compare -Wno-error=empty-body \
32+
-Wno-error=parentheses-equality -Wno-error=unused-function \
33+
-Wno-error=pointer-sign
3334
.if ${COMPILER_VERSION} >= 30700
34-
CWARNEXTRA+= -Wno-error-shift-negative-value
35+
CWARNEXTRA+= -Wno-error=shift-negative-value
3536
.endif
3637
.if ${COMPILER_VERSION} >= 40000
37-
CWARNEXTRA+= -Wno-error-address-of-packed-member
38+
CWARNEXTRA+= -Wno-address-of-packed-member
3839
.endif
3940
.if ${COMPILER_VERSION} >= 100000
4041
NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation

sys/conf/kmod.mk

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
2-
# $FreeBSD: stable/11/sys/conf/kmod.mk 352023 2019-09-07 20:01:26Z imp $
2+
# $FreeBSD$
33
#
44
# The include file <bsd.kmod.mk> handles building and installing loadable
55
# kernel modules.
@@ -69,12 +69,7 @@ KMODUNLOAD?= /sbin/kldunload
6969
KMODISLOADED?= /sbin/kldstat -q -n
7070
OBJCOPY?= objcopy
7171

72-
.include <bsd.init.mk>
73-
# Grab all the options for a kernel build. For backwards compat, we need to
74-
# do this after bsd.own.mk.
75-
.include "kern.opts.mk"
76-
.include <bsd.compiler.mk>
77-
.include "config.mk"
72+
.include "kmod.opts.mk"
7873

7974
# Search for kernel source tree in standard places.
8075
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
@@ -228,7 +223,7 @@ ${PROG}.debug: ${FULLPROG}
228223

229224
.if ${__KLD_SHARED} == yes
230225
${FULLPROG}: ${KMOD}.kld
231-
${LD} -m ${LD_EMULATION} -Bshareable -znotext ${_LDFLAGS} \
226+
${LD} -m ${LD_EMULATION} -Bshareable -znotext -znorelro ${_LDFLAGS} \
232227
-o ${.TARGET} ${KMOD}.kld
233228
.if !defined(DEBUG_FLAGS)
234229
${OBJCOPY} --strip-debug ${.TARGET}

sys/conf/kmod.opts.mk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Handle options (KERN_OPTS) for kernel module options. This can be included earlier in a kmod Makefile
2+
# to allow KERN_OPTS to control SRCS, etc.
3+
4+
.if !target(__<kmod.opts.mk>__)
5+
__<kmod.opts.mk>__:
6+
7+
.include <bsd.init.mk>
8+
# Grab all the options for a kernel build. For backwards compat, we need to
9+
# do this after bsd.own.mk.
10+
.include "kern.opts.mk"
11+
.include <bsd.compiler.mk>
12+
.include "config.mk"
13+
14+
.endif # !target(__<kmod.opts.mk>__)

0 commit comments

Comments
 (0)