sync with OpenBSD -current

This commit is contained in:
purplerain 2024-02-09 22:30:40 +00:00
parent d68c02c8a8
commit 550dd57439
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
39 changed files with 1599 additions and 402 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: if_qwx_pci.c,v 1.6 2024/02/05 10:45:47 kettenis Exp $ */
/* $OpenBSD: if_qwx_pci.c,v 1.8 2024/02/09 14:57:36 bluhm Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
@ -50,10 +50,13 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "bpfilter.h"
#include <sys/param.h>
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/socket.h>
#include <sys/systm.h>
#include <sys/malloc.h>

View file

@ -1,4 +1,4 @@
/* $OpenBSD: if_vmx.c,v 1.79 2023/11/10 15:51:24 bluhm Exp $ */
/* $OpenBSD: if_vmx.c,v 1.80 2024/02/09 15:22:41 jan Exp $ */
/*
* Copyright (c) 2013 Tsubai Masanari
@ -404,8 +404,10 @@ vmxnet3_attach(struct device *parent, struct device *self, void *aux)
if (sc->sc_ds->upt_features & UPT1_F_CSUM)
ifp->if_capabilities |= IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
#endif
#if NVLAN > 0
if (sc->sc_ds->upt_features & UPT1_F_VLAN)
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
#endif
ifq_init_maxlen(&ifp->if_snd, NTXDESC);
@ -503,7 +505,10 @@ vmxnet3_dma_init(struct vmxnet3_softc *sc)
#endif
ds->vmxnet3_revision = 1;
ds->upt_version = 1;
ds->upt_features = UPT1_F_CSUM | UPT1_F_VLAN;
ds->upt_features = UPT1_F_CSUM;
#if NVLAN > 0
ds->upt_features |= UPT1_F_VLAN;
#endif
ds->driver_data = ~0ULL;
ds->driver_data_len = 0;
ds->queue_shared = qs_pa;
@ -1117,11 +1122,13 @@ vmxnet3_rxintr(struct vmxnet3_softc *sc, struct vmxnet3_rxqueue *rq)
m->m_pkthdr.len = m->m_len = len;
vmxnet3_rx_csum(rxcd, m);
#if NVLAN > 0
if (letoh32(rxcd->rxc_word2 & VMXNET3_RXC_VLAN)) {
m->m_flags |= M_VLANTAG;
m->m_pkthdr.ether_vtag = letoh32((rxcd->rxc_word2 >>
VMXNET3_RXC_VLANTAG_S) & VMXNET3_RXC_VLANTAG_M);
}
#endif
if (((letoh32(rxcd->rxc_word0) >> VMXNET3_RXC_RSSTYPE_S) &
VMXNET3_RXC_RSSTYPE_M) != VMXNET3_RXC_RSSTYPE_NONE) {
m->m_pkthdr.ph_flowid = letoh32(rxcd->rxc_word1);
@ -1462,11 +1469,13 @@ vmxnet3_start(struct ifqueue *ifq)
}
txd->tx_word3 = htole32(VMXNET3_TX_EOP | VMXNET3_TX_COMPREQ);
#if NVLAN > 0
if (ISSET(m->m_flags, M_VLANTAG)) {
sop->tx_word3 |= htole32(VMXNET3_TX_VTAG_MODE);
sop->tx_word3 |= htole32((m->m_pkthdr.ether_vtag &
VMXNET3_TX_VLANTAG_M) << VMXNET3_TX_VLANTAG_S);
}
#endif
ring->prod = prod;
/* Change the ownership by flipping the "generation" bit */