netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tobias Waldekranz <tobias@waldekranz.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>, netdev@vger.kernel.org
Cc: "Florian Fainelli" <f.fainelli@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>
Subject: Re: [RFC PATCH net-next 6/6] net: dsa: eliminate dsa_switch_ops :: port_bridge_tx_fwd_{,un}offload
Date: Fri, 19 Nov 2021 16:38:58 +0100	[thread overview]
Message-ID: <878rxkjgtp.fsf@waldekranz.com> (raw)
In-Reply-To: <20211026162625.1385035-7-vladimir.oltean@nxp.com>

On Tue, Oct 26, 2021 at 19:26, Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> We don't really need new switch API for these, and with new switches
> which intend to add support for this feature, it will become cumbersome
> to maintain.
>
> Simply pass a boolean argument to ->port_bridge_join which the driver
> must set to true if it implements the TX forwarding offload feature.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
>  drivers/net/dsa/b53/b53_common.c       |  3 +-
>  drivers/net/dsa/b53/b53_priv.h         |  3 +-
>  drivers/net/dsa/dsa_loop.c             |  3 +-
>  drivers/net/dsa/hirschmann/hellcreek.c |  3 +-
>  drivers/net/dsa/lan9303-core.c         |  3 +-
>  drivers/net/dsa/lantiq_gswip.c         |  3 +-
>  drivers/net/dsa/microchip/ksz_common.c |  3 +-
>  drivers/net/dsa/microchip/ksz_common.h |  2 +-
>  drivers/net/dsa/mt7530.c               |  2 +-
>  drivers/net/dsa/mv88e6xxx/chip.c       | 71 ++++++++++++--------------
>  drivers/net/dsa/ocelot/felix.c         |  2 +-
>  drivers/net/dsa/qca8k.c                |  3 +-
>  drivers/net/dsa/rtl8366rb.c            |  3 +-
>  drivers/net/dsa/sja1105/sja1105_main.c | 22 ++++++--
>  drivers/net/dsa/xrs700x/xrs700x.c      |  2 +-
>  include/net/dsa.h                      | 10 ++--
>  net/dsa/dsa_priv.h                     |  1 +
>  net/dsa/port.c                         | 39 ++------------
>  net/dsa/switch.c                       |  3 +-
>  19 files changed, 81 insertions(+), 100 deletions(-)
>
...
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 73613a667f6c..0aac71dece29 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -2448,8 +2448,27 @@ static int mv88e6xxx_bridge_map(struct mv88e6xxx_chip *chip,
>  	return 0;
>  }
>  
> +/* Treat the software bridge as a virtual single-port switch behind the
> + * CPU and map in the PVT. First dst->last_switch elements are taken by
> + * physical switches, so start from beyond that range.
> + */
> +static int mv88e6xxx_map_virtual_bridge_to_pvt(struct dsa_switch *ds,
> +					       unsigned int bridge_num)
> +{
> +	u8 dev = bridge_num + ds->dst->last_switch;
> +	struct mv88e6xxx_chip *chip = ds->priv;
> +	int err;
> +
> +	mv88e6xxx_reg_lock(chip);

This deadlocks every time. The caller already holds this lock from both
call sites.

> +	err = mv88e6xxx_pvt_map(chip, dev, 0);
> +	mv88e6xxx_reg_unlock(chip);
> +
> +	return err;
> +}
> +
...

  parent reply	other threads:[~2021-11-19 15:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 16:26 [RFC PATCH net-next 0/6] Rework DSA bridge TX forwarding offload API Vladimir Oltean
2021-10-26 16:26 ` [RFC PATCH net-next 1/6] net: dsa: make dp->bridge_num one-based Vladimir Oltean
2021-11-11 12:24   ` Alvin Šipraga
2021-11-11 12:45     ` Vladimir Oltean
2021-11-11 13:18       ` Alvin Šipraga
2021-10-26 16:26 ` [RFC PATCH net-next 2/6] net: dsa: assign a bridge number even without TX forwarding offload Vladimir Oltean
2021-11-11 12:27   ` Alvin Šipraga
2021-10-26 16:26 ` [RFC PATCH net-next 3/6] net: dsa: hide dp->bridge_dev and dp->bridge_num behind helpers Vladimir Oltean
2021-10-26 16:26 ` [RFC PATCH net-next 4/6] net: dsa: rename dsa_port_offloads_bridge to dsa_port_offloads_bridge_dev Vladimir Oltean
2021-11-11 12:33   ` Alvin Šipraga
2021-10-26 16:26 ` [RFC PATCH net-next 5/6] net: dsa: keep the bridge_dev and bridge_num as part of the same structure Vladimir Oltean
2021-11-11 13:17   ` Alvin Šipraga
2021-10-26 16:26 ` [RFC PATCH net-next 6/6] net: dsa: eliminate dsa_switch_ops :: port_bridge_tx_fwd_{,un}offload Vladimir Oltean
2021-11-11 13:23   ` Alvin Šipraga
2021-11-19 15:38   ` Tobias Waldekranz [this message]
2021-11-02 10:07 ` [RFC PATCH net-next 0/6] Rework DSA bridge TX forwarding offload API Vladimir Oltean
2021-11-04 11:39   ` Tobias Waldekranz

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=878rxkjgtp.fsf@waldekranz.com \
    --to=tobias@waldekranz.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=dqfext@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.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;
as well as URLs for NNTP newsgroup(s).