From b6857a1966854e8ce37ae758d22659b822a1b785 Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 2 Feb 2023 13:37:24 +0000 Subject: [PATCH] Do not endian swap the ether_vtag before stuffing it into the control word. The endian swap to little endian happens later for the full control word. Fixes vlans on em(4) on sparc64 systems. OK kn@ naddy@ --- sys/dev/pci/if_em.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 581c9fc2647..c840377f0a3 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.363 2022/11/06 18:17:56 mbuhl Exp $ */ +/* $OpenBSD: if_em.c,v 1.364 2023/02/02 13:37:24 claudio Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include @@ -2411,7 +2411,7 @@ em_tx_ctx_setup(struct em_queue *que, struct mbuf *mp, u_int head, #if NVLAN > 0 if (ISSET(mp->m_flags, M_VLANTAG)) { - uint16_t vtag = htole16(mp->m_pkthdr.ether_vtag); + uint32_t vtag = mp->m_pkthdr.ether_vtag; vlan_macip_lens |= vtag << E1000_ADVTXD_VLAN_SHIFT; *cmd_type_len |= E1000_ADVTXD_DCMD_VLE; off = 1; -- 2.20.1