netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rasesh Mody <rmody@brocade.com>
To: <netdev@vger.kernel.org>
Cc: <huangj@brocade.com>, Rasesh Mody <rmody@brocade.com>,
	Debashis Dutt <ddutt@brocade.com>
Subject: [PATCH 08/10] bna: Restore VLAN filter table
Date: Thu, 23 Dec 2010 23:45:08 -0800	[thread overview]
Message-ID: <1293176710-21335-9-git-send-email-rmody@brocade.com> (raw)
In-Reply-To: <1293176710-21335-1-git-send-email-rmody@brocade.com>

Change Details:
	- Retrieve the VLAN configuration from the networking stack
	and apply it to the base interface during ifconfig up

Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
---
 drivers/net/bna/bnad.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index f775936..140ea95 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -566,7 +566,8 @@ bnad_enable_rx_irq(struct bnad *bnad, struct bna_ccb *ccb)
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&bnad->bna_lock, flags); /* Because of polling context */
+	/* Because of polling context */
+	spin_lock_irqsave(&bnad->bna_lock, flags);
 	bnad_enable_rx_irq_unsafe(ccb);
 	spin_unlock_irqrestore(&bnad->bna_lock, flags);
 }
@@ -1962,6 +1963,27 @@ bnad_enable_default_bcast(struct bnad *bnad)
 	return 0;
 }
 
+/* Called with bnad_conf_lock() held */
+static void
+bnad_restore_vlans(struct bnad *bnad, u32 rx_id)
+{
+	u16 vlan_id;
+	unsigned long flags;
+
+	if (!bnad->vlan_grp)
+		return;
+
+	BUG_ON(!(VLAN_N_VID == (BFI_MAX_VLAN + 1)));
+
+	for (vlan_id = 0; vlan_id < VLAN_N_VID; vlan_id++) {
+		if (!vlan_group_get_device(bnad->vlan_grp, vlan_id))
+			continue;
+		spin_lock_irqsave(&bnad->bna_lock, flags);
+		bna_rx_vlan_add(bnad->rx_info[rx_id].rx, vlan_id);
+		spin_unlock_irqrestore(&bnad->bna_lock, flags);
+	}
+}
+
 /* Statistics utilities */
 void
 bnad_netdev_qstats_fill(struct bnad *bnad, struct rtnl_link_stats64 *stats)
@@ -2337,6 +2359,9 @@ bnad_open(struct net_device *netdev)
 	/* Enable broadcast */
 	bnad_enable_default_bcast(bnad);
 
+	/* Restore VLANs, if any */
+	bnad_restore_vlans(bnad, 0);
+
 	/* Set the UCAST address */
 	spin_lock_irqsave(&bnad->bna_lock, flags);
 	bnad_mac_addr_set_locked(bnad, netdev->dev_addr);
@@ -3021,7 +3046,7 @@ static int __devinit
 bnad_pci_probe(struct pci_dev *pdev,
 		const struct pci_device_id *pcidev_id)
 {
-	bool 	using_dac;
+	bool 	using_dac = false;
 	int 	err;
 	struct bnad *bnad;
 	struct bna *bna;
-- 
1.7.1


  parent reply	other threads:[~2010-12-24  7:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-24  7:45 [PATCH 00/10] bna: Update Brocade BNA Ethernet driver to v2.3.2.3 Rasesh Mody
2010-12-24  7:45 ` [PATCH 01/10] bna: TxRx and datapath fix Rasesh Mody
2010-12-24  7:45 ` [PATCH 02/10] bna: Port enable disable sync and txq priority fix Rasesh Mody
2010-12-24  7:45 ` [PATCH 03/10] bna: Fix ethtool register dump and reordered an API Rasesh Mody
2010-12-24  7:45 ` [PATCH 04/10] bna: Enable pure priority tagged packet reception and rxf uninit cleanup fix Rasesh Mody
2010-12-24  7:45 ` [PATCH 05/10] bna: Fix for TX queue Rasesh Mody
2010-12-24  7:45 ` [PATCH 06/10] bna: IOC uninit check and misc cleanup Rasesh Mody
2010-12-24  7:45 ` [PATCH 07/10] bna: Removed unused code Rasesh Mody
2010-12-24  7:45 ` Rasesh Mody [this message]
2010-12-24  7:45 ` [PATCH 09/10] bna: IOC failure auto recovery fix Rasesh Mody
2010-12-24  7:45 ` [PATCH 10/10] bna: Update the driver version to 2.3.2.3 Rasesh Mody
  -- strict thread matches above, loose matches on Subject: below --
2010-12-22  7:23 [PATCH 00/10] bna: Update Brocade BNA Ethernet driver to v2.3.2.3 Rasesh Mody
2010-12-22  7:23 ` [PATCH 08/10] bna: Restore VLAN filter table Rasesh Mody

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=1293176710-21335-9-git-send-email-rmody@brocade.com \
    --to=rmody@brocade.com \
    --cc=ddutt@brocade.com \
    --cc=huangj@brocade.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).