From: Jijie Shao <shaojijie@huawei.com>
To: Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Cc: <shaojijie@huawei.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <andrew+netdev@lunn.ch>,
<shenjian15@huawei.com>, <liuyonglong@huawei.com>,
<chenhao418@huawei.com>, <huangdonghua3@h-partners.com>,
<yangshuaisong@h-partners.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 net-next 0/6] net: hns3: enhance tc flow offload support
Date: Thu, 28 May 2026 19:24:28 +0800 [thread overview]
Message-ID: <83f34836-c848-469a-9c1c-7f28bf3035fc@huawei.com> (raw)
In-Reply-To: <b0b0ac82-bcbf-4aef-bf6f-7340f9517fc6@redhat.com>
on 2026/5/28 17:06, Paolo Abeni wrote:
> On 5/27/26 3:12 PM, Jijie Shao wrote:
>> on 2026/5/27 17:59, Simon Horman wrote:
>>> On Sat, May 23, 2026 at 06:54:43PM +0800, Jijie Shao wrote:
>>>> This patchset enhances the tc flow offload support for hns3 driver:
>>>>
>>>> - Patch 1: Refactor hclge_add_cls_flower() to support more actions
>>>> - Patch 2: Improve unused_tuple parameter setting for separate src/dst configuration
>>>> - Patch 3: Add support for HCLGE_FD_ACTION_SELECT_QUEUE and HCLGE_FD_ACTION_DROP_PACKET actions
>>>> - Patch 4: Add support for FLOW_DISSECTOR_KEY_IP and FLOW_DISSECTOR_KEY_ENC_KEYID dissectors
>>>> - Patch 5: Add debugfs support for dumping FD rules
>>>> - Patch 6: Move FD code to a separate file (hclge_fd.c) for better code organization
>>>>
>>>> ---
>>>> ChangeLog:
>>>> v1 -> v2:
>>>> - Fixed warnings similar to "warning: restricted __le32 degrades to integer",
>>>> pointed out by Jakub
>>>> - Fixed warnings related to
>>>> "warning: diagnostic behavior may be improved by adding the 'format(printf, 5, 7)'",
>>>> pointed out by Jakub
>>>> v1: https://lore.kernel.org/all/20260518093526.1109595-1-shaojijie@huawei.com/
>>> Hi Juijie,
>>>
>>> There are AI-generated reviews of this patch-set available at
>>> https://netdev-ai.bots.linux.dev/ and https://sashiko.dev/
>> Hi,
>>
>> I'm sorry, I don't understand how to use https://netdev-ai.bots.linux.dev/, it seems to require an API Token?
>> I find it difficult to locate my own patch-set in Recent Reviews.
> The nipa sashiko instance has the same web UI as sashiko.dev. The full
> URL for the former is:
>
> https://netdev-ai.bots.linux.dev/sashiko/
>
> You can lookup your series by the cover letter title or you can use the
> direct link including the msg id for the cover:
>
> https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260523105449.661848-1-shaojijie%40huawei.com
Thanks,
It appears that the two URLs mentioned by Simon Horman are the results of the one AI-generated reviews.
>
>> Regarding https://sashiko.dev/, I checked and some of the issues are pre-existing issues,
>> not caused by the new features added in this patch-set.
>>
>> Some others are related to the solution, which is the same as the ethtool -U already supported by the driver.
>> I suggest keeping it consistent with ethtool -U for now.
> I'm not sure which comment do you refer above.
>
> This one:
>
> ---
>> + if (is_zero_ether_addr(match.key->dst))
>> + rule->unused_tuple |= BIT(INNER_DST_MAC);
>> + if (is_zero_ether_addr(match.key->src))
>> + rule->unused_tuple |= BIT(INNER_SRC_MAC);
> Should the "is this tuple unused" decision be driven by the mask
> rather than the key?
> A tc-flower rule that explicitly matches an all-zero address, for
> example:
> tc filter add ... flower dst_mac 00:00:00:00:00:00 ...
> tc filter add ... flower src_ip 0.0.0.0 ...
> tc filter add ... flower src_ip :: ...
> produces match.key->{src,dst} == 0 with match.mask->{src,dst} set to
> all-ones. With the new checks above, those rules now have
> INNER_{SRC,DST}_MAC / INNER_{SRC,DST}_IP added to rule->unused_tuple
> even though the user asked to match exactly that address.
> Downstream, hclge_fd_convert_tuple() short-circuits on unused_tuple:
> if (rule->unused_tuple & BIT(tuple_bit))
> return true;
> so the tuple is not programmed into the TCAM key and the field is
> effectively wildcarded in hardware, with no -EINVAL or extack returned
> to the user.
> Real-world patterns that rely on all-zero addresses include DHCPv4
> DISCOVER (src 0.0.0.0), IPv6 DAD/NUD probes and DHCPv6 (src ::), and
> deliberate matches on the all-zero MAC.
> ---
>
> and similar later ones look real/relevant to me, and IMHO should be
> addressed.
Yes, I saw this issue. There is similar logic in the existing function hclge_fd_check_ether_tuple():
static int hclge_fd_check_ether_tuple(struct ethhdr *spec, u32 *unused_tuple)
{
if (!spec || !unused_tuple)
return -EINVAL;
*unused_tuple |= BIT(INNER_SRC_IP) | BIT(INNER_DST_IP) |
BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT) |
BIT(INNER_IP_TOS) | BIT(INNER_IP_PROTO);
if (is_zero_ether_addr(spec->h_source))
*unused_tuple |= BIT(INNER_SRC_MAC);
if (is_zero_ether_addr(spec->h_dest))
*unused_tuple |= BIT(INNER_DST_MAC);
if (!spec->h_proto)
*unused_tuple |= BIT(INNER_ETH_TYPE);
return 0;
}
This looks like a common problem for hns3. My original idea was to send a separate bugfix later to fix all the all-zero MAC or IP addresses.
The current tc flow implementation logic is consistent with ethtool -U.
Alternatively, I can first fix the tc flow issue in v4, and then submit a bugfix later to fix the potential issues in ethtool -U.
Thanks,
Jijie Shao.
next prev parent reply other threads:[~2026-05-28 11:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 10:54 Jijie Shao
2026-05-23 10:54 ` [PATCH V2 net-next 1/6] net: hns3: adjust add_cls_flower() for support more action Jijie Shao
2026-05-23 10:54 ` [PATCH V2 net-next 2/6] net: hns3: improve the unused_tuple parameter setting Jijie Shao
2026-05-23 10:54 ` [PATCH V2 net-next 3/6] net: hns3: support two more actions for tc flow Jijie Shao
2026-05-23 10:54 ` [PATCH V2 net-next 4/6] net: hns3: support IP and tunnel VNI dissectors " Jijie Shao
2026-05-23 10:54 ` [PATCH V2 net-next 5/6] net: hns3: debugfs support for dumping fd rules Jijie Shao
2026-05-23 10:54 ` [PATCH V2 net-next 6/6] net: hns3: move fd code to a separate file Jijie Shao
2026-05-27 9:59 ` [PATCH V2 net-next 0/6] net: hns3: enhance tc flow offload support Simon Horman
2026-05-27 13:12 ` Jijie Shao
2026-05-28 9:06 ` Paolo Abeni
2026-05-28 11:24 ` Jijie Shao [this message]
2026-05-29 9:34 ` Simon Horman
2026-06-02 12:23 ` Jijie Shao
2026-05-29 10:53 ` Paolo Abeni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83f34836-c848-469a-9c1c-7f28bf3035fc@huawei.com \
--to=shaojijie@huawei.com \
--cc=andrew+netdev@lunn.ch \
--cc=chenhao418@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=huangdonghua3@h-partners.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenjian15@huawei.com \
--cc=yangshuaisong@h-partners.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®