lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 31 Aug 2011 17:37:49 +0200
From:	Michal Schmidt <mschmidt@...hat.com>
To:	"Vlad Zolotarov" <vladz@...adcom.com>
Cc:	Michał Mirosław <mirqus@...il.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"Dmitry Kravkov" <dmitry@...adcom.com>,
	"Eilon Greenstein" <eilong@...adcom.com>
Subject: Re: [PATCH 7/7] bnx2x: expose HW RX VLAN stripping toggle

On Wed, 31 Aug 2011 18:07:53 +0300 Vlad Zolotarov wrote:
> If u want to change the implementation the way we rely on the
> dev->features in the ndo_set_features() flow, which is a semantics
> change, u'd rather change the __netdev_update_features() so that it
> sets the dev->features before ndo_set_features() call and restores it
> in case of a failure. Something like this:

...
> diff --git a/net/core/dev.c b/net/core/dev.c
> index b2e262e..474e539 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5321,7 +5321,7 @@ static u32 netdev_fix_features(struct
> net_device *dev, u32 features) 
>  int __netdev_update_features(struct net_device *dev)
>  {
> -       u32 features;
> +       u32 features, old_features;
>         int err = 0;
>  
>         ASSERT_RTNL();
> @@ -5340,19 +5340,23 @@ int __netdev_update_features(struct
> net_device *dev) netdev_dbg(dev, "Features changed: 0x%08x ->
> 0x%08x\n", dev->features, features);
>  
> +       /* Remember the original features and set the new ones */
> +       old_features = dev->features;
> +       dev->features = features;
> +
>         if (dev->netdev_ops->ndo_set_features)
> -               err = dev->netdev_ops->ndo_set_features(dev,
> features);
> +               err = dev->netdev_ops->ndo_set_features(dev);

Drivers want to know which features changed. They compare
the features argument with dev->features.
Perhaps we could pass old_features as the argument. Then we'd better
change the name of the callback to avoid confusion.

I think it's not worth changing. I could restore dev->features before
returning if bnx2x_reload_if_running() fails.

Michal
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ