public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] vlan: fix updating wanted_features for vlan device
@ 2011-05-05  0:48 Yi Zou
  2011-05-05  6:51 ` Michał Mirosław
  0 siblings, 1 reply; 3+ messages in thread
From: Yi Zou @ 2011-05-05  0:48 UTC (permalink / raw)
  To: netdev; +Cc: mirq-linux, jeffrey.t.kirsher, devel

commit 8a0427b "vlan: convert VLAN devices to use ndo_fix_features()" converts the
vlan to support ndo_fix_features. However, the wanted_features is not updated
for the vlan device, causing real_dev->features not be populated to the vlan
device when real_dev->features are changed by the driver through FEAT_CHANGE.
This is breaking FCoE related netdev feature flags on vlan devices. Add updating
wanted_features to vlan_transfer_features() so netdev_get_wanted_features() will
can get the updated wanted feature flags for vlan device properly.

I am sending as RFC in case the usage of wanted_features on vlan device is not
right, since the features chanaged are not directly from user doing ethtool, but
it is from user action of starting to run FCoE on a netdev instance. Anyway, let
let me know if there is a preferred alternative fix.

Signed-off-by: Yi Zou <yi.zou@intel.com>
---

 net/8021q/vlan.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 969e700..f2ee00b 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -332,6 +332,7 @@ static void vlan_transfer_features(struct net_device *dev,
 #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
 	vlandev->fcoe_ddp_xid = dev->fcoe_ddp_xid;
 #endif
+	vlandev->wanted_features |= dev->features & dev->vlan_features;
 
 	netdev_update_features(vlandev);
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [RFC] vlan: fix updating wanted_features for vlan device
  2011-05-05  0:48 [PATCH] [RFC] vlan: fix updating wanted_features for vlan device Yi Zou
@ 2011-05-05  6:51 ` Michał Mirosław
  2011-05-05  7:49   ` Zou, Yi
  0 siblings, 1 reply; 3+ messages in thread
From: Michał Mirosław @ 2011-05-05  6:51 UTC (permalink / raw)
  To: Yi Zou; +Cc: netdev, jeffrey.t.kirsher, devel

On Wed, May 04, 2011 at 05:48:42PM -0700, Yi Zou wrote:
> commit 8a0427b "vlan: convert VLAN devices to use ndo_fix_features()" converts the
> vlan to support ndo_fix_features. However, the wanted_features is not updated
> for the vlan device, causing real_dev->features not be populated to the vlan
> device when real_dev->features are changed by the driver through FEAT_CHANGE.
> This is breaking FCoE related netdev feature flags on vlan devices. Add updating
> wanted_features to vlan_transfer_features() so netdev_get_wanted_features() will
> can get the updated wanted feature flags for vlan device properly.

Can you describe the situation further? There might be problems if device
changes its vlan_features after creation of VLAN devices on top (bonding?).

dev->wanted_features is only what user wants to get and should not be changed
by anything else.

Best Regards,
Michał Mirosław

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] [RFC] vlan: fix updating wanted_features for vlan device
  2011-05-05  6:51 ` Michał Mirosław
@ 2011-05-05  7:49   ` Zou, Yi
  0 siblings, 0 replies; 3+ messages in thread
From: Zou, Yi @ 2011-05-05  7:49 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: netdev@vger.kernel.org, Kirsher, Jeffrey T, devel@open-fcoe.org

> 
> On Wed, May 04, 2011 at 05:48:42PM -0700, Yi Zou wrote:
> > commit 8a0427b "vlan: convert VLAN devices to use ndo_fix_features()"
> converts the
> > vlan to support ndo_fix_features. However, the wanted_features is not
> updated
> > for the vlan device, causing real_dev->features not be populated to the
> vlan
> > device when real_dev->features are changed by the driver through
> FEAT_CHANGE.
> > This is breaking FCoE related netdev feature flags on vlan devices. Add
> updating
> > wanted_features to vlan_transfer_features() so
> netdev_get_wanted_features() will
> > can get the updated wanted feature flags for vlan device properly.
> 
> Can you describe the situation further? There might be problems if device
> changes its vlan_features after creation of VLAN devices on top
> (bonding?).

Not sure for bonding, I noticed this when creating FCoE instance on a vlan
Device on top of an Intel 82599 device. The real_dev is created with 
vlan_features set of related FCoE flags, e.g., NETIF_F_FCOE_MTU, NETIF_F_FCOE_CRC,
etc. However, the real_dev's features are not set w/ these FCoE flags till 
the FCoE protocol stack starts using FCoE when ndo_fcoe_enable() is called, 
where in the case of 82599's case, these flags are toggled on in netdev's 
features, and netdev_features_change() is called to populate to the upper 
vlan device since previously we do:

       vlandev->features &= ~dev->vlan_features;
       vlandev->features |= dev->features & dev->vlan_features; 

in vlan_transfer_features(). FCoE only checks the corresponding netdev features
(vlan or real_dev) passed in from user space as a interface name e.g., eth2.100,
to tell if, for example, FCOE_MTU is supported. Particularly for this case, there
is no change on vlan_features. 

> 
> dev->wanted_features is only what user wants to get and should not be
> changed
> by anything else.
Hmm...so my usage for that seems to be wrong if that's what wanted_features is
meant to be. Well, wanted_features in vlan is features & hw_features, if it stays,
then, it seems to me will never get changes from real_dev's features since 
netdev_get_wanted_features() won't get it to begin w/.

Also, note my RFC isn't complete either, as it only sets not clears previously
flags in wanted_features.

Thanks,
yi
> 
> Best Regards,
> Michał Mirosław

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-05  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-05  0:48 [PATCH] [RFC] vlan: fix updating wanted_features for vlan device Yi Zou
2011-05-05  6:51 ` Michał Mirosław
2011-05-05  7:49   ` Zou, Yi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox