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: <20230123112411.ofw6cx3qv6uh4txi@skbuf>
Date:   Mon, 23 Jan 2023 13:24:11 +0200
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Simon Horman <simon.horman@...igine.com>
Cc:     netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        Xiaoliang Yang <xiaoliang.yang_1@....com>
Subject: Re: [PATCH net-next 3/6] net: enetc: add definition for offset
 between eMAC and pMAC regs

On Sun, Jan 22, 2023 at 05:29:33PM +0100, Simon Horman wrote:
> > +#define ENETC_PMAC_OFFSET	0x1000
> > +
> >  #define ENETC_PM0_CMD_CFG	0x8008
> >  #define ENETC_PM1_CMD_CFG	0x9008
> >  #define ENETC_PM0_TX_EN		BIT(0)
> > @@ -280,57 +282,57 @@ enum enetc_bdr_type {TX, RX};
> >  /* Port MAC counters: Port MAC 0 corresponds to the eMAC and
> >   * Port MAC 1 to the pMAC.
> >   */
> > -#define ENETC_PM_REOCT(mac)	(0x8100 + 0x1000 * (mac))
> > -#define ENETC_PM_RALN(mac)	(0x8110 + 0x1000 * (mac))
> 
> ...
> 
> > +#define ENETC_PM_REOCT(mac)	(0x8100 + ENETC_PMAC_OFFSET * (mac))
> > +#define ENETC_PM_RALN(mac)	(0x8110 + ENETC_PMAC_OFFSET * (mac))
> 
> I'm not sure if it is an improvement, but did you consider something
> like this? *completely untested*
> 
> #define ENETC_PM(mac, reg)	((reg) + ENETC_PMAC_OFFSET * (mac))
> #define ENETC_PM_REOCT(mac)	ENETC_PM(mac, 0x8100)
> #define ENETC_PM_RALN(mac)	ENETC_PM(mac, 0x8110)

Hmm, I appreciate you looking at the patch, but in the end, I just
consider your proposed alternative to be a variation on the same theme,
and not necessarily a better way of expressing the definitions.
This means I wouldn't consider resending the patch set just to make this
change.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ