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: <d62e6d74-8906-74c6-7389-594f656df9e9@oss.nxp.com>
Date:   Fri, 25 Aug 2023 17:22:18 +0300
From:   "Radu Pirea (OSS)" <radu-nicolae.pirea@....nxp.com>
To:     Sabrina Dubroca <sd@...asysnail.net>
Cc:     andrew@...n.ch, hkallweit1@...il.com, linux@...linux.org.uk,
        davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, richardcochran@...il.com,
        sebastian.tobuschat@....com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC net-next v2 4/5] net: phy: nxp-c45-tja11xx: add MACsec
 statistics



On 25.08.2023 16:41, Sabrina Dubroca wrote:
> 2023-08-24, 12:16:14 +0300, Radu Pirea (NXP OSS) wrote:
>> @@ -1323,8 +1469,10 @@ static int nxp_c45_mdo_del_txsa(struct macsec_context *ctx)
>>   
>>   	nxp_c45_select_secy(phydev, phy_secy->secy_id);
>>   
>> -	if (tx_sa->is_enabled)
>> +	if (tx_sa->is_enabled) {
>>   		nxp_c45_update_key_status(phydev, tx_sa);
>> +		nxp_c45_tx_sa_stats_clear(phydev, tx_sa);
> 
> If the TXSA was already disabled (via mdo_upd_txsa), don't you need to
> clear the stats as well?

Yes, I will clear them.

> 
> [...]
>> +static int nxp_c45_mdo_get_tx_sc_stats(struct macsec_context *ctx)
>> +{
> [...]
>> +	nxp_c45_macsec_read(phydev, MACSEC_OOE1HS, &reg);
>> +	stat = (u64)reg << 32;
>> +	nxp_c45_macsec_read(phydev, MACSEC_OOE2HS, &reg);
>> +	stat |= reg;
>> +	if (ctx->secy->tx_sc.encrypt)
>> +		tx_sc_stats->OutOctetsEncrypted = stat;
>> +	else
>> +		tx_sc_stats->OutOctetsEncrypted = 0;
>> +
>> +	if (ctx->secy->protect_frames)
>> +		tx_sc_stats->OutOctetsProtected = stat;
>> +	else
>> +		tx_sc_stats->OutOctetsProtected = 0;
> 
> This doesn't look consistent with macsec_count_tx
> (drivers/net/macsec.c).

Actually OutOctetsProtected register is not read from the hardware.

-- 
Radu P.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ