From: Ben Hutchings <bhutchings@solarflare.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net: forcedeth: convert to hw_features
Date: Fri, 15 Apr 2011 17:39:48 +0100 [thread overview]
Message-ID: <1302885588.2845.4.camel@bwh-desktop> (raw)
In-Reply-To: <20110415145049.CC33613A65@rere.qmqm.pl>
On Fri, 2011-04-15 at 16:50 +0200, Michał Mirosław wrote:
> This also fixes a race around np->txrxctl_bits while changing RXCSUM offload.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
> drivers/net/forcedeth.c | 78 +++++++++++++++-------------------------------
> 1 files changed, 26 insertions(+), 52 deletions(-)
>
> diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
> index d5ab4da..ec9a32d 100644
> --- a/drivers/net/forcedeth.c
> +++ b/drivers/net/forcedeth.c
> @@ -774,7 +774,6 @@ struct fe_priv {
> u32 driver_data;
> u32 device_id;
> u32 register_size;
> - int rx_csum;
> u32 mac_in_use;
> int mgmt_version;
> int mgmt_sema;
> @@ -4480,58 +4479,36 @@ static int nv_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam*
> return 0;
> }
>
> -static u32 nv_get_rx_csum(struct net_device *dev)
> +static u32 nv_fix_features(struct net_device *dev, u32 features)
> {
> - struct fe_priv *np = netdev_priv(dev);
> - return np->rx_csum != 0;
> + /* vlan is dependent on rx checksum offload */
> + if (features & (NETIF_F_HW_VLAN_TX|NETIF_F_HW_VLAN_RX))
> + features |= NETIF_F_RXCSUM;
[...]
Shouldn't this be done the other way round:
if (!(features & NETIF_F_RXCSUM))
features &= ~(NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
So long as the VLAN feature flags are still set in wanted_features, they
will be turned back on automatically if RXCSUM is re-enabled.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2011-04-15 16:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-15 14:50 [PATCH] net: forcedeth: convert to hw_features Michał Mirosław
2011-04-15 16:39 ` Ben Hutchings [this message]
2011-04-15 17:44 ` Michał Mirosław
2011-04-15 22:51 ` David Miller
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=1302885588.2845.4.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).