linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH v2 0/4] Reduce qca8k_priv space usage
@ 2022-04-12 17:30 Ansuel Smith
  2022-04-12 17:30 ` [net-next PATCH v2 1/4] drivers: net: dsa: qca8k: drop MTU tracking from qca8k_priv Ansuel Smith
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Ansuel Smith @ 2022-04-12 17:30 UTC (permalink / raw)
  To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Vladimir Oltean,
	David S. Miller, Jakub Kicinski, Paolo Abeni, netdev,
	linux-kernel
  Cc: Ansuel Smith

These 4 patch is a first attempt at reducting qca8k_priv space.
The code changed a lot during times and we have many old logic
that can be replaced with new implementation

The first patch drop the tracking of MTU. We mimic what was done
for mtk and we change MTU only when CPU port is changed.

The second patch finally drop a piece of story of this driver.
The ar8xxx_port_status struct was used by the first implementation
of this driver to put all sort of status data for the port...
With the evolution of DSA all that stuff got dropped till only
the enabled state was the only part of the that struct.
Since it's overkill to keep an array of int, we convert the variable
to a simple u8 where we store the status of each port. This is needed
to don't reanable ports on system resume.

The third patch is a preparation for patch 4. As Vladimir explained
in another patch, we waste a tons of space by keeping a duplicate of
the switch dsa ops in qca8k_priv. The only reason for this is to
dynamically set the correct mdiobus configuration (a legacy dsa one,
or a custom dedicated one)
To solve this problem, we just drop the phy_read/phy_write and we
declare a custom mdiobus in any case. 
This way we can use a static dsa switch ops struct and we can drop it
from qca8k_priv

Patch 4 finally drop the duplicated dsa_switch_ops.

This series is just a start of more cleanup.

The idea is to move this driver to the qca dir and split common code
from specific code. Also the mgmt eth code still requires some love
and can totally be optimized by recycling the same skb over time.

Also while working on the MTU it was notice some problem with
the stmmac driver and with the reloading phase that cause all
sort of problems with qca8k.

I'm sending this here just to try to keep small series instead of
proposing monster series hard to review.

v2:
- Rework MTU patch

Ansuel Smith (4):
  drivers: net: dsa: qca8k: drop MTU tracking from qca8k_priv
  drivers: net: dsa: qca8k: drop port_sts from qca8k_priv
  drivers: net: dsa: qca8k: rework and simplify mdiobus logic
  drivers: net: dsa: qca8k: drop dsa_switch_ops from qca8k_priv

 drivers/net/dsa/qca8k.c | 144 +++++++++++++++-------------------------
 drivers/net/dsa/qca8k.h |  12 ++--
 2 files changed, 56 insertions(+), 100 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-04-16 19:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 17:30 [net-next PATCH v2 0/4] Reduce qca8k_priv space usage Ansuel Smith
2022-04-12 17:30 ` [net-next PATCH v2 1/4] drivers: net: dsa: qca8k: drop MTU tracking from qca8k_priv Ansuel Smith
2022-04-14 13:42   ` Paolo Abeni
2022-04-14 13:48   ` Vladimir Oltean
2022-04-16 19:30   ` Florian Fainelli
2022-04-12 17:30 ` [net-next PATCH v2 2/4] drivers: net: dsa: qca8k: drop port_sts " Ansuel Smith
2022-04-14 13:49   ` Vladimir Oltean
2022-04-16 19:30   ` Florian Fainelli
2022-04-12 17:30 ` [net-next PATCH v2 3/4] drivers: net: dsa: qca8k: rework and simplify mdiobus logic Ansuel Smith
2022-04-14 14:08   ` Vladimir Oltean
2022-04-16 14:31     ` Andrew Lunn
2022-04-12 17:30 ` [net-next PATCH v2 4/4] drivers: net: dsa: qca8k: drop dsa_switch_ops from qca8k_priv Ansuel Smith
2022-04-14 14:09   ` Vladimir Oltean
2022-04-16 19:30   ` Florian Fainelli

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).