All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alice Michael <alice.michael@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next PATCH S79-V2 12/13] i40evf: enable support for VF VLAN tag stripping control
Date: Tue, 29 Aug 2017 05:32:41 -0400	[thread overview]
Message-ID: <20170829093242.41026-12-alice.michael@intel.com> (raw)
In-Reply-To: <20170829093242.41026-1-alice.michael@intel.com>

From: Jacob Keller <jacob.e.keller@intel.com>

A recent commit 809481484e5d ("i40e/i40evf: support for VF VLAN tag
stripping control") added support for VFs to negotiate the control of
VLAN tag stripping. This should have allowed VFs to disable the feature.
Unfortunately, the flag was set only in netdev->feature flags and not in
netdev->hw_features.

This ultimately causes the stack to assume that it cannot change the
flag, so it was unchangeable and marked as [fixed] in the ethtool -k
output.

Fix this by setting the feature in hw_features first, just as we do for
the PF code. This enables ethtool -K to disable the feature correctly,
and fully enables user control of the VLAN tag stripping feature.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 70a033c..5caa1bd 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2425,10 +2425,6 @@ static netdev_features_t i40evf_features_check(struct sk_buff *skb,
 	return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
 }
 
-#define I40EVF_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_TX |\
-			      NETIF_F_HW_VLAN_CTAG_RX |\
-			      NETIF_F_HW_VLAN_CTAG_FILTER)
-
 /**
  * i40evf_fix_features - fix up the netdev feature bits
  * @netdev: our net device
@@ -2441,9 +2437,11 @@ static netdev_features_t i40evf_fix_features(struct net_device *netdev,
 {
 	struct i40evf_adapter *adapter = netdev_priv(netdev);
 
-	features &= ~I40EVF_VLAN_FEATURES;
-	if (adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)
-		features |= I40EVF_VLAN_FEATURES;
+	if (!(adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
+		features &= ~(NETIF_F_HW_VLAN_CTAG_TX |
+			      NETIF_F_HW_VLAN_CTAG_RX |
+			      NETIF_F_HW_VLAN_CTAG_FILTER);
+
 	return features;
 }
 
@@ -2574,9 +2572,17 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
 	 */
 	hw_features = hw_enc_features;
 
+	/* Enable VLAN features if supported */
+	if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)
+		hw_features |= (NETIF_F_HW_VLAN_CTAG_TX |
+				NETIF_F_HW_VLAN_CTAG_RX);
+
 	netdev->hw_features |= hw_features;
 
-	netdev->features |= hw_features | I40EVF_VLAN_FEATURES;
+	netdev->features |= hw_features;
+
+	if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)
+		netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
 
 	adapter->vsi.id = adapter->vsi_res->vsi_id;
 
-- 
2.9.4


  parent reply	other threads:[~2017-08-29  9:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29  9:32 [Intel-wired-lan] [next PATCH S79-V2 01/13] i40e: add private flag to control source pruning Alice Michael
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 02/13] i40e/i40evf: spread CPU affinity hints across online CPUs only Alice Michael
2017-08-31 20:47   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 03/13] i40e: re-enable PTP L4 capabilities for XL710 if FW >6.0 Alice Michael
2017-08-31 19:01   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 04/13] i40e: redfine I40E_PHY_TYPE_MAX Alice Michael
2017-08-31 19:02   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 05/13] i40e: fix incorrect register definition Alice Michael
2017-08-31 19:03   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 06/13] i40e/i40evf: use DECLARE_BITMAP for state Alice Michael
2017-08-31 19:03   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 07/13] i40e: fix merge error Alice Michael
2017-09-01 17:59   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 08/13] i40e: Display error message if module does not meet thermal requirements Alice Michael
2017-09-05 22:45   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 09/13] i40e: Properly maintain flow director filters list Alice Michael
2017-09-05 18:45   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 10/13] i40e: implement split PCI error reset handler Alice Michael
2017-09-01 18:36   ` Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 11/13] i40e: do not enter PHY debug mode while setting LEDs behaviour Alice Michael
2017-09-01 18:37   ` Bowers, AndrewX
2017-08-29  9:32 ` Alice Michael [this message]
2017-09-01 18:39   ` [Intel-wired-lan] [next PATCH S79-V2 12/13] i40evf: enable support for VF VLAN tag stripping control Bowers, AndrewX
2017-08-29  9:32 ` [Intel-wired-lan] [next PATCH S79-V2 13/13] i40e: ignore skb->xmit_more when deciding to set RS bit Alice Michael
2017-09-05 18:47   ` Bowers, AndrewX
2017-08-31 18:59 ` [Intel-wired-lan] [next PATCH S79-V2 01/13] i40e: add private flag to control source pruning Bowers, AndrewX

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=20170829093242.41026-12-alice.michael@intel.com \
    --to=alice.michael@intel.com \
    --cc=intel-wired-lan@osuosl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.