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: <2e11014d-2782-4533-91a4-ff952077f042@redhat.com>
Date: Tue, 18 Nov 2025 12:07:06 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Alexander Duyck <alexander.duyck@...il.com>, netdev@...r.kernel.org
Cc: kuba@...nel.org, kernel-team@...a.com, andrew+netdev@...n.ch,
 hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net
Subject: Re: [net-next PATCH v4 07/10] fbnic: Add logic to track PMD state via
 MAC/PCS signals

On 11/13/25 5:33 PM, Alexander Duyck wrote:
> +/**
> + * fbnic_phylink_pmd_training_complete_notify - PMD training complete notifier
> + * @netdev: Netdev struct phylink device attached to
> + *
> + * When the link first comes up the PMD will have a period of 2 to 3 seconds
> + * where the link will flutter due to link training. To avoid spamming the
> + * kernel log with messages about this we add a delay of 4 seconds from the
> + * time of the last PCS report of link so that we can guarantee we are unlikely
> + * to see any further link loss events due to link training.
> + **/
> +void fbnic_phylink_pmd_training_complete_notify(struct net_device *netdev)
> +{
> +	struct fbnic_net *fbn = netdev_priv(netdev);
> +	struct fbnic_dev *fbd = fbn->fbd;
> +
> +	if (fbd->pmd_state != FBNIC_PMD_TRAINING)
> +		return;
> +
> +	if (!time_before(fbd->end_of_pmd_training, jiffies))
> +		return;
> +
> +	fbd->pmd_state = FBNIC_PMD_SEND_DATA;
> +
> +	phylink_pcs_change(&fbn->phylink_pcs, false);

AFAICS the above runs with no lock and can race with
pcs_get_state()/fbnic_pmd_update_state(). Is there some logic safeguard
logic I'm missing? Why 'pmd_state' does not need ONCE annotation?

Thanks,

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ