[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG88wWZ70FRY7Zk8UszZGpM2j8h615B3Wr84Jw9w6vjqwrHitA@mail.gmail.com>
Date: Mon, 21 Nov 2011 16:04:06 -0800
From: David Decotigny <david.decotigny@...gle.com>
To: Michał Mirosław <mirqus@...il.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Bruce Allan <bruce.w.allan@...el.com>,
Carolyn Wyborny <carolyn.wyborny@...el.com>,
Don Skidmore <donald.c.skidmore@...el.com>,
Greg Rose <gregory.v.rose@...el.com>,
Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@...el.com>,
Alex Duyck <alexander.h.duyck@...el.com>,
John Ronciak <john.ronciak@...el.com>,
e1000-devel@...ts.sourceforge.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <eric.dumazet@...il.com>,
Ian Campbell <ian.campbell@...rix.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>
Subject: Re: [PATCH net-next v1 1/4] net-e1000e: fix ethtool set_features
taking new features into account too late
Hello,
2011/11/21 Michał Mirosław <mirqus@...il.com>:
>> static int e1000_set_features(struct net_device *netdev,
>> - netdev_features_t features)
>> + netdev_features_t features)
>> {
>> struct e1000_adapter *adapter = netdev_priv(netdev);
>> netdev_features_t changed = features ^ netdev->features;
>> + int retval = 1; /* telling netdev that we are updating
>> + * netdev->features by ourselves */
>> +
>> + netdev->features = features;
>>
>> if (changed & (NETIF_F_TSO | NETIF_F_TSO6))
>> adapter->flags |= FLAG_TSO_FORCE;
>>
>> if (!(changed & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX |
>> NETIF_F_RXCSUM)))
>> - return 0;
>> + return retval;
>>
>
> Would be less code if you set netdev->features here...
>
>> if (netif_running(netdev))
>> e1000e_reinit_locked(adapter);
>> else
>> e1000e_reset(adapter);
>>
>> - return 0;
>> + return retval;
>
> ... and return 1 here, noting in a comment that e1000e_reinit_locked()
> might have changed netdev->features.
This would work, although I preferred the systematic approach for code
management reasons. But I will follow your recommendations. Waiting a
little (review of other patches) before sending the updated version.
Thanks!
--
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