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] [day] [month] [year] [list]
Message-ID: <6d9955ea-29c2-4df1-9618-b10e9185230b@linux.dev>
Date: Thu, 22 May 2025 11:14:53 -0400
From: Sean Anderson <sean.anderson@...ux.dev>
To: Lei Wei <quic_leiwei@...cinc.com>, netdev@...r.kernel.org,
 Andrew Lunn <andrew+netdev@...n.ch>, "David S . Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Russell King <linux@...linux.org.uk>
Cc: upstream@...oha.com, Kory Maincent <kory.maincent@...tlin.com>,
 Simon Horman <horms@...nel.org>, Christian Marangi <ansuelsmth@...il.com>,
 linux-kernel@...r.kernel.org, Heiner Kallweit <hkallweit1@...il.com>,
 Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org
Subject: Re: [net-next PATCH v4 03/11] net: pcs: Add subsystem

On 5/21/25 08:50, Lei Wei wrote:
> 
> 
> On 5/20/2025 1:43 AM, Sean Anderson wrote:
>> On 5/14/25 12:22, Lei Wei wrote:
>>>
>>>
>>> On 5/13/2025 12:10 AM, Sean Anderson wrote:
>>>> +/**
>>>> + * pcs_register_full() - register a new PCS
>>>> + * @dev: The device requesting the PCS
>>>> + * @fwnode: The PCS's firmware node; typically @dev.fwnode
>>>> + * @pcs: The PCS to register
>>>> + *
>>>> + * Registers a new PCS which can be attached to a phylink.
>>>> + *
>>>> + * Return: 0 on success, or -errno on error
>>>> + */
>>>> +int pcs_register_full(struct device *dev, struct fwnode_handle *fwnode,
>>>> +              struct phylink_pcs *pcs)
>>>> +{
>>>> +    struct pcs_wrapper *wrapper;
>>>> +
>>>> +    if (!dev || !pcs->ops)
>>>> +        return -EINVAL;
>>>> +
>>>> +    if (!pcs->ops->pcs_an_restart || !pcs->ops->pcs_config ||
>>>> +        !pcs->ops->pcs_get_state)
>>>> +        return -EINVAL;
>>>> +
>>>> +    wrapper = kzalloc(sizeof(*wrapper), GFP_KERNEL);
>>>> +    if (!wrapper)
>>>> +        return -ENOMEM;
>>>
>>> How about the case where pcs is removed and then comes back again? Should we find the original wrapper and attach it to pcs again instead of creating a new wrapper?
>>
>> When the PCS is removed the old wrapper is removed from pcs_wrappers, so
>> it can no longer be looked up any more. I think trying to save/restore
>> the wrapper would be much more trouble than it's worth.
>>
> 
> In the case where Ethernet is not removed but PCS is removed and then
> comes back (when the sysfs unbind followed by bind method is used),
> it will not work because the Ethernet probe will not be initiated again, to call "pcs_get" again to obtain the new wrapper, it would still hold the old wrapper.

Correct. You must then unbind/bind the MAC.

--Sean


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ