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 2/8] net: dsa: directly fetch switch in lan9303_rcv
Date: Fri, 29 Sep 2017 12:02:01 -0700 [thread overview]
Message-ID: <e1fcff41-6ee7-e125-c7eb-98f6ba00a62d@gmail.com> (raw)
In-Reply-To: <20170929183635.8122-3-vivien.didelot@savoirfairelinux.com>
On 09/29/2017 11:36 AM, Vivien Didelot wrote:
> In a single-chip switch fabric, there is no need to fetch the dsa_switch
> structure from the tree, directly use the CPU port's "ds" member.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
> net/dsa/tag_lan9303.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c
> index 0b9826105e42..f0b51acf36ac 100644
> --- a/net/dsa/tag_lan9303.c
> +++ b/net/dsa/tag_lan9303.c
> @@ -72,11 +72,10 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
> {
> u16 *lan9303_tag;
> struct dsa_switch_tree *dst = dev->dsa_ptr;
> - struct dsa_switch *ds;
> + struct dsa_port *cpu_dp = dst->cpu_dp;
> + struct dsa_switch *ds = cpu_dp->ds;
> unsigned int source_port;
>
> - ds = dst->ds[0];
> -
> if (unlikely(!ds)) {
> dev_warn_ratelimited(&dev->dev, "Dropping packet, due to missing DSA switch device\n");
> return NULL;
Similarly to the patch before, you can probably drop this test, I don't
actually see how we could trigger it.
--
Florian
next prev parent reply other threads:[~2017-09-29 19:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 18:36 [PATCH net-next 0/8] net: dsa: change dsa_ptr for a dsa_port Vivien Didelot
2017-09-29 18:36 ` [PATCH net-next 1/8] net: dsa: directly fetch switch in mtk_tag_rcv Vivien Didelot
2017-09-29 19:21 ` Florian Fainelli
2017-09-29 18:36 ` [PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv Vivien Didelot
2017-09-29 19:02 ` Florian Fainelli [this message]
2017-09-29 19:04 ` Vivien Didelot
2017-09-29 18:36 ` [PATCH net-next 3/8] net: dsa: use cpu_dp in master code Vivien Didelot
2017-09-29 19:10 ` Florian Fainelli
2017-09-29 18:36 ` [PATCH net-next 4/8] net: dsa: use temporary dsa_device_ops variable Vivien Didelot
2017-09-29 19:11 ` Florian Fainelli
2017-09-29 18:36 ` [PATCH net-next 5/8] net: dsa: add tagging ops to port Vivien Didelot
2017-09-29 19:12 ` Florian Fainelli
2017-09-29 19:24 ` Florian Fainelli
2017-09-29 18:36 ` [PATCH net-next 6/8] net: dsa: prepare master receive hot path Vivien Didelot
2017-09-29 19:14 ` Florian Fainelli
2017-09-29 18:36 ` [PATCH net-next 7/8] net: dsa: change dsa_ptr for a dsa_port Vivien Didelot
2017-09-29 19:20 ` Florian Fainelli
2017-09-29 18:36 ` [PATCH net-next 8/8] net: dsa: remove tag ops from the switch tree Vivien Didelot
2017-09-29 19:20 ` Florian Fainelli
2017-09-29 19:26 ` [PATCH net-next 0/8] net: dsa: change dsa_ptr for a dsa_port Florian Fainelli
2017-09-29 19:34 ` 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=e1fcff41-6ee7-e125-c7eb-98f6ba00a62d@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 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.