netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sathya Perla <sathya.perla@emulex.com>
To: <netdev@vger.kernel.org>
Subject: [PATCH net-next 6/6] be2net: delete primary MAC address while unloading
Date: Tue, 23 Jul 2013 15:25:04 +0530	[thread overview]
Message-ID: <1374573304-6865-7-git-send-email-sathya.perla@emulex.com> (raw)
In-Reply-To: <1374573304-6865-1-git-send-email-sathya.perla@emulex.com>

Currently the UC-list is being deleted from the HW MAC table, but the primary
MAC is not.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 9b22791..7c6f03c 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2790,7 +2790,7 @@ done:
 
 static int be_clear(struct be_adapter *adapter)
 {
-	int i = 1;
+	int i;
 
 	if (adapter->flags & BE_FLAGS_WORKER_SCHEDULED) {
 		cancel_delayed_work_sync(&adapter->work);
@@ -2800,9 +2800,11 @@ static int be_clear(struct be_adapter *adapter)
 	if (sriov_enabled(adapter))
 		be_vf_clear(adapter);
 
-	for (; adapter->uc_macs > 0; adapter->uc_macs--, i++)
+	/* delete the primary mac along with the uc-mac list */
+	for (i = 0; i < (adapter->uc_macs + 1); i++)
 		be_cmd_pmac_del(adapter, adapter->if_handle,
-			adapter->pmac_id[i], 0);
+				adapter->pmac_id[i], 0);
+	adapter->uc_macs = 0;
 
 	be_cmd_if_destroy(adapter, adapter->if_handle,  0);
 
-- 
1.7.1

  parent reply	other threads:[~2013-07-23  9:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23  9:54 [PATCH net-next 0/6] be2net: patch set Sathya Perla
2013-07-23  9:54 ` [PATCH net-next 1/6] be2net: fix MAC address modification for VF Sathya Perla
2013-07-23  9:55 ` [PATCH net-next 2/6] be2net: allow VFs to program MAC and VLAN filters Sathya Perla
2013-07-23  9:55 ` [PATCH net-next 3/6] be2net: fix pmac_id for BE3 VFs Sathya Perla
2013-07-23  9:55 ` [PATCH net-next 4/6] be2net: refactor MAC-addr setup code Sathya Perla
2013-07-23  9:55 ` [PATCH net-next 5/6] be2net: use SET/GET_MAC_LIST for SH-R Sathya Perla
2013-07-23  9:55 ` Sathya Perla [this message]
2013-07-24 22:42 ` [PATCH net-next 0/6] be2net: patch set David Miller

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=1374573304-6865-7-git-send-email-sathya.perla@emulex.com \
    --to=sathya.perla@emulex.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).