mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH net-next v2 3/6] net: dsa: remove dsa_uses_tagged_protocol
Date: Tue, 30 May 2017 13:47:53 -0700	[thread overview]
Message-ID: <3741e6b9-98a5-c587-ef8f-851b17cb3145@gmail.com> (raw)
In-Reply-To: <20170530183319.10718-4-vivien.didelot@savoirfairelinux.com>

On 05/30/2017 11:33 AM, Vivien Didelot wrote:
> Since dev->dsa_ptr is a pointer to a dsa_switch_tree, there is no need
> to have another inline helper just to check rcv.
> 
> Remove dsa_uses_tagged_protocol and check dsa_ptr && dsa_ptr->rcv
> together at the same time.
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

FYI, the part that matters here is that we know whether the master
network device actually uses a tagged DSA protocol, this is important
for e.g: bridge (see 8db0a2ee2c6302a1dcbcdb93cb731dfc6c0cdb5e). Some
drivers like bcmsysport.c also care about that in order to enable
specific switch tagging protocol parsing hints.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  include/net/dsa.h | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index 58297e4c6b31..4675b52c964c 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -467,16 +467,10 @@ struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
>  struct net_device *dsa_dev_to_net_device(struct device *dev);
>  
>  /* Keep inline for faster access in hot path */
> -static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)
> -{
> -	return dst->rcv != NULL;
> -}
> -
>  static inline bool netdev_uses_dsa(struct net_device *dev)
>  {
>  #if IS_ENABLED(CONFIG_NET_DSA)
> -	if (dev->dsa_ptr != NULL)
> -		return dsa_uses_tagged_protocol(dev->dsa_ptr);
> +	return dev->dsa_ptr && dev->dsa_ptr->rcv;
>  #endif
>  	return false;
>  }
> 


-- 
Florian

  reply	other threads:[~2017-05-30 20:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-30 18:33 [PATCH net-next v2 0/6] net: dsa: tagger simplification Vivien Didelot
2017-05-30 18:33 ` [PATCH net-next v2 1/6] net: dsa: comment hot path requirements Vivien Didelot
2017-05-30 20:34   ` Florian Fainelli
2017-05-30 18:33 ` [PATCH net-next v2 2/6] net: dsa: do not cast dst Vivien Didelot
2017-05-30 20:34   ` Florian Fainelli
2017-05-30 18:33 ` [PATCH net-next v2 3/6] net: dsa: remove dsa_uses_tagged_protocol Vivien Didelot
2017-05-30 20:47   ` Florian Fainelli [this message]
2017-05-30 18:33 ` [PATCH net-next v2 4/6] net: dsa: remove unused arguments of tagger rcv Vivien Didelot
2017-05-30 19:03   ` Florian Fainelli
2017-05-30 19:55     ` Vivien Didelot
2017-05-30 19:59       ` Florian Fainelli
2017-05-30 20:03         ` Vivien Didelot
2017-05-30 18:33 ` [PATCH net-next v2 5/6] net: dsa: remove out_drop label in taggers rcv Vivien Didelot
2017-05-30 20:48   ` Florian Fainelli
2017-05-30 18:33 ` [PATCH net-next v2 6/6] net: dsa: factor skb freeing on xmit Vivien Didelot
2017-05-30 20:59   ` Florian Fainelli
2017-05-31 18:18     ` Vivien Didelot

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=3741e6b9-98a5-c587-ef8f-851b17cb3145@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.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

Powered by JetHome