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]
Message-ID: <20110402122857.GA3147@rere.qmqm.pl>
Date:	Sat, 2 Apr 2011 14:28:57 +0200
From:	Michał Mirosław <mirq-linux@...e.qmqm.pl>
To:	Jesse Gross <jesse@...ira.com>
Cc:	netdev@...r.kernel.org, Patrick McHardy <kaber@...sh.net>,
	"David S. Miller" <davem@...emloft.net>,
	John Fastabend <john.r.fastabend@...el.com>,
	Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [RFC PATCH] vlan: convert VLAN devices to use hw_features

On Fri, Apr 01, 2011 at 06:55:04PM -0700, Jesse Gross wrote:
> 2011/3/31 Michał Mirosław <mirq-linux@...e.qmqm.pl>:
> > diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
> > index e34ea9e..b84a46b 100644
> > --- a/net/8021q/vlan_dev.c
> > +++ b/net/8021q/vlan_dev.c
> > @@ -704,8 +704,8 @@ static int vlan_dev_init(struct net_device *dev)
> >                                          (1<<__LINK_STATE_DORMANT))) |
> >                      (1<<__LINK_STATE_PRESENT);
> >
> > -       dev->features |= real_dev->features & real_dev->vlan_features;
> > -       dev->features |= NETIF_F_LLTX;
> > +       dev->hw_features = real_dev->vlan_features & NETIF_F_ALL_TX_OFFLOADS;
> > +       dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
> Shouldn't this continue to use real_dev->feaures &
> real_dev->vlan_features?  In some places capabilities are blindly
> added to vlan_features on the assumption that they will later be ANDed
> with the real capabilities of the hardware (for example, see
> register_netdevice()).

real_dev->features are ANDed on every netdev_update_features() (also called
by register_netdevice()) by vlan_dev_fix_features(). This sets all
vlan_features as wanted to be enabled, so that if some are initially disabled
on the base device and later enabled then they can be propagated back to vlan
devices. The other way would be to set wanted_features based on current
real_dev->features & real_dev->vlan_features.

Hmm. I just noticed that I missed vlan_transfer_features() in the conversion.
I'll fix that.

Best Regards,
Michał Mirosław
--
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