From owner-svn-src-stable-12@freebsd.org Mon Oct 5 07:26:08 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B1A53FAD9F; Mon, 5 Oct 2020 07:26:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C4XFq58d8z4myx; Mon, 5 Oct 2020 07:26:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 941D9120A2; Mon, 5 Oct 2020 07:26:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0957Q7Yd092795; Mon, 5 Oct 2020 07:26:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0957Q6Zp092791; Mon, 5 Oct 2020 07:26:06 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010050726.0957Q6Zp092791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 5 Oct 2020 07:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366441 - in stable/12: sbin/ifconfig sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12: sbin/ifconfig sys/net X-SVN-Commit-Revision: 366441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2020 07:26:08 -0000 Author: np Date: Mon Oct 5 07:26:06 2020 New Revision: 366441 URL: https://svnweb.freebsd.org/changeset/base/366441 Log: MFC r365868: 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 Modified: stable/12/sbin/ifconfig/ifconfig.8 stable/12/sbin/ifconfig/ifconfig.c stable/12/sbin/ifconfig/ifvxlan.c stable/12/sys/net/if.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/12/sbin/ifconfig/ifconfig.8 Mon Oct 5 06:53:29 2020 (r366440) +++ stable/12/sbin/ifconfig/ifconfig.8 Mon Oct 5 07:26:06 2020 (r366441) @@ -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 @@ -559,7 +559,7 @@ If the driver offers user-configurable VLAN support, e 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 @@ -569,6 +569,21 @@ If the driver offers user-configurable VLAN support, d 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 , Modified: stable/12/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/12/sbin/ifconfig/ifconfig.c Mon Oct 5 06:53:29 2020 (r366440) +++ stable/12/sbin/ifconfig/ifconfig.c Mon Oct 5 07:26:06 2020 (r366441) @@ -1344,7 +1344,8 @@ unsetifdescr(const char *val, int value, int s, const "\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" +"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP" \ +"\36VXLAN_HWCSUM\37VXLAN_HWTSO" /* * Print the status of the interface. If an address family was Modified: stable/12/sbin/ifconfig/ifvxlan.c ============================================================================== --- stable/12/sbin/ifconfig/ifvxlan.c Mon Oct 5 06:53:29 2020 (r366440) +++ stable/12/sbin/ifconfig/ifvxlan.c Mon Oct 5 07:26:06 2020 (r366441) @@ -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 = { Modified: stable/12/sys/net/if.h ============================================================================== --- stable/12/sys/net/if.h Mon Oct 5 06:53:29 2020 (r366440) +++ stable/12/sys/net/if.h Mon Oct 5 07:26:06 2020 (r366441) @@ -246,6 +246,8 @@ struct if_data { #define IFCAP_HWSTATS 0x800000 /* manages counters internally */ #define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */ #define IFCAP_HWRXTSTMP 0x2000000 /* hardware rx timestamping */ +#define IFCAP_VXLAN_HWCSUM 0x20000000 /* can do IFCAN_HWCSUM on VXLANs */ +#define IFCAP_VXLAN_HWTSO 0x40000000 /* can do IFCAP_TSO on VXLANs */ #define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)