Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725515

Re: [PATCH net-next 3/4] net: dsa: change dsa_ptr for a dsa_master

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 3/4] net: dsa: change dsa_ptr for a dsa_master
Date 2017-09-02 17:40 +0200
Message-ID <uliGC-4E4-7@gated-at.bofh.it> (permalink)
References <ukCHo-Qu-5@gated-at.bofh.it> <ukCHp-Qu-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Vivien


> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index f4a5afc4255b..d5b24cd10f79 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -130,11 +130,6 @@ struct dsa_switch_tree {
>  	 */
>  	struct dsa_platform_data	*pd;
>  
> -	/* Copy of tag_ops->rcv for faster access in hot path */
> -	struct sk_buff *	(*rcv)(struct sk_buff *skb,
> -				       struct net_device *dev,
> -				       struct packet_type *pt);
> -
>  	/*
>  	 * The switch port to which the CPU is attached.
>  	 */


> diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c
> index fbf9ca954773..7897bbd1a110 100644
> --- a/net/dsa/tag_dsa.c
> +++ b/net/dsa/tag_dsa.c
> @@ -67,7 +67,8 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev)
>  static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev,
>  			       struct packet_type *pt)
>  {
> -	struct dsa_switch_tree *dst = dev->dsa_ptr;
> +	struct dsa_master *master = dev->dsa_ptr;
> +	struct dsa_switch_tree *dst = master->port->ds->dst;

This is on the hot path. Every frame received comes through here. We
have gone from one dereference to 4 dereference. That is going to
impact performance. 

How about keeping a copy of dst and ds in master?

    Andrew

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/4] net: dsa: add master interface Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-31 20:50 +0200
  [PATCH net-next 2/4] net: dsa: move master ethtool ops in dsa_master Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-31 20:50 +0200
  [PATCH net-next 4/4] net: dsa: assign a master to slave ports Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-31 20:50 +0200
    Re: [PATCH net-next 4/4] net: dsa: assign a master to slave ports Andrew Lunn <andrew@lunn.ch> - 2017-09-02 17:40 +0200
      Re: [PATCH net-next 4/4] net: dsa: assign a master to slave ports Florian Fainelli <f.fainelli@gmail.com> - 2017-09-02 18:30 +0200
  [PATCH net-next 1/4] net: dsa: introduce dsa_master Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-31 20:50 +0200
  [PATCH net-next 3/4] net: dsa: change dsa_ptr for a dsa_master Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-31 20:50 +0200
    Re: [PATCH net-next 3/4] net: dsa: change dsa_ptr for a dsa_master Andrew Lunn <andrew@lunn.ch> - 2017-09-02 17:40 +0200
  Re: [PATCH net-next 0/4] net: dsa: add master interface Florian Fainelli <f.fainelli@gmail.com> - 2017-09-02 18:50 +0200

csiph-web