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: <964739eb70dcd58153d8548f7b57719b@0leil.net>
Date:   Sun, 21 Jun 2020 17:38:42 +0200
From:   Quentin Schulz <foss@...il.net>
To:     Antoine Tenart <antoine.tenart@...tlin.com>
Cc:     davem@...emloft.net, andrew@...n.ch, f.fainelli@...il.com,
        hkallweit1@...il.com, richardcochran@...il.com,
        alexandre.belloni@...tlin.com, UNGLinuxDriver@...rochip.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        thomas.petazzoni@...tlin.com, allan.nielsen@...rochip.com
Subject: Re: [PATCH net-next v3 4/8] net: phy: mscc: take into account the
 1588 block in MACsec init

Hi Antoine,

On 2020-06-19 14:22, Antoine Tenart wrote:
> This patch takes in account the use of the 1588 block in the MACsec
> initialization, as a conditional configuration has to be done (when the
> 1588 block is used).
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@...tlin.com>
> ---
>  drivers/net/phy/mscc/mscc_macsec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/mscc/mscc_macsec.c
> b/drivers/net/phy/mscc/mscc_macsec.c
> index c0eeb62cb940..713c62b1d1f0 100644
> --- a/drivers/net/phy/mscc/mscc_macsec.c
> +++ b/drivers/net/phy/mscc/mscc_macsec.c
> @@ -285,7 +285,9 @@ static void vsc8584_macsec_mac_init(struct
> phy_device *phydev,
>  				 MSCC_MAC_CFG_PKTINF_CFG_STRIP_PREAMBLE_ENA |
>  				 MSCC_MAC_CFG_PKTINF_CFG_INSERT_PREAMBLE_ENA |
>  				 (bank == HOST_MAC ?
> -				  MSCC_MAC_CFG_PKTINF_CFG_ENABLE_TX_PADDING : 0));
> +				  MSCC_MAC_CFG_PKTINF_CFG_ENABLE_TX_PADDING : 0) |
> +				 (IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING) ?
> +				  MSCC_MAC_CFG_PKTINF_CFG_MACSEC_BYPASS_NUM_PTP_STALL_CLKS(0x8) : 
> 0));

Do we have more info on this 0x8? Where does it come from? What does it 
mean?

Also this starts to get a little bit hard to read. Would it make sense 
to have
two temp variables? e.g.:

	padding = bank == HOST_MAC ? MSCC_MAC_CFG_PKTINF_CFG_ENABLE_TX_PADDING 
: 0;
	ptp_stall_clks = IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING) ?
		MSCC_MAC_CFG_PKTINF_CFG_MACSEC_BYPASS_NUM_PTP_STALL_CLKS(0x8) : 0;

	vsc8584_macsec_phy_write(phydev, bank, MSCC_MAC_CFG_PKTINF_CFG,
				 MSCC_MAC_CFG_PKTINF_CFG_STRIP_FCS_ENA |
				 MSCC_MAC_CFG_PKTINF_CFG_INSERT_FCS_ENA |
				 MSCC_MAC_CFG_PKTINF_CFG_LPI_RELAY_ENA |
				 MSCC_MAC_CFG_PKTINF_CFG_STRIP_PREAMBLE_ENA |
				 MSCC_MAC_CFG_PKTINF_CFG_INSERT_PREAMBLE_ENA |
				 padding |
				 ptp_stall_clks);

Thanks,
Quentin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ