Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

via-rhine: fix VLAN priority field (PCP, IEEE 802.1p)

Outgoing packets sent by via-rhine have their VLAN PCP field off by one
(when hardware acceleration is enabled). The TX descriptor expects only VID
and PCP (without a CFI/DEI bit).

Peter Boström noticed and reported the bug.

Signed-off-by: Roger Luethi <rl@hellgate.ch>
Cc: Peter Boström <peter.bostrom@netrounds.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Roger Luethi and committed by
David S. Miller
207070f5 2811ebac

+7 -2
+7 -2
drivers/net/ethernet/via/via-rhine.c
··· 32 32 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 33 33 34 34 #define DRV_NAME "via-rhine" 35 - #define DRV_VERSION "1.5.0" 35 + #define DRV_VERSION "1.5.1" 36 36 #define DRV_RELDATE "2010-10-09" 37 37 38 38 #include <linux/types.h> ··· 1704 1704 cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN)); 1705 1705 1706 1706 if (unlikely(vlan_tx_tag_present(skb))) { 1707 - rp->tx_ring[entry].tx_status = cpu_to_le32((vlan_tx_tag_get(skb)) << 16); 1707 + u16 vid_pcp = vlan_tx_tag_get(skb); 1708 + 1709 + /* drop CFI/DEI bit, register needs VID and PCP */ 1710 + vid_pcp = (vid_pcp & VLAN_VID_MASK) | 1711 + ((vid_pcp & VLAN_PRIO_MASK) >> 1); 1712 + rp->tx_ring[entry].tx_status = cpu_to_le32((vid_pcp) << 16); 1708 1713 /* request tagging */ 1709 1714 rp->tx_ring[entry].desc_length |= cpu_to_le32(0x020000); 1710 1715 }