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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240910130321.337154-3-alexander.sverdlin@siemens.com>
Date: Tue, 10 Sep 2024 15:03:16 +0200
From: "A. Sverdlin" <alexander.sverdlin@...mens.com>
To: netdev@...r.kernel.org
Cc: Alexander Sverdlin <alexander.sverdlin@...mens.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Jonathan Corbet <corbet@....net>,
	Vladimir Oltean <vladimir.oltean@....com>,
	Florian Fainelli <florian.fainelli@...adcom.com>,
	linux-doc@...r.kernel.org
Subject: [PATCH 2/2] docs: net: dsa: RCU protection of dsa_ptr in struct net_device

From: Alexander Sverdlin <alexander.sverdlin@...mens.com>

Mention new netdev_uses_dsa_currently() and use rtnl_dereference() for
dsa_ptr access.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@...mens.com>
---
 Documentation/networking/dsa/dsa.rst | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/Documentation/networking/dsa/dsa.rst b/Documentation/networking/dsa/dsa.rst
index 7b2e69cd7ef0..858c6d2842c4 100644
--- a/Documentation/networking/dsa/dsa.rst
+++ b/Documentation/networking/dsa/dsa.rst
@@ -255,7 +255,7 @@ Conduit network device (e.g.: e1000e):
 2. net/ethernet/eth.c::
 
           eth_type_trans(skb, dev)
-                  if (dev->dsa_ptr != NULL)
+                  if (netdev_uses_dsa_currently(dev))
                           -> skb->protocol = ETH_P_XDSA
 
 3. drivers/net/ethernet/\*::
@@ -656,14 +656,14 @@ Switch configuration
   represents the index of the user port, and the ``conduit`` argument represents
   the new DSA conduit ``net_device``. The CPU port associated with the new
   conduit can be retrieved by looking at ``struct dsa_port *cpu_dp =
-  conduit->dsa_ptr``. Additionally, the conduit can also be a LAG device where
-  all the slave devices are physical DSA conduits. LAG DSA  also have a
-  valid ``conduit->dsa_ptr`` pointer, however this is not unique, but rather a
-  duplicate of the first physical DSA conduit's (LAG slave) ``dsa_ptr``. In case
-  of a LAG DSA conduit, a further call to ``port_lag_join`` will be emitted
-  separately for the physical CPU ports associated with the physical DSA
-  conduits, requesting them to create a hardware LAG associated with the LAG
-  interface.
+  rtnl_dereference(conduit->dsa_ptr)``. Additionally, the conduit can also be a
+  LAG device where all the slave devices are physical DSA conduits. LAG DSA
+  also have a valid ``conduit->dsa_ptr`` pointer, however this is not unique,
+  but rather a duplicate of the first physical DSA conduit's (LAG slave)
+  ``dsa_ptr``. In case of a LAG DSA conduit, a further call to ``port_lag_join``
+  will be emitted separately for the physical CPU ports associated with the
+  physical DSA conduits, requesting them to create a hardware LAG associated
+  with the LAG interface.
 
 PHY devices and link management
 -------------------------------
-- 
2.46.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ