From: Vladimir Oltean <olteanv@gmail.com>
To: Mattias Forsblad <mattias.forsblad@gmail.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Tobias Waldekranz <tobias@waldekranz.com>
Subject: Re: [PATCH v3 net-next 2/2] net: dsa: Implement tc offloading for drop target.
Date: Thu, 7 Apr 2022 02:14:18 +0300 [thread overview]
Message-ID: <20220406231418.sx2gybx5tbnp5iet@skbuf> (raw)
In-Reply-To: <20220404104826.1902292-3-mattias.forsblad@gmail.com>
Again, please use an adequate commit prefix. In this case that is
"net: dsa: mv88e6xxx: ".
On Mon, Apr 04, 2022 at 12:48:26PM +0200, Mattias Forsblad wrote:
> Add the ability to handle tc matchall drop HW offloading for Marvell
> switches.
>
> Signed-off-by: Mattias Forsblad <mattias.forsblad@gmail.com>
> ---
> drivers/net/dsa/mv88e6xxx/chip.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 64f4fdd02902..84e319520d36 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -1436,7 +1436,7 @@ static u16 mv88e6xxx_port_vlan(struct mv88e6xxx_chip *chip, int dev, int port)
> * bridge group.
> */
> dsa_switch_for_each_port(other_dp, ds)
> - if (other_dp->type == DSA_PORT_TYPE_CPU ||
> + if ((other_dp->type == DSA_PORT_TYPE_CPU && dp->bridge->local_rcv_effective) ||
In the light of the idea that we should keep dsa_bridge :: have_foreign
an independent variable, maybe there should be a static inline
dsa_bridge_local_rcv(const struct dsa_bridge *bridge) helper which
returns bridge->have_foreign || bridge->local_rcv. Then you could use
that here.
Also note that said dsa_bridge_local_rcv() function returns a loop
invariant, so you should consider caching the result before using it in
dsa_switch_for_each_port().
> other_dp->type == DSA_PORT_TYPE_DSA ||
> dsa_port_bridge_same(dp, other_dp))
> pvlan |= BIT(other_dp->index);
> @@ -6439,6 +6439,26 @@ static void mv88e6xxx_port_mirror_del(struct dsa_switch *ds, int port,
> mutex_unlock(&chip->reg_lock);
> }
>
> +static int mv88e6xxx_bridge_local_rcv(struct dsa_switch *ds, int port,
> + struct dsa_mall_drop_tc_entry *drop)
I think you should ask yourself some questions about passing the "drop"
argument to ->bridge_local_rcv then never using it...
> +{
> + struct mv88e6xxx_chip *chip = ds->priv;
> + struct dsa_port *dp;
> + int err;
> +
> + dp = dsa_to_port(ds, port);
> + if (!dp)
> + return -EINVAL;
> +
> + mutex_lock(&chip->reg_lock);
> +
> + err = mv88e6xxx_bridge_map(chip, *dp->bridge);
> +
> + mutex_unlock(&chip->reg_lock);
> +
> + return err;
> +}
> +
> static int mv88e6xxx_port_pre_bridge_flags(struct dsa_switch *ds, int port,
> struct switchdev_brport_flags flags,
> struct netlink_ext_ack *extack)
> @@ -6837,6 +6857,7 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
> .port_mdb_del = mv88e6xxx_port_mdb_del,
> .port_mirror_add = mv88e6xxx_port_mirror_add,
> .port_mirror_del = mv88e6xxx_port_mirror_del,
> + .bridge_local_rcv = mv88e6xxx_bridge_local_rcv,
> .crosschip_bridge_join = mv88e6xxx_crosschip_bridge_join,
> .crosschip_bridge_leave = mv88e6xxx_crosschip_bridge_leave,
> .port_hwtstamp_set = mv88e6xxx_port_hwtstamp_set,
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-04-06 23:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-04 10:48 [PATCH v3 net-next 0/2] net: tc: dsa: Implement offload of matchall for bridged DSA ports Mattias Forsblad
2022-04-04 10:48 ` [PATCH v3 net-next 1/2] net: tc: dsa: Add the matchall filter with drop action " Mattias Forsblad
2022-04-06 23:01 ` Vladimir Oltean
2022-04-07 14:32 ` Vladimir Oltean
2022-04-04 10:48 ` [PATCH v3 net-next 2/2] net: dsa: Implement tc offloading for drop target Mattias Forsblad
2022-04-06 23:14 ` Vladimir Oltean [this message]
2022-04-06 1:09 ` [PATCH v3 net-next 0/2] net: tc: dsa: Implement offload of matchall for bridged DSA ports Jakub Kicinski
2022-04-06 9:24 ` Mattias Forsblad
2022-04-06 11:58 ` Mattias Forsblad
2022-04-06 17:31 ` Jakub Kicinski
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=20220406231418.sx2gybx5tbnp5iet@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=mattias.forsblad@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tobias@waldekranz.com \
--cc=vivien.didelot@gmail.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