All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Nelson Chang <nelson.chang@mediatek.com>,
	john@phrozen.org, davem@davemloft.net
Cc: nbd@openwrt.org, netdev@vger.kernel.org,
	linux-mediatek@lists.infradead.org, nelsonch.tw@gmail.com
Subject: Re: [PATCH net-next 2/3] net: ethernet: mediatek: add ethtool functions to configure RX flows of HW LRO
Date: Tue, 13 Sep 2016 11:26:51 -0700	[thread overview]
Message-ID: <0416bf6a-1a3d-f8fe-9150-8f143c48ee8c@gmail.com> (raw)
In-Reply-To: <1473774866-3156-3-git-send-email-nelson.chang@mediatek.com>

On 09/13/2016 06:54 AM, Nelson Chang wrote:
> The codes add ethtool functions to set RX flows for HW LRO. Because the
> HW LRO hardware can only recognize the destination IP of TCP/IP RX flows,
> the ethtool command to add HW LRO flow is as below:
> ethtool -N [devname] flow-type tcp4 dst-ip [ip_addr] loc [0~1]
> 
> Otherwise, cause the hardware can set total four destination IPs, each
> GMAC (GMAC1/GMAC2) can set two IPs separately at most.
> 
> Signed-off-by: Nelson Chang <nelson.chang@mediatek.com>
> ---

> +
> +static int mtk_set_features(struct net_device *dev, netdev_features_t features)
> +{
> +	int err = 0;
> +
> +	if (!((dev->features ^ features) & NETIF_F_LRO))
> +		return 0;
> +
> +	if (!(features & NETIF_F_LRO))
> +		mtk_hwlro_netdev_disable(dev);

you may want to implement a fix_features ndo operations which makes sure
that NETIF_F_LRO is turned on in case a RX flow is programmed,
otherwise, it may be confusing to the user that a flow was programmed,
but no offload is happening.
-- 
Florian

  reply	other threads:[~2016-09-13 18:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 13:54 [PATCH net-next 0/3] net: ethernet: mediatek: add HW LRO functions Nelson Chang
2016-09-13 13:54 ` Nelson Chang
2016-09-13 13:54 ` [PATCH net-next 1/3] net: ethernet: mediatek: add HW LRO functions of PDMA RX rings Nelson Chang
2016-09-13 13:54   ` Nelson Chang
2016-09-13 13:54 ` [PATCH net-next 2/3] net: ethernet: mediatek: add ethtool functions to configure RX flows of HW LRO Nelson Chang
2016-09-13 13:54   ` Nelson Chang
2016-09-13 18:26   ` Florian Fainelli [this message]
2016-09-13 13:54 ` [PATCH net-next 3/3] net: ethernet: mediatek: add dts configuration to enable " Nelson Chang
2016-09-13 13:54   ` Nelson Chang
2016-09-13 18:24   ` Florian Fainelli
2016-09-14  5:22 [PATCH net-next 2/3] net: ethernet: mediatek: add ethtool functions to configure RX flows of " Nelson Chang
2016-09-14  5:22 ` Nelson Chang

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=0416bf6a-1a3d-f8fe-9150-8f143c48ee8c@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=davem@davemloft.net \
    --cc=john@phrozen.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=nbd@openwrt.org \
    --cc=nelson.chang@mediatek.com \
    --cc=nelsonch.tw@gmail.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 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.