Re: [PATCH net-next v2 3/5] net: phy: Add pluming for ethtool_{get,set}_rxnfc

From: Jacob Keller
Date: Fri Oct 27 2023 - 12:57:19 EST




On 10/26/2023 4:32 PM, Florian Fainelli wrote:
> On 10/26/23 16:20, Jacob Keller wrote:
>>
>>
>> On 10/26/2023 3:45 PM, Florian Fainelli wrote:
>>> +EXPORT_SYMBOL(phy_ethtool_set_rxnfc);
>>> diff --git a/include/linux/phy.h b/include/linux/phy.h
>>> index 3cc52826f18e..03e7c6352aef 100644
>>> --- a/include/linux/phy.h
>>> +++ b/include/linux/phy.h
>>> @@ -1077,6 +1077,10 @@ struct phy_driver {
>>> int (*get_sqi)(struct phy_device *dev);
>>> /** @get_sqi_max: Get the maximum signal quality indication */
>>> int (*get_sqi_max)(struct phy_device *dev);
>>> + /* Used for WAKE_FILTER programming only */
>>
>> Any particular reason this comment is required? I don't see it enforced
>> above so I'm curious.
>
> The comment is not required, though I put it in there to help readers
> understand that this is purely for use by Wake-on-LAN, since unlike a
> MACs, PHYs are not capable of redirecting certain flows to certain
> queues, too low in the packet processing that there is not a notion of a
> queue at that point (FIFO yes, but not queue as in what the networking
> stack wants to use).

Ah, right that makes sense. Thanks for the clarification.

Perhaps we could enforce that in the interface so that if something does
try to pass a different kind of filter to the phy_rxnfc it would fail or
complain somehow? Because that seems like it would be a programming mistake.

I guess with the current implementation you effectively rely on
returning -EOPNOTSUP for non-wake filters since the driver forwards the
filter to the PHY to check whether it can support it.

Thanks,
Jake