mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dave Johnson" <djohnson+linux-kernel@sw.starentnetworks.com>
To: David Miller <davem@davemloft.net>,
	jes@trained-monkey.org, mchan@broadcom.com,
	ram.vepa@neterion.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, bguo@sw.starentnetworks.com
Subject: [PATCH 2/2] NET: Re-add VLAN tag for devices incapable of keeping it
Date: Mon, 5 Nov 2007 12:47:04 -0500	[thread overview]
Message-ID: <18223.22296.654548.764588@zeus.sw.starentnetworks.com> (raw)
In-Reply-To: <472A6089.7020104@hp.com>


This patch changes the following drivers to use vlan_hwaccel_rx()
and/or vlan_hwaccel_receive_skb() with a NULL vlan group if needed as
they are not setup to dynamically enable/disable vlan removal in
their MAC based on the vlan group:

drivers/net/tg3.c           Tested on BCM5704, looks good
drivers/net/bnx2.c          Tested on BCM5708, looks good
drivers/net/acenic.c        Not tested, I don't have one of these
drivers/net/s2io.c          Not tested, I don't have one of these

In addition, these drivers might also need changes, but should
probably be done by the maintainer as it's not clear exactly what
change is needed:

drivers/net/amd8111e.c
drivers/net/cxgb3/*

Signed-off-by: Dave Johnson <djohnson@sw.starentnetworks.com>

===== drivers/net/acenic.c 1.77 vs edited =====
--- 1.77/drivers/net/acenic.c	2007-07-24 16:28:41 -04:00
+++ edited/drivers/net/acenic.c	2007-11-03 12:27:40 -04:00
@@ -2036,7 +2036,7 @@
 
 		/* send it up */
 #if ACENIC_DO_VLAN
-		if (ap->vlgrp && (bd_flags & BD_FLG_VLAN_TAG)) {
+		if (bd_flags & BD_FLG_VLAN_TAG) {
 			vlan_hwaccel_rx(skb, ap->vlgrp, retdesc->vlan);
 		} else
 #endif
===== drivers/net/bnx2.c 1.135 vs edited =====
--- 1.135/drivers/net/bnx2.c	2007-09-20 15:14:21 -04:00
+++ edited/drivers/net/bnx2.c	2007-11-05 09:34:26 -05:00
@@ -2493,7 +2493,8 @@
 		}
 
 #ifdef BCM_VLAN
-		if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && (bp->vlgrp != 0)) {
+		if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) &&
+		    (bp->vlgrp || (bp->flags & ASF_ENABLE_FLAG))) {
 			vlan_hwaccel_receive_skb(skb, bp->vlgrp,
 				rx_hdr->l2_fhdr_vlan_tag);
 		}
===== drivers/net/s2io.c 1.124 vs edited =====
--- 1.124/drivers/net/s2io.c	2007-08-03 18:10:44 -04:00
+++ edited/drivers/net/s2io.c	2007-11-03 12:29:09 -04:00
@@ -6834,8 +6834,7 @@
 	sp->mac_control.stats_info->sw_stat.mem_freed += skb->truesize;
 	if (!sp->lro) {
 		skb->protocol = eth_type_trans(skb, dev);
-		if ((sp->vlgrp && RXD_GET_VLAN_TAG(rxdp->Control_2) &&
-			vlan_strip_flag)) {
+		if (RXD_GET_VLAN_TAG(rxdp->Control_2) && vlan_strip_flag) {
 			/* Queueing the vlan frame to the upper layer */
 			if (napi)
 				vlan_hwaccel_receive_skb(skb, sp->vlgrp,
===== drivers/net/tg3.c 1.523 vs edited =====
--- 1.523/drivers/net/tg3.c	2007-09-11 04:28:44 -04:00
+++ edited/drivers/net/tg3.c	2007-11-05 09:38:33 -05:00
@@ -3417,7 +3417,7 @@
 
 		skb->protocol = eth_type_trans(skb, tp->dev);
 #if TG3_VLAN_TAG_USED
-		if (tp->vlgrp != NULL &&
+		if ((tp->vlgrp || (tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) &&
 		    desc->type_flags & RXD_FLAG_VLAN) {
 			tg3_vlan_rx(tp, skb,
 				    desc->err_vlan & RXD_VLAN_MASK);


  parent reply	other threads:[~2007-11-05 17:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31 18:43 expected behavior of PF_PACKET on NETIF_F_HW_VLAN_RX device? Dave Johnson
2007-10-31 19:33 ` Stephen Hemminger
2007-11-01  1:06   ` Ben Greear
2007-11-01  1:10     ` David Miller
2007-11-01  1:23     ` Stephen Hemminger
2007-11-01  1:31       ` Ben Greear
2007-11-01  4:50       ` David Miller
2007-11-01 15:04         ` Ben Greear
2007-11-01 21:35           ` David Miller
2007-11-01 21:36           ` Dave Johnson
2007-11-01 21:48             ` Rick Jones
2007-11-01 21:59               ` David Miller
2007-11-01 22:04                 ` Rick Jones
2007-11-01 22:07                   ` David Miller
2007-11-01 23:26                     ` Rick Jones
2007-11-05 17:46                       ` [PATCH 1/2] NET: Re-add VLAN tag for devices incapable of keeping it Dave Johnson
2007-11-05 18:00                         ` Patrick McHardy
2007-11-05 23:15                           ` David Miller
2007-11-06  0:21                             ` Patrick McHardy
2007-11-06  0:35                               ` David Miller
2007-11-06 18:03                               ` Krzysztof Halasa
2007-11-06 18:56                                 ` Ben Greear
2007-11-06 20:08                                   ` Krzysztof Halasa
2007-11-06 23:55                                 ` Patrick McHardy
2007-11-05 17:47                       ` Dave Johnson [this message]
2007-11-06  2:39                         ` [PATCH 2/2] " Ramkrishna Vepa
2007-11-06 18:28                           ` Ramkrishna Vepa
2007-11-06 18:34                             ` Dave Johnson
2007-11-01 21:58             ` expected behavior of PF_PACKET on NETIF_F_HW_VLAN_RX device? David Miller
2007-11-02 18:08             ` Dave Johnson
2007-11-02 21:20               ` David Miller
2007-11-02 21:52               ` Michael Chan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18223.22296.654548.764588@zeus.sw.starentnetworks.com \
    --to=djohnson+linux-kernel@sw.starentnetworks.com \
    --cc=bguo@sw.starentnetworks.com \
    --cc=davem@davemloft.net \
    --cc=jes@trained-monkey.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=ram.vepa@neterion.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®