Skip to content

Commit

Permalink
e1000: Fix vlan PCP/DEI on lem(4)
Browse files Browse the repository at this point in the history
The vlan PCP and CFI/DEI were discarded when receiving vlan tagged
packets on lem(4) interfaces with vlanhwtag.

According to the 82540 SDM[1] (pg. 24), vlan tag is in the standard
format, so there's no reason to discard PCP/DEI.

[1]: http://iommu.com/datasheets/ethernet/controllers-nics/intel/e1000/pci-pci-x-family-gbe-controllers-software-dev-manual.pdf

Sponsored by:	Stormshield (author)
Differential Revision:	https://reviews.freebsd.org/D48987

(cherry picked from commit 4b29599fbbe33b75b7b58cfc5deea7a881e9a10e)
  • Loading branch information
Aurelien Cazuc authored and fichtner committed Feb 18, 2025
1 parent 2ff3730 commit 96f5dd4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion sys/dev/e1000/e1000_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
#define E1000_RXD_ERR_TCPE 0x20 /* TCP/UDP Checksum Error */
#define E1000_RXD_ERR_IPE 0x40 /* IP Checksum Error */
#define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */
#define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */

#define E1000_RXDEXT_STATERR_TST 0x00000100 /* Time Stamp taken */
#define E1000_RXDEXT_STATERR_LB 0x00040000
Expand Down
3 changes: 1 addition & 2 deletions sys/dev/e1000/em_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,7 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)

if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING &&
status & E1000_RXD_STAT_VP) {
ri->iri_vtag =
le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK);
ri->iri_vtag = le16toh(rxd->special);
ri->iri_flags |= M_VLANTAG;
}

Expand Down

0 comments on commit 96f5dd4

Please sign in to comment.