netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org, andrew@lunn.ch, vivien.didelot@gmail.com,
	antoine.tenart@bootlin.com, alexandre.belloni@bootlin.com,
	UNGLinuxDriver@microchip.com, alexandru.marginean@nxp.com,
	claudiu.manoil@nxp.com, madalin.bucur@oss.nxp.com,
	radu-andrei.bulie@nxp.com, fido_max@inbox.ru, broonie@kernel.org
Subject: Re: [PATCH v2 net-next 06/13] net: dsa: felix: create a template for the DSA tags on xmit
Date: Sat, 30 May 2020 14:31:35 -0700	[thread overview]
Message-ID: <3ecbfe12-e4da-238e-b999-36fd91a2de5b@gmail.com> (raw)
In-Reply-To: <20200530115142.707415-7-olteanv@gmail.com>



On 5/30/2020 4:51 AM, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> With this patch we try to kill 2 birds with 1 stone.
> 
> First of all, some switches that use tag_ocelot.c don't have the exact
> same bitfield layout for the DSA tags. The destination ports field is
> different for Seville VSC9953 for example. So the choices are to either
> duplicate tag_ocelot.c into a new tag_seville.c (sub-optimal) or somehow
> take into account a supposed ocelot->dest_ports_offset when packing this
> field into the DSA injection header (again not ideal).
> 
> Secondly, tag_ocelot.c already needs to memset a 128-bit area to zero
> and call some packing() functions of dubious performance in the
> fastpath. And most of the values it needs to pack are pretty much
> constant (BYPASS=1, SRC_PORT=CPU, DEST=port index). So it would be good
> if we could improve that.
> 
> The proposed solution is to allocate a memory area per port at probe
> time, initialize that with the statically defined bits as per chip
> hardware revision, and just perform a simpler memcpy in the fastpath.
> 
> Other alternatives have been analyzed, such as:
> - Create a separate tag_seville.c: too much code duplication for just 1
>   bit field difference.

If this is really the only difference, we could have added a device ID
or something that would allow tag_ocelot.c to differentiate Seville from
Felix and just have a conditional for using the right definition.

The solution proposed here is okay and scales beyond a single bit field
difference. Maybe this will open up the door for consolidating the
various Microchip KSZ tag implementations at some point.

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

  reply	other threads:[~2020-05-30 21:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 11:51 [PATCH v2 net-next 00/13] New DSA driver for VSC9953 Seville switch Vladimir Oltean
2020-05-30 11:51 ` [PATCH v2 net-next 01/13] regmap: add helper for per-port regfield initialization Vladimir Oltean
2020-05-30 11:51 ` [PATCH v2 net-next 02/13] net: dsa: felix: set proper link speed in felix_phylink_mac_config Vladimir Oltean
2020-05-30 20:43   ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 03/13] net: mscc: ocelot: convert port registers to regmap Vladimir Oltean
2020-05-30 20:45   ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 04/13] soc/mscc: ocelot: add MII registers description Vladimir Oltean
2020-05-30 20:46   ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 05/13] net: mscc: ocelot: convert QSYS_SWITCH_PORT_MODE and SYS_PORT_MODE to regfields Vladimir Oltean
2020-05-30 21:18   ` Florian Fainelli
2020-05-30 21:25     ` Vladimir Oltean
2020-05-30 21:34       ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 06/13] net: dsa: felix: create a template for the DSA tags on xmit Vladimir Oltean
2020-05-30 21:31   ` Florian Fainelli [this message]
2020-05-30 21:39     ` Vladimir Oltean
2020-05-30 11:51 ` [PATCH v2 net-next 07/13] net: mscc: ocelot: split writes to pause frame enable bit and to thresholds Vladimir Oltean
2020-05-30 20:59   ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 08/13] net: mscc: ocelot: disable flow control on NPI interface Vladimir Oltean
2020-05-30 20:58   ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 09/13] net: mscc: ocelot: convert SYS_PAUSE_CFG register access to regfield Vladimir Oltean
2020-05-30 20:57   ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 10/13] net: mscc: ocelot: extend watermark encoding function Vladimir Oltean
2020-05-30 20:58   ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 11/13] net: dsa: felix: support half-duplex link modes Vladimir Oltean
2020-05-30 20:50   ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 12/13] net: dsa: felix: move probing to felix_vsc9959.c Vladimir Oltean
2020-05-30 21:34   ` Florian Fainelli
2020-05-30 11:51 ` [PATCH v2 net-next 13/13] net: dsa: felix: introduce support for Seville VSC9953 switch Vladimir Oltean
2020-05-30 20:55   ` Florian Fainelli
2020-05-31  1:03 ` [PATCH v2 net-next 00/13] New DSA driver for VSC9953 Seville switch David Miller
2020-05-31  1:08   ` David Miller

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=3ecbfe12-e4da-238e-b999-36fd91a2de5b@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandru.marginean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=antoine.tenart@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=fido_max@inbox.ru \
    --cc=madalin.bucur@oss.nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=radu-andrei.bulie@nxp.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;
as well as URLs for NNTP newsgroup(s).