From: Amit Kumar Salecha <amit.salecha@qlogic.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, ameen.rahman@qlogic.com,
anirban.chakraborty@qlogic.com,
Rajesh Borundia <rajesh.borundia@qlogic.com>
Subject: [PATCHv2 NEXT 05/10] qlcnic: fix mac anti spoof policy
Date: Tue, 31 Aug 2010 20:17:48 -0700 [thread overview]
Message-ID: <1283311073-7165-6-git-send-email-amit.salecha@qlogic.com> (raw)
In-Reply-To: <1283311073-7165-1-git-send-email-amit.salecha@qlogic.com>
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
o Allow enabling/disabling mac anti spoof policy only for
Non privilege functions.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/qlcnic/qlcnic_main.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index e0c6811..9a3ebb8 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -741,9 +741,9 @@ qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter,
struct qlcnic_esw_func_cfg *esw_cfg)
{
adapter->flags &= ~QLCNIC_MACSPOOF;
- if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC)
- if (esw_cfg->mac_anti_spoof)
- adapter->flags |= QLCNIC_MACSPOOF;
+
+ if (esw_cfg->mac_anti_spoof)
+ adapter->flags |= QLCNIC_MACSPOOF;
qlcnic_set_netdev_features(adapter, esw_cfg);
}
@@ -3377,8 +3377,12 @@ static int
validate_esw_config(struct qlcnic_adapter *adapter,
struct qlcnic_esw_func_cfg *esw_cfg, int count)
{
+ u32 op_mode;
u8 pci_func;
int i;
+
+ op_mode = readl(adapter->ahw.pci_base0 + QLCNIC_DRV_OP_MODE);
+
for (i = 0; i < count; i++) {
pci_func = esw_cfg[i].pci_func;
if (pci_func >= QLCNIC_MAX_PCI_FUNC)
@@ -3390,6 +3394,9 @@ validate_esw_config(struct qlcnic_adapter *adapter,
switch (esw_cfg[i].op_mode) {
case QLCNIC_PORT_DEFAULTS:
+ if (QLC_DEV_GET_DRV(op_mode, pci_func) !=
+ QLCNIC_NON_PRIV_FUNC)
+ esw_cfg[i].mac_anti_spoof = 0;
break;
case QLCNIC_ADD_VLAN:
if (!IS_VALID_VLAN(esw_cfg[i].vlan_id))
--
1.6.0.2
next prev parent reply other threads:[~2010-09-01 3:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-01 3:17 [PATCHv2 0/10]qlcnic: Fixes and enhancement Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 01/10] qlcnic: backout firmware initialization update Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 02/10] qlcnic: add api version in reg dump Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 03/10] qlcnic: fix mac addr read Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 04/10] qlcnic: fix for setting default eswitch config Amit Kumar Salecha
2010-09-01 3:17 ` Amit Kumar Salecha [this message]
2010-09-01 3:17 ` [PATCHv2 NEXT 06/10] qlcnic: fix panic while using eth_hdr Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 07/10] qlcnic: fix mac override capability Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 08/10] qlcnic: support mac learning Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 09/10] qlcnic: mac vlan learning support Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 10/10] qlcnic: add cksum flag Amit Kumar Salecha
2010-09-01 17:42 ` [PATCHv2 0/10]qlcnic: Fixes and enhancement 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=1283311073-7165-6-git-send-email-amit.salecha@qlogic.com \
--to=amit.salecha@qlogic.com \
--cc=ameen.rahman@qlogic.com \
--cc=anirban.chakraborty@qlogic.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=rajesh.borundia@qlogic.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;
as well as URLs for NNTP newsgroup(s).