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: <20200719211654.hwolppixqqwqz3rx@lion.mk-sys.cz>
Date:   Sun, 19 Jul 2020 23:16:54 +0200
From:   Michal Kubecek <mkubecek@...e.cz>
To:     Chris Healy <cphealy@...il.com>
Cc:     netdev@...r.kernel.org, vivien.didelot@...il.com,
        Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH] ethtool: dsa: mv88e6xxx: add pretty dump for 88E6352
 SERDES

On Thu, Jul 16, 2020 at 10:55:26AM -0700, Chris Healy wrote:
> From: Andrew Lunn <andrew@...n.ch>
> 
> In addition to the port registers, the device can provide the
> SERDES/PCS registers. Dump these, and for a few of the important
> SGMII/1000Base-X registers decode the bits.
> 
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> Signed-off-by: Chris Healy <cphealy@...il.com>
> ---
[...]
> +	case 32 + 0:
> +		REG(reg - 32, "Fiber Control", val);

Could you give these "32" (and similar below) a name?

[...]
> @@ -667,6 +850,17 @@ static int dsa_mv88e6xxx_dump_regs(struct ethtool_regs *regs)
>  		else
>  			REG(i, "", data[i]);
>  
> +	/* Dump the SERDES registers, if provided */
> +	if (regs->len > 32 * 2) {

sizeof(u16) would be easier to read, IMHO

> +		printf("\n%s Switch Port SERDES Registers\n", sw->name);
> +		printf("-------------------------------------\n");
> +		for (i = 32; i < regs->len / 2; i++)
> +			if (sw->dump)
> +				sw->dump(i, data[i]);
> +			else
> +				REG(i, "", data[i]);

In the dump handler above you subtract 32 (offset of SERDES registers,
IIUC) from register number but in the generic branch you don't, this
seems inconsistent.

Michal

> +	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.21.3
> 

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ