linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ragner Magalhaes <ragner.magalhaes@indt.org.br>
To: ext Brian King <brking@linux.vnet.ibm.com>
Cc: linuxppc-dev@ozlabs.org, rcjenn@linux.vnet.ibm.com,
	santil@linux.vnet.ibm.com, netdev@vger.kernel.org
Subject: Re: [PATCH 2/4] ibmveth: Implement ethtool hooks to enable/disable checksum offload
Date: Thu, 19 Jul 2007 12:08:32 -0400	[thread overview]
Message-ID: <469F8C80.7070302@indt.org.br> (raw)
In-Reply-To: <200707191548.l6JFmEYM020387@d03av04.boulder.ibm.com>

ext Brian King wrote:

> +
> +static int ibmveth_set_rx_csum(struct net_device *dev, u32 data)
> +{
> +	struct ibmveth_adapter *adapter = dev->priv;
> +

Why do not to do

	if ((data && adapter->rx_csum) || (!data && !adapter->rx_csum))
		return 0;
less two lines.

> +	if (data && adapter->rx_csum)
> +		return 0;
> +	if (!data && !adapter->rx_csum)
> +		return 0;
> +
> +	return ibmveth_set_csum_offload(dev, data, ibmveth_set_rx_csum_flags);
> +}
> +
> +static int ibmveth_set_tx_csum(struct net_device *dev, u32 data)
> +{
> +	struct ibmveth_adapter *adapter = dev->priv;
> +	int rc = 0;
> +

here also, as above ...
> +	if (data && (dev->features & NETIF_F_IP_CSUM))
> +		return 0;
> +	if (!data && !(dev->features & NETIF_F_IP_CSUM))
> +		return 0;
> +
> +	if (data && !adapter->rx_csum)
> +		rc = ibmveth_set_csum_offload(dev, data, ibmveth_set_tx_csum_flags);
> +	else
> +		ibmveth_set_tx_csum_flags(dev, data);
> +
> +	return rc;
> +}
> +
Best regards,
Ragner

  reply	other threads:[~2007-07-19 16:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 15:48 [PATCH 1/4] ibmveth: Enable TCP checksum offload Brian King
2007-07-19 15:48 ` [PATCH 2/4] ibmveth: Implement ethtool hooks to enable/disable " Brian King
2007-07-19 16:08   ` Ragner Magalhaes [this message]
2007-07-19 17:59     ` Brian King
2007-07-19 18:17       ` Ragner Magalhaes
2007-07-19 18:28         ` Brian King
2007-07-19 15:48 ` [PATCH 3/4] ibmveth: Add ethtool TSO handlers Brian King
2007-07-19 15:48 ` [PATCH 4/4] ibmveth: Add ethtool driver stats hooks Brian King
  -- strict thread matches above, loose matches on Subject: below --
2007-07-17 15:17 [PATCH 1/4] ibmveth: Enable TCP checksum offload Brian King
2007-07-17 15:17 ` [PATCH 2/4] ibmveth: Implement ethtool hooks to enable/disable " Brian King
2007-07-18 22:33   ` Jeff Garzik

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=469F8C80.7070302@indt.org.br \
    --to=ragner.magalhaes@indt.org.br \
    --cc=brking@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=rcjenn@linux.vnet.ibm.com \
    --cc=santil@linux.vnet.ibm.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 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).