netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shahed Shaikh <shahed.shaikh@qlogic.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <Dept_NX_Linux_NIC_Driver@qlogic.com>,
	Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Subject: [PATCH net-next 1/8] qlcnic: Restrict VF from configuring any VLAN mode.
Date: Fri, 10 Jan 2014 11:48:52 -0500	[thread overview]
Message-ID: <1389372539-13753-2-git-send-email-shahed.shaikh@qlogic.com> (raw)
In-Reply-To: <1389372539-13753-1-git-send-email-shahed.shaikh@qlogic.com>

From: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>

o Adapter should allow vlan traffic only for vlans configured on a VF.
  On configuring any vlan mode from VF, adapter will allow any vlan
  traffic to pass for that VF. Do not allow VF to configure this mode.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
index d14d9a1..c588286 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
@@ -9,9 +9,12 @@
 #include "qlcnic.h"
 #include <linux/types.h>
 
-#define QLCNIC_SRIOV_VF_MAX_MAC 8
+#define QLCNIC_SRIOV_VF_MAX_MAC 7
 #define QLC_VF_MIN_TX_RATE	100
 #define QLC_VF_MAX_TX_RATE	9999
+#define QLC_MAC_OPCODE_MASK	0x7
+#define QLC_MAC_STAR_ADD	6
+#define QLC_MAC_STAR_DEL	7
 
 static int qlcnic_sriov_pf_get_vport_handle(struct qlcnic_adapter *, u8);
 
@@ -1173,6 +1176,13 @@ static int qlcnic_sriov_validate_cfg_macvlan(struct qlcnic_adapter *adapter,
 	struct qlcnic_vport *vp = vf->vp;
 	u8 op, new_op;
 
+	if (((cmd->req.arg[1] & QLC_MAC_OPCODE_MASK) == QLC_MAC_STAR_ADD) ||
+	    ((cmd->req.arg[1] & QLC_MAC_OPCODE_MASK) == QLC_MAC_STAR_DEL)) {
+		netdev_err(adapter->netdev, "MAC + any VLAN filter not allowed from VF %d\n",
+			   vf->pci_func);
+		return -EINVAL;
+	}
+
 	if (!(cmd->req.arg[1] & BIT_8))
 		return -EINVAL;
 
-- 
1.8.3.1

  reply	other threads:[~2014-01-10 17:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10 16:48 [PATCH net-next 0/8] qlcnic driver updates Shahed Shaikh
2014-01-10 16:48 ` Shahed Shaikh [this message]
2014-01-10 16:48 ` [PATCH net-next 2/8] qlcnic: Enable VF flood bit on PF Shahed Shaikh
2014-01-10 16:48 ` [PATCH net-next 3/8] qlcnic: Turn on promiscous mode for SRIOV PF Shahed Shaikh
2014-01-10 16:48 ` [PATCH net-next 4/8] qlcnic: Do MAC learning " Shahed Shaikh
2014-01-10 16:48 ` [PATCH net-next 5/8] qlcnic: Enable beaconing for 83xx/84xx Series adapter Shahed Shaikh
2014-01-10 16:48 ` [PATCH net-next 6/8] qlcnic: Fix SR-IOV cleanup code path Shahed Shaikh
2014-01-10 16:48 ` [PATCH net-next 7/8] qlcnic: Enable IPv6 LRO even if IP address is not programmed Shahed Shaikh
2014-01-10 16:48 ` [PATCH net-next 8/8] qlcnic: Update version to 5.3.54 Shahed Shaikh
2014-01-13 23:32 ` [PATCH net-next 0/8] qlcnic driver updates David Miller
2014-01-14  5:25   ` Shahed Shaikh

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=1389372539-13753-2-git-send-email-shahed.shaikh@qlogic.com \
    --to=shahed.shaikh@qlogic.com \
    --cc=Dept_NX_Linux_NIC_Driver@qlogic.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sucheta.chakraborty@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).