All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: netdev@vger.kernel.org, e1000-devel@lists.sourceforge.net,
	Steve Glendinning <steve.glendinning@smsc.com>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Rasesh Mody <rmody@brocade.com>,
	Debashis Dutt <ddutt@brocade.com>,
	Kristoffer Glembo <kristoffer@gaisler.com>,
	linux-driver@qlogic.com, linux-net-drivers@solarflare.com
Subject: Re: [PATCH 4/4] Ethtool: convert get_tx_csum/set_tx_csum calls to hw_features flags
Date: Mon, 01 Nov 2010 21:38:57 +0000	[thread overview]
Message-ID: <1288647537.2231.81.camel@achroite.uk.solarflarecom.com> (raw)
In-Reply-To: <904bc8c98062fc793573ee6bc120ed0b8af292d2.1288496405.git.mirq-linux@rere.qmqm.pl>

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.


  reply	other threads:[~2010-11-01 21:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-31  3:40 [PATCH 0/4] Ethtool: cleanup strategy Michał Mirosław
2010-10-30  4:27 ` [PATCH 1/4] Ethtool: Introduce hw_features field in struct netdevice Michał Mirosław
2010-10-30  4:28 ` [PATCH 2/4] Ethtool: convert get_sg/set_sg calls to hw_features flag Michał Mirosław
2010-11-01 21:15   ` Ben Hutchings
2010-11-02  0:59     ` Michał Mirosław
2010-11-02  2:24   ` Matt Carlson
2010-11-03 22:29     ` Micha?? Miros??aw
2010-11-03 22:42       ` Matt Carlson
2010-11-03 22:58         ` Michał Mirosław
2010-10-30  8:44 ` [PATCH 3/4] Ethtool: convert get_tso/set_tso calls to hw_features flags Michał Mirosław
2010-11-01 21:25   ` Ben Hutchings
2010-11-02  1:14     ` Michał Mirosław
2010-11-02  2:49   ` Matt Carlson
2010-10-31  0:09 ` [PATCH 4/4] Ethtool: convert get_tx_csum/set_tx_csum " Michał Mirosław
2010-11-01 21:38   ` Ben Hutchings [this message]
2010-11-02  1:23     ` Michał Mirosław
2010-10-31  4:18 ` [PATCH 0/4] Ethtool: cleanup strategy David Miller
2010-10-31  4:30   ` Michał Mirosław
2010-11-01 21:05 ` Ben Hutchings
2010-11-02  1:02   ` Michał Mirosław
2010-11-02  1:14     ` Ben Hutchings
2010-11-02  1:30       ` Michał Mirosław

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=1288647537.2231.81.camel@achroite.uk.solarflarecom.com \
    --to=bhutchings@solarflare.com \
    --cc=ddutt@brocade.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=gregkh@suse.de \
    --cc=kristoffer@gaisler.com \
    --cc=linux-driver@qlogic.com \
    --cc=linux-net-drivers@solarflare.com \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=netdev@vger.kernel.org \
    --cc=rmody@brocade.com \
    --cc=steve.glendinning@smsc.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.