All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Gavin Shan <gwshan@linux.vnet.ibm.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, sergei.shtylyov@cogentembedded.com
Subject: Re: [PATCH RFC 6/6] net/faraday: Enable offload checksum according to device-tree
Date: Mon, 09 Nov 2015 11:36:10 +1100	[thread overview]
Message-ID: <1447029370.8727.33.camel@kernel.crashing.org> (raw)
In-Reply-To: <1447027806-4744-7-git-send-email-gwshan@linux.vnet.ibm.com>

On Mon, 2015-11-09 at 11:10 +1100, Gavin Shan wrote:
> This enables IP/UDP/TCP offload checksum according to information
> passed on from bootloader through device-tree. The offload doesn't
> working properly when the interface works in NCSI mode.
> 
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> ---
>  drivers/net/ethernet/faraday/ftgmac100.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index 1b13fd4..1e2f4d2 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> @@ -1377,7 +1377,10 @@ static int ftgmac100_probe(struct platform_device *pdev)
>  
>  > 	> netdev->ethtool_ops = &ftgmac100_ethtool_ops;
>  > 	> netdev->netdev_ops = &ftgmac100_netdev_ops;
> -> 	> netdev->features = NETIF_F_IP_CSUM | NETIF_F_GRO;
> +> 	> netdev->features = NETIF_F_GRO;
> +> 	> if (pdev->dev.of_node &&
> +> 	>     of_property_read_bool(pdev->dev.of_node, "no-hw-checksum"))
> +> 	> 	> netdev->features |= NETIF_F_IP_CSUM;

Am I reading properly that if you put "no-hw-checksum" in the device-
tree you *enable* HW checksum ? This doesn't look right to me...

The logic should be:

	if (pdev->dev.of_node &&
		of_property_read_bool(pdev->dev.of_node, "no-hw-checksum"))
		netdev->features &= ~NETIF_F_IP_CSUM;

  reply	other threads:[~2015-11-09  0:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09  0:10 [PATCH RFC 0/6] NCSI Support Gavin Shan
2015-11-09  0:10 ` [PATCH RFC 1/6] net/ncsi: Resource management Gavin Shan
2015-11-09  0:10 ` [PATCH RFC 2/6] net/ncsi: Packet handler Gavin Shan
2015-11-09  0:41   ` Benjamin Herrenschmidt
2015-11-09  0:10 ` [PATCH RFC 3/6] net/ncsi: Manage NCSI device Gavin Shan
2015-11-09  0:10 ` [PATCH RFC 4/6] net/faraday: Replace use_nc_si with use_ncsi Gavin Shan
2015-11-09  0:30   ` Benjamin Herrenschmidt
2015-11-09  0:45     ` Gavin Shan
2015-11-09  0:10 ` [PATCH RFC 5/6] net/faraday: Enable NCSI interface Gavin Shan
2015-11-09  0:32   ` Benjamin Herrenschmidt
2015-11-09  7:30     ` Gavin Shan
2015-11-09 20:28       ` Benjamin Herrenschmidt
2015-11-10  6:12         ` Gavin Shan
2015-11-10 10:34           ` Benjamin Herrenschmidt
2015-11-09  0:10 ` [PATCH RFC 6/6] net/faraday: Enable offload checksum according to device-tree Gavin Shan
2015-11-09  0:36   ` Benjamin Herrenschmidt [this message]
2015-11-09  0:45     ` Gavin Shan
2016-02-24  2:59 ` [PATCH RFC 0/6] NCSI Support Gavin Shan
2016-02-24 14:49   ` 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=1447029370.8727.33.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.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.