netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p)
@ 2013-09-21 12:24 Roger Luethi
  2013-09-26 20:09 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Roger Luethi @ 2013-09-21 12:24 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Peter Boström

From: Roger Luethi <rl@hellgate.ch>

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>
---
 drivers/net/ethernet/via/via-rhine.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index c8f088a..bdf697b 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -32,7 +32,7 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #define DRV_NAME	"via-rhine"
-#define DRV_VERSION	"1.5.0"
+#define DRV_VERSION	"1.5.1"
 #define DRV_RELDATE	"2010-10-09"
 
 #include <linux/types.h>
@@ -1704,7 +1704,12 @@ static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
 		cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN));
 
 	if (unlikely(vlan_tx_tag_present(skb))) {
-		rp->tx_ring[entry].tx_status = cpu_to_le32((vlan_tx_tag_get(skb)) << 16);
+		u16 vid_pcp = vlan_tx_tag_get(skb);
+
+		/* drop CFI/DEI bit, register needs VID and PCP */
+		vid_pcp = (vid_pcp & VLAN_VID_MASK) |
+			  ((vid_pcp & VLAN_PRIO_MASK) >> 1);
+		rp->tx_ring[entry].tx_status = cpu_to_le32((vid_pcp) << 16);
 		/* request tagging */
 		rp->tx_ring[entry].desc_length |= cpu_to_le32(0x020000);
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p)
  2013-09-21 12:24 [PATCH] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p) Roger Luethi
@ 2013-09-26 20:09 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-09-26 20:09 UTC (permalink / raw)
  To: rl; +Cc: netdev, peter.bostrom

From: Roger Luethi <rl@hellgate.ch>
Date: Sat, 21 Sep 2013 14:24:11 +0200

> From: Roger Luethi <rl@hellgate.ch>
> 
> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-26 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-21 12:24 [PATCH] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p) Roger Luethi
2013-09-26 20:09 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).