Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jim Baxter <jim_baxter@mentor.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Frank Li <Frank.Li@freescale.com>,
	Fugang Duan <B38611@freescale.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 1/1] net: fec: Enable imx6 enet checksum acceleration.
Date: Tue, 16 Apr 2013 06:50:31 -0700	[thread overview]
Message-ID: <1366120231.4459.132.camel@edumazet-glaptop> (raw)
In-Reply-To: <1366108587-3866-1-git-send-email-jim_baxter@mentor.com>

On Tue, 2013-04-16 at 11:36 +0100, Jim Baxter wrote:

> +	ndev->features |= NETIF_F_GRO;
>  	napi_enable(&fep->napi);
>  
>  	/* I should reset the ring buffers here, but I don't yet know
> @@ -1618,6 +1707,44 @@ static void fec_poll_controller(struct net_device *dev)
>  }
>  #endif

> +
>  static const struct net_device_ops fec_netdev_ops = {
>  	.ndo_open		= fec_enet_open,
>  	.ndo_stop		= fec_enet_close,
> @@ -1631,6 +1758,8 @@ static const struct net_device_ops fec_netdev_ops = {
>  #ifdef CONFIG_NET_POLL_CONTROLLER
>  	.ndo_poll_controller	= fec_poll_controller,
>  #endif
> +	.ndo_fix_features	= fec_fix_features,
> +	.ndo_set_features	= fec_set_features,
>  };
>  
>   /*
> @@ -1672,6 +1801,11 @@ static int fec_enet_init(struct net_device *ndev)
>  	writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK);
>  	netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, FEC_NAPI_WEIGHT);
>  
> +	/* enable hw accelerator */
> +	ndev->features |= (NETIF_F_HW_CSUM | NETIF_F_GRO);
> +	ndev->hw_features |= (NETIF_F_HW_CSUM | NETIF_F_GRO);
> +	fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
> +
>  	fec_restart(ndev, 0);
>  
>  	return 0;

Unless I am missing something, NETIF_F_GRO doesn't need to be set by a
driver.

Documentation/networking/netdev-features.txt lines 129-130

  parent reply	other threads:[~2013-04-16 13:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 10:36 [PATCH net-next v2 1/1] net: fec: Enable imx6 enet checksum acceleration Jim Baxter
2013-04-16 12:35 ` David Miller
2013-04-16 14:09   ` Jim Baxter
2013-04-16 18:00     ` David Miller
2013-04-16 22:16       ` Jim Baxter
2013-04-16 13:50 ` Eric Dumazet [this message]
2013-04-16 15:30   ` Jim Baxter
2013-04-16 15:39 ` Ben Hutchings
2013-04-16 22:15   ` Jim Baxter
2013-04-16 22:41     ` Ben Hutchings
2013-04-17 14:43       ` Jim Baxter

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=1366120231.4459.132.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=B38611@freescale.com \
    --cc=Frank.Li@freescale.com \
    --cc=davem@davemloft.net \
    --cc=jim_baxter@mentor.com \
    --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