[RFC PATCH net-next 08/11] net: dsa: microchip: lan937x: avoid mib read for cascaded port

Rakesh Sankaranarayanan posted 11 patches 3 years, 2 months ago
[RFC PATCH net-next 08/11] net: dsa: microchip: lan937x: avoid mib read for cascaded port
Posted by Rakesh Sankaranarayanan 3 years, 2 months ago
Cascaded port need not be involved in mib read process. Unlike cpu port,
mib read function will be called for all other ports. Add check to skip
function if port is of type DSA_PORT_TYPE_DSA.

Signed-off-by: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
---
 drivers/net/dsa/microchip/ksz_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 0df71156a540..913296c5dd50 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -2230,7 +2230,8 @@ static void ksz_mib_read_work(struct work_struct *work)
 	int i;
 
 	for (i = 0; i < dev->info->port_cnt; i++) {
-		if (dsa_is_unused_port(dev->ds, i))
+		if (dsa_is_unused_port(dev->ds, i) ||
+		    dsa_is_dsa_port(dev->ds, i))
 			continue;
 
 		p = &dev->ports[i];
-- 
2.34.1
Re: [RFC PATCH net-next 08/11] net: dsa: microchip: lan937x: avoid mib read for cascaded port
Posted by Andrew Lunn 3 years, 2 months ago
On Thu, Feb 02, 2023 at 06:29:27PM +0530, Rakesh Sankaranarayanan wrote:
> Cascaded port need not be involved in mib read process. Unlike cpu port,
> mib read function will be called for all other ports. Add check to skip
> function if port is of type DSA_PORT_TYPE_DSA.

I would actually read the statistics. Having debugged D in DSA
systems, it is useful to know if packets are making it from one switch
to the other, etc.

The problem is getting the information out of the kernel. For
mv88e6xxx we have had an out of tree patch which exposes this
information in debugfs.

	Andrew