netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/9] net: dsa: define port types
@ 2017-10-26 15:22 Vivien Didelot
  2017-10-26 15:22 ` [PATCH net-next 1/9] net: dsa: add dsa_is_unused_port helper Vivien Didelot
                   ` (9 more replies)
  0 siblings, 10 replies; 18+ messages in thread
From: Vivien Didelot @ 2017-10-26 15:22 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
	Andrew Lunn, Vivien Didelot

The DSA code currently has 3 bitmaps in the dsa_switch structure:
cpu_port_mask, dsa_port_mask and enabled_port_mask.

They are used to store the type of each switch port. This dates back
from when DSA didn't have a dsa_port structure to hold port-specific
data.

The dsa_switch structure is mainly used to communicate with DSA drivers
and must not contain such static data parsed from DTS or pdata, which
belongs the DSA core structures, such as dsa_switch_tree and dsa_port.

Also the enabled_port_mask is misleading, often misinterpreted as the
complement of disabled ports (thus including DSA and CPU ports), while
in fact it only masks the user ports.

A port can be of 3 types when it is not unused: "cpu" (interfacing with
a master device), "dsa" (interconnecting with another "dsa" port from
another switch chip), or "user" (user-facing port.)

This patchset first fixes the usage of DSA port type helpers, then
defines the DSA_PORT_TYPE_UNUSED, DSA_PORT_TYPE_CPU, DSA_PORT_TYPE_DSA,
and DSA_PORT_TYPE_USER port types, and finally removes the misleading
port bitmaps.

Vivien Didelot (9):
  net: dsa: add dsa_is_unused_port helper
  net: dsa: mv88e6xxx: skip unused ports
  net: dsa: fix dsa_is_normal_port helper
  net: dsa: rename dsa_is_normal_port helper
  net: dsa: use dsa_is_user_port everywhere
  net: dsa: introduce dsa_user_ports helper
  net: dsa: define port types
  net: dsa: use new port type in helpers
  net: dsa: remove port masks

 drivers/net/dsa/b53/b53_common.c |  2 +-
 drivers/net/dsa/bcm_sf2.c        |  9 ++++-----
 drivers/net/dsa/bcm_sf2_cfp.c    |  2 +-
 drivers/net/dsa/mt7530.c         |  6 +++---
 drivers/net/dsa/mv88e6060.c      |  5 ++---
 drivers/net/dsa/mv88e6xxx/chip.c |  5 ++++-
 drivers/net/dsa/qca8k.c          |  7 +++----
 include/net/dsa.h                | 39 ++++++++++++++++++++++++++++++---------
 net/dsa/dsa.c                    |  2 +-
 net/dsa/dsa2.c                   | 16 ++++------------
 net/dsa/legacy.c                 | 15 +++++++++------
 11 files changed, 62 insertions(+), 46 deletions(-)

-- 
2.14.3

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

end of thread, other threads:[~2017-10-27 15:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-26 15:22 [PATCH net-next 0/9] net: dsa: define port types Vivien Didelot
2017-10-26 15:22 ` [PATCH net-next 1/9] net: dsa: add dsa_is_unused_port helper Vivien Didelot
2017-10-26 23:07   ` Florian Fainelli
2017-10-26 15:22 ` [PATCH net-next 2/9] net: dsa: mv88e6xxx: skip unused ports Vivien Didelot
2017-10-26 23:08   ` Florian Fainelli
2017-10-26 15:22 ` [PATCH net-next 3/9] net: dsa: fix dsa_is_normal_port helper Vivien Didelot
2017-10-26 23:08   ` Florian Fainelli
2017-10-26 15:22 ` [PATCH net-next 4/9] net: dsa: rename " Vivien Didelot
2017-10-26 23:09   ` Florian Fainelli
2017-10-26 15:22 ` [PATCH net-next 5/9] net: dsa: use dsa_is_user_port everywhere Vivien Didelot
2017-10-27  0:15   ` Florian Fainelli
2017-10-26 15:22 ` [PATCH net-next 6/9] net: dsa: introduce dsa_user_ports helper Vivien Didelot
2017-10-26 15:22 ` [PATCH net-next 7/9] net: dsa: define port types Vivien Didelot
2017-10-26 15:36   ` Jiri Pirko
2017-10-26 15:39     ` Vivien Didelot
2017-10-26 15:22 ` [PATCH net-next 8/9] net: dsa: use new port type in helpers Vivien Didelot
2017-10-26 15:22 ` [PATCH net-next 9/9] net: dsa: remove port masks Vivien Didelot
2017-10-27 15:00 ` [PATCH net-next 0/9] net: dsa: define port types David Miller

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