-.\" $OpenBSD: ifconfig.8,v 1.399 2024/01/11 17:22:04 jan Exp $
+.\" $OpenBSD: ifconfig.8,v 1.400 2024/06/09 16:25:27 jan Exp $
.\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $
.\" $FreeBSD: ifconfig.8,v 1.16 1998/02/01 07:03:29 steve Exp $
.\"
.\"
.\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94
.\"
-.Dd $Mdocdate: January 11 2024 $
+.Dd $Mdocdate: June 9 2024 $
.Dt IFCONFIG 8
.Os
.Sh NAME
On transmit, the device can add the
.Xr vlan 4
tag.
+.It Sy VLAN_HWOFFLOAD
+On transmit, the device can handle checksum or TSO offload without
+.Sy VLAN_HWTAGGING .
.It Sy WOL
The device supports Wake on LAN (WoL).
.It Sy hardmtu
-/* $OpenBSD: ifconfig.c,v 1.472 2024/05/18 02:44:22 jsg Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.473 2024/06/09 16:25:27 jan Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
#define HWFEATURESBITS \
"\024\1CSUM_IPv4\2CSUM_TCPv4\3CSUM_UDPv4" \
- "\5VLAN_MTU\6VLAN_HWTAGGING\10CSUM_TCPv6" \
+ "\5VLAN_MTU\6VLAN_HWTAGGING\7VLAN_HWOFFLOAD\10CSUM_TCPv6" \
"\11CSUM_UDPv6\15TSOv4\16TSOv6\17LRO\20WOL"
struct ifencap {
-/* $OpenBSD: if_vio.c,v 1.37 2024/06/04 09:51:52 jan Exp $ */
+/* $OpenBSD: if_vio.c,v 1.38 2024/06/09 16:25:28 jan Exp $ */
/*
* Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg.
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_start = vio_start;
ifp->if_ioctl = vio_ioctl;
- ifp->if_capabilities = IFCAP_VLAN_MTU;
+ ifp->if_capabilities = 0;
+#if NVLAN > 0
+ ifp->if_capabilities |= IFCAP_VLAN_MTU;
+ ifp->if_capabilities |= IFCAP_VLAN_HWOFFLOAD;
+#endif
if (virtio_has_feature(vsc, VIRTIO_NET_F_CSUM))
ifp->if_capabilities |= IFCAP_CSUM_TCPv4|IFCAP_CSUM_UDPv4|
IFCAP_CSUM_TCPv6|IFCAP_CSUM_UDPv6;
-/* $OpenBSD: if.h,v 1.216 2024/04/11 15:08:18 bluhm Exp $ */
+/* $OpenBSD: if.h,v 1.217 2024/06/09 16:25:28 jan Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
#define IFCAP_CSUM_UDPv4 0x00000004 /* can do IPv4/UDP csum */
#define IFCAP_VLAN_MTU 0x00000010 /* VLAN-compatible MTU */
#define IFCAP_VLAN_HWTAGGING 0x00000020 /* hardware VLAN tag support */
+#define IFCAP_VLAN_HWOFFLOAD 0x00000040 /* hw offload w/ inline tag */
#define IFCAP_CSUM_TCPv6 0x00000080 /* can do IPv6/TCP checksums */
#define IFCAP_CSUM_UDPv6 0x00000100 /* can do IPv6/UDP checksums */
#define IFCAP_TSOv4 0x00001000 /* IPv4/TCP segment offload */
-/* $OpenBSD: if_vlan.c,v 1.218 2023/12/23 10:52:54 bluhm Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.219 2024/06/09 16:25:28 jan Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
/*
* Note: In cases like vio(4) and em(4) where the offsets of the
* csum can be freely defined, we could actually do csum offload
- * for VLAN and QINQ packets.
+ * for QINQ packets.
*/
if (sc->sc_type != ETHERTYPE_VLAN) {
/*
* ethernet type (0x8100).
*/
ifp->if_capabilities = 0;
- } else if (ISSET(ifp0->if_capabilities, IFCAP_VLAN_HWTAGGING)) {
+ } else if (ISSET(ifp0->if_capabilities, IFCAP_VLAN_HWTAGGING) ||
+ ISSET(ifp0->if_capabilities, IFCAP_VLAN_HWOFFLOAD)) {
/*
* Chips that can do hardware-assisted VLAN encapsulation, can
* calculate the correct checksum for VLAN tagged packets.
+ *
+ * Hardware which does checksum offloading, but not VLAN tag
+ * injection, have to set IFCAP_VLAN_HWOFFLOAD.
*/
ifp->if_capabilities = ifp0->if_capabilities &
(IFCAP_CSUM_MASK | IFCAP_TSOv4 | IFCAP_TSOv6);