sync with OpenBSD -current
This commit is contained in:
parent
0d235ae71d
commit
14e313b3c5
17 changed files with 74 additions and 30 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: cpu.h,v 1.172 2024/06/07 16:53:35 kettenis Exp $ */
|
||||
/* $OpenBSD: cpu.h,v 1.173 2024/06/09 21:15:29 jca Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -319,7 +319,7 @@ void cpu_unidle(struct cpu_info *);
|
|||
#define cpu_kick(ci)
|
||||
#define cpu_unidle(ci)
|
||||
|
||||
#define CPU_BUSY_CYCLE() do {} while (0)
|
||||
#define CPU_BUSY_CYCLE() __asm volatile ("" ::: "memory")
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: cpu.h,v 1.66 2024/02/25 19:15:50 cheloha Exp $ */
|
||||
/* $OpenBSD: cpu.h,v 1.67 2024/06/09 21:15:29 jca Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.34 2003/06/23 11:01:08 martin Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -251,7 +251,7 @@ extern struct cpu_info *cpu_info[MAXCPUS];
|
|||
void cpu_boot_secondary_processors(void);
|
||||
#endif /* !MULTIPROCESSOR */
|
||||
|
||||
#define CPU_BUSY_CYCLE() do {} while (0)
|
||||
#define CPU_BUSY_CYCLE() __asm volatile ("" ::: "memory")
|
||||
|
||||
#define curpcb curcpu()->ci_curpcb
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: cpu.h,v 1.190 2024/06/07 16:53:35 kettenis Exp $ */
|
||||
/* $OpenBSD: cpu.h,v 1.191 2024/06/09 21:15:29 jca Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -262,7 +262,7 @@ void cpu_unidle(struct cpu_info *);
|
|||
#define cpu_kick(ci)
|
||||
#define cpu_unidle(ci)
|
||||
|
||||
#define CPU_BUSY_CYCLE() do {} while (0)
|
||||
#define CPU_BUSY_CYCLE() __asm volatile ("" ::: "memory")
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $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.
|
||||
|
@ -604,7 +604,11 @@ vio_attach(struct device *parent, struct device *self, void *aux)
|
|||
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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $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 $ */
|
||||
|
||||
/*
|
||||
|
@ -249,6 +249,7 @@ struct if_status_description {
|
|||
#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 */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $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
|
||||
|
@ -523,7 +523,7 @@ vlan_up(struct vlan_softc *sc)
|
|||
/*
|
||||
* 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) {
|
||||
/*
|
||||
|
@ -531,10 +531,14 @@ vlan_up(struct vlan_softc *sc)
|
|||
* 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue