[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1288647537.2231.81.camel@achroite.uk.solarflarecom.com>
Date: Mon, 01 Nov 2010 21:38:57 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc: netdev@...r.kernel.org, e1000-devel@...ts.sourceforge.net,
Steve Glendinning <steve.glendinning@...c.com>,
Greg Kroah-Hartman <gregkh@...e.de>,
Rasesh Mody <rmody@...cade.com>,
Debashis Dutt <ddutt@...cade.com>,
Kristoffer Glembo <kristoffer@...sler.com>,
linux-driver@...gic.com, linux-net-drivers@...arflare.com
Subject: Re: [PATCH 4/4] Ethtool: convert get_tx_csum/set_tx_csum calls to
hw_features flags
On Sun, 2010-10-31 at 02:09 +0200, Michał Mirosław wrote:
[...]
> diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
> index 9f6aeef..5ba4535 100644
> --- a/drivers/net/dm9000.c
> +++ b/drivers/net/dm9000.c
> @@ -132,7 +132,6 @@ typedef struct board_info {
> u32 wake_state;
>
> int rx_csum;
> - int can_csum;
> int ip_summed;
> } board_info_t;
>
> @@ -480,7 +479,7 @@ static int dm9000_set_rx_csum_unlocked(struct net_device *dev, uint32_t data)
> {
> board_info_t *dm = to_dm9000_board(dev);
>
> - if (dm->can_csum) {
> + if (dev->hw_features & NETIF_F_IP_CSUM) {
This is a bit ugly because can_csum is being used to indicate RX
checksum offload capability whereas the checksum feature flags logically
indicate TX checksum offload capability. Of course, the two hardware
features are highly correlated!
[...]
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 9b0e598..95e8b7a 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
[...]
> @@ -1077,12 +1039,18 @@ static int __ethtool_set_sg(struct net_device *dev, u32 data)
> return 0;
> }
>
> +static u32 ethtool_get_tx_csum(struct net_device *dev)
> +{
> + return (dev->features & (NETIF_F_ALL_CSUM|NETIF_F_SCTP_CSUM)) != 0;
> +}
> +
[...]
It seems to me that NETIF_F_SCTP_CSUM should be added to
NETIF_F_ALL_CSUM, though that may cause problems in some other places
NETIF_F_ALL_CSUM is used.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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