aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2020-09-18 02:10:28 +0000
committerNavdeep Parhar <np@FreeBSD.org>2020-09-18 02:10:28 +0000
commit830edb4561d38e71470580890c17b362afb91a1a (patch)
tree3391886f1332fdead74a0bf3a5267ab51cdd12a1 /sbin/ifconfig
parent1f7313861b626f1fea8bdd077e712f5a8c866a48 (diff)
downloadsrc-830edb4561d38e71470580890c17b362afb91a1a.tar.gz
src-830edb4561d38e71470580890c17b362afb91a1a.zip
Add two new ifnet capabilities for hw checksumming and TSO for VXLAN traffic.
These are similar to the existing VLAN capabilities. Reviewed by: kib@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D25873
Notes
Notes: svn path=/head/; revision=365868
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifconfig.819
-rw-r--r--sbin/ifconfig/ifconfig.c3
-rw-r--r--sbin/ifconfig/ifvxlan.c5
3 files changed, 24 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 215436c629d0..e9fa2624dae7 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -28,7 +28,7 @@
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
.\" $FreeBSD$
.\"
-.Dd June 4, 2020
+.Dd September 17, 2020
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -587,7 +587,7 @@ If the driver offers user-configurable VLAN support, enable
reception of extended frames, tag processing in hardware,
frame filtering in hardware, checksum offloading, or TSO on VLAN,
respectively.
-Note that this must be issued on a physical interface associated with
+Note that this must be configured on a physical interface associated with
.Xr vlan 4 ,
not on a
.Xr vlan 4
@@ -597,6 +597,21 @@ If the driver offers user-configurable VLAN support, disable
reception of extended frames, tag processing in hardware,
frame filtering in hardware, or TSO on VLAN,
respectively.
+.It Cm vxlanhwcsum , vxlanhwtso
+If the driver offers user-configurable VXLAN support, enable inner checksum
+offloading (receive and transmit) or TSO on VXLAN, respectively.
+Note that this must be configured on a physical interface associated with
+.Xr vxlan 4 ,
+not on a
+.Xr vxlan 4
+interface itself.
+The physical interface is either the interface specified as the vxlandev
+or the interface hosting the vxlanlocal address.
+The driver will offload as much checksum work and TSO as it can reliably
+support, the exact level of offloading may vary between drivers.
+.It Fl vxlanhwcsum , vxlanhwtso
+If the driver offers user-configurable VXLAN support, disable checksum
+offloading (receive and transmit) or TSO on VXLAN, respectively.
.It Cm vnet Ar jail
Move the interface to the
.Xr jail 8 ,
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 65847ad5954b..df3514ef5bd8 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1344,7 +1344,8 @@ unsetifdescr(const char *val, int value, int s, const struct afswtch *afp)
"\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \
"\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \
"\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \
-"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP\34TXTLS4\35TXTLS6"
+"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP\34TXTLS4\35TXTLS6" \
+"\36VXLAN_HWCSUM\37VXLAN_HWTSO"
/*
* Print the status of the interface. If an address family was
diff --git a/sbin/ifconfig/ifvxlan.c b/sbin/ifconfig/ifvxlan.c
index 7f78d2be8889..32c7ecbffe63 100644
--- a/sbin/ifconfig/ifvxlan.c
+++ b/sbin/ifconfig/ifvxlan.c
@@ -620,6 +620,11 @@ static struct cmd vxlan_cmds[] = {
DEF_CMD("vxlanflush", 0, setvxlan_flush),
DEF_CMD("vxlanflushall", 1, setvxlan_flush),
+
+ DEF_CMD("vxlanhwcsum", IFCAP_VXLAN_HWCSUM, setifcap),
+ DEF_CMD("-vxlanhwcsum", -IFCAP_VXLAN_HWCSUM, setifcap),
+ DEF_CMD("vxlanhwtso", IFCAP_VXLAN_HWTSO, setifcap),
+ DEF_CMD("-vxlanhwtso", -IFCAP_VXLAN_HWTSO, setifcap),
};
static struct afswtch af_vxlan = {