Re: [PATCH v2 2/3] net: stmmac: fix l3l4 filter rejecting unsupported offload requests
From: Nazle Asmade, Muhammad Nazim Amirul
Date: Tue Jun 16 2026 - 00:32:06 EST
On 10/6/2026 8:43 am, Jakub Kicinski wrote:
> On Fri, 5 Jun 2026 02:01:13 -0700
> muhammad.nazim.amirul.nazle.asmade@xxxxxxxxxx wrote:
>> + /* Both network proto and transport proto not present in the key */
>> + if (!match.mask || !(match.mask->n_proto || match.mask->ip_proto))
>> + return -EOPNOTSUPP;
>> +
>> + /* If the proto is present in the key and is not full mask */
>> + if ((match.mask->n_proto && match.mask->n_proto != ETHER_TYPE_FULL_MASK) ||
>> + (match.mask->ip_proto && match.mask->ip_proto != IP_PROTO_FULL_MASK))
>> + return -EOPNOTSUPP;
>> +
>> + /* Network proto is present in the key and is not IPv4 */
>> + if (match.mask->n_proto && match.key->n_proto != cpu_to_be16(ETH_P_IP))
>> + return -EOPNOTSUPP;
>> +
>> + /* Transport proto is present in the key and is not TCP or UDP */
>> + if (match.mask->ip_proto &&
>> + match.key->ip_proto != IPPROTO_TCP &&
>> + match.key->ip_proto != IPPROTO_UDP)
>> + return -EOPNOTSUPP;
>
> Please add extack messages to let user know which part of the match is
> unsupported. Extack pointer is somewhere inside struct flow_cls_offload
>
> FWIW Sashiko points out a bunch of other potential issues, not sure if
> they matter
> https://sashiko.dev/#/patchset/20260605090114.16028-2-muhammad.nazim.amirul.nazle.asmade@xxxxxxxxxx
Hi Jakub,
Thank you for the review! After going through the Shashiko review, there
are some that valid and related. It was quite helpful! Here are the
changes in v3 of patch 2/3:
1. Added extack messages to all four -EOPNOTSUPP return paths in
tc_add_basic_flow() so users know exactly which part of the match
is unsupported.
2. Fixed a bug in v2: using break when -EOPNOTSUPP was returned
silently discarded the error on FLOW_CLS_REPLACE - entry->in_use
is already true on replace, so tc_add_flow() would fall through
and return 0 (success) for an unsupported rule. Fixed by returning
ret directly instead.
Patches 1/3 and 3/3 are unchanged.
Posted patch set with the updates above.
https://lore.kernel.org/all/20260616042655.7782-1-muhammad.nazim.amirul.nazle.asmade@xxxxxxxxxx/
BR,
Nazim