lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221027210830.3577793-1-vladimir.oltean@nxp.com>
Date:   Fri, 28 Oct 2022 00:08:27 +0300
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     netdev@...r.kernel.org
Cc:     Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Michael Walle <michael@...le.cc>,
        Heiko Thiery <heiko.thiery@...il.com>
Subject: [RFC PATCH net-next 0/3] Autoload DSA tagging driver when dynamically changing protocol

This patch set solves the issue reported by Michael and Heiko here:
https://lore.kernel.org/lkml/20221027113248.420216-1-michael@walle.cc/
making full use of Michael's suggestion of having two modaliases: one
gets used for loading the tagging protocol when it's the default one
reported by the switch driver, the other gets loaded at user's request,
by name.

  # modinfo tag_ocelot_8021q
  filename:       /lib/modules/6.1.0-rc2+/kernel/net/dsa/tag_ocelot_8021q.ko
  alias:          dsa_tag-ocelot-8021q
  alias:          dsa_tag-20
  license:        GPL v2
  depends:        dsa_core
  intree:         Y
  name:           tag_ocelot_8021q
  vermagic:       6.1.0-rc2+ SMP preempt mod_unload modversions aarch64

Tested on NXP LS1028A-RDB with the following device tree addition:

&mscc_felix_port4 {
	dsa-tag-protocol = "ocelot-8021q";
};

&mscc_felix_port5 {
	dsa-tag-protocol = "ocelot-8021q";
};

CONFIG_NET_DSA and everything that depends on it is built as module.
Everything auto-loads, and "cat /sys/class/net/eno2/dsa/tagging" shows
"ocelot-8021q". Traffic works as well.

Note: I included patch 1/3 because I secretly want to see if the
patchwork build tests pass :) But I also submitted it separately to
"net" already, and without it, patch 3/3 doesn't apply to current net-next.
So if you want to leave comments on 1/3, make sure to leave them here:
https://patchwork.kernel.org/project/netdevbpf/patch/20221027145439.3086017-1-vladimir.oltean@nxp.com/

Vladimir Oltean (3):
  net: dsa: fall back to default tagger if we can't load the one from DT
  net: dsa: provide a second modalias to tag proto drivers based on
    their name
  net: dsa: autoload tag driver module on tagging protocol change

 include/net/dsa.h          |  5 +++--
 net/dsa/dsa.c              |  8 +++++---
 net/dsa/dsa2.c             | 15 +++++++++++----
 net/dsa/dsa_priv.h         |  4 ++--
 net/dsa/master.c           |  4 ++--
 net/dsa/tag_ar9331.c       |  6 ++++--
 net/dsa/tag_brcm.c         | 16 ++++++++++------
 net/dsa/tag_dsa.c          | 11 +++++++----
 net/dsa/tag_gswip.c        |  6 ++++--
 net/dsa/tag_hellcreek.c    |  6 ++++--
 net/dsa/tag_ksz.c          | 21 +++++++++++++--------
 net/dsa/tag_lan9303.c      |  6 ++++--
 net/dsa/tag_mtk.c          |  6 ++++--
 net/dsa/tag_ocelot.c       | 11 +++++++----
 net/dsa/tag_ocelot_8021q.c |  6 ++++--
 net/dsa/tag_qca.c          |  6 ++++--
 net/dsa/tag_rtl4_a.c       |  6 ++++--
 net/dsa/tag_rtl8_4.c       |  7 +++++--
 net/dsa/tag_rzn1_a5psw.c   |  6 ++++--
 net/dsa/tag_sja1105.c      | 11 +++++++----
 net/dsa/tag_trailer.c      |  6 ++++--
 net/dsa/tag_xrs700x.c      |  6 ++++--
 22 files changed, 116 insertions(+), 63 deletions(-)

-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ