From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: "Paweł Jabłoński" <pawel.jablonski@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, "Jeff Kirsher" <jeffrey.t.kirsher@intel.com>
Subject: [net-next 03/15] i40evf: Allow turning off offloads when the VF has VLAN set
Date: Fri, 26 Jan 2018 13:24:47 -0800 [thread overview]
Message-ID: <20180126212459.4246-4-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20180126212459.4246-1-jeffrey.t.kirsher@intel.com>
From: Paweł Jabłoński <pawel.jablonski@intel.com>
This patch adds back the capability to turn off offloads when VF has
VLAN set. The commit 0a3b4f702fb1 ("i40evf: enable support for VF VLAN
tag stripping control") adds the i40evf_set_features function and
changes the 'turn off' flow for offloads. This patch adds that
capability back by moving checking the VLAN option for VF to the
next statement.
Signed-off-by: Paweł Jabłoński <pawel.jablonski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 8934f784e96f..d59bf060196b 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2344,13 +2344,19 @@ static int i40evf_set_features(struct net_device *netdev,
{
struct i40evf_adapter *adapter = netdev_priv(netdev);
- if (!VLAN_ALLOWED(adapter))
+ /* Don't allow changing VLAN_RX flag when VLAN is set for VF
+ * and return an error in this case
+ */
+ if (VLAN_ALLOWED(adapter)) {
+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
+ adapter->aq_required |=
+ I40EVF_FLAG_AQ_ENABLE_VLAN_STRIPPING;
+ else
+ adapter->aq_required |=
+ I40EVF_FLAG_AQ_DISABLE_VLAN_STRIPPING;
+ } else if ((netdev->features ^ features) & NETIF_F_HW_VLAN_CTAG_RX) {
return -EINVAL;
-
- if (features & NETIF_F_HW_VLAN_CTAG_RX)
- adapter->aq_required |= I40EVF_FLAG_AQ_ENABLE_VLAN_STRIPPING;
- else
- adapter->aq_required |= I40EVF_FLAG_AQ_DISABLE_VLAN_STRIPPING;
+ }
return 0;
}
--
2.14.3
next prev parent reply other threads:[~2018-01-26 21:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 21:24 [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2018-01-26 Jeff Kirsher
2018-01-26 21:24 ` [net-next 01/15] i40e: Add returning AQ critical error to SW Jeff Kirsher
2018-01-26 21:24 ` [net-next 02/15] i40e: Fix for adding multiple ethtool filters on the same location Jeff Kirsher
2018-01-26 21:24 ` Jeff Kirsher [this message]
2018-01-26 21:24 ` [net-next 04/15] i40e/i40evf: Use ring pointers to clean up _set_itr_per_queue Jeff Kirsher
2018-01-26 21:24 ` [net-next 05/15] i40e: Display LLDP information on vSphere Web Client Jeff Kirsher
2018-01-26 21:24 ` [net-next 06/15] i40e: change flags to use 64 bits Jeff Kirsher
2018-02-07 15:09 ` [net-next,06/15] " James Hogan
2018-02-07 17:02 ` Shannon Nelson
2018-01-26 21:24 ` [net-next 07/15] i40e: Implement an ethtool private flag to stop LLDP in FW Jeff Kirsher
2018-01-27 20:50 ` Or Gerlitz
2018-01-26 21:24 ` [net-next 08/15] i40e: fix FW_LLDP flag on init Jeff Kirsher
2018-01-26 21:24 ` [net-next 09/15] i40e: cleanup unnecessary parens Jeff Kirsher
2018-01-26 21:24 ` [net-next 10/15] i40e: Fix kdump failure Jeff Kirsher
2018-01-26 21:24 ` [net-next 11/15] i40e: program fragmented IPv4 filter input set Jeff Kirsher
2018-01-26 21:24 ` [net-next 12/15] i40e: disallow programming multiple filters with same criteria Jeff Kirsher
2018-01-26 21:24 ` [net-next 13/15] i40e: fix reported mask for ntuple filters Jeff Kirsher
2018-01-26 21:24 ` [net-next 14/15] i40e/i40evf: Record ITR register location in the q_vector Jeff Kirsher
2018-01-26 21:24 ` [net-next 15/15] i40e: Do not allow use more TC queue pairs than MSI-X vectors exist Jeff Kirsher
2018-01-29 2:27 ` [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2018-01-26 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=20180126212459.4246-4-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=pawel.jablonski@intel.com \
--cc=sassmann@redhat.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).