* [PATCH] cxgb4: flower: add support for fragmentation
@ 2025-10-28 7:52 Harshita V Rajput
2025-10-29 16:05 ` Simon Horman
2025-10-31 2:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Harshita V Rajput @ 2025-10-28 7:52 UTC (permalink / raw)
To: kuba, davem, kernelxing
Cc: imx, netdev, edumazet, pabeni, Harshita V Rajput,
Potnuri Bharat Teja
This patch adds support for matching fragmented packets in tc flower
filters.
Previously, commit 93a8540aac72 ("cxgb4: flower: validate control flags")
added a check using flow_rule_match_has_control_flags() to reject
any rules with control flags, as the driver did not support
fragmentation at that time.
Now, with this patch, support for FLOW_DIS_IS_FRAGMENT is added:
- The driver checks for control flags using
flow_rule_is_supp_control_flags(), as recommended in
commit d11e63119432 ("flow_offload: add control flag checking helpers").
- If the fragmentation flag is present, the driver sets `fs->val.frag` and
`fs->mask.frag` accordingly in the filter specification.
Since fragmentation is now supported, the earlier check that rejected all
control flags (flow_rule_match_has_control_flags()) has been removed.
Signed-off-by: Harshita V Rajput <harshitha.vr@chelsio.com>
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
---
.../ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 40 +++++++++++--------
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
index 0765d000eaef..e2b5554531b5 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
@@ -161,20 +161,9 @@ static struct ch_tc_flower_entry *ch_flower_lookup(struct adapter *adap,
static void cxgb4_process_flow_match(struct net_device *dev,
struct flow_rule *rule,
+ u16 addr_type,
struct ch_filter_specification *fs)
{
- u16 addr_type = 0;
-
- if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CONTROL)) {
- struct flow_match_control match;
-
- flow_rule_match_control(rule, &match);
- addr_type = match.key->addr_type;
- } else if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IPV4_ADDRS)) {
- addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
- } else if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IPV6_ADDRS)) {
- addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
- }
if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) {
struct flow_match_basic match;
@@ -327,9 +316,6 @@ static int cxgb4_validate_flow_match(struct netlink_ext_ack *extack,
return -EOPNOTSUPP;
}
- if (flow_rule_match_has_control_flags(rule, extack))
- return -EOPNOTSUPP;
-
if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) {
struct flow_match_basic match;
@@ -858,6 +844,7 @@ int cxgb4_flow_rule_replace(struct net_device *dev, struct flow_rule *rule,
{
struct adapter *adap = netdev2adap(dev);
struct filter_ctx ctx;
+ u16 addr_type = 0;
u8 inet_family;
int fidx, ret;
@@ -867,7 +854,28 @@ int cxgb4_flow_rule_replace(struct net_device *dev, struct flow_rule *rule,
if (cxgb4_validate_flow_match(extack, rule))
return -EOPNOTSUPP;
- cxgb4_process_flow_match(dev, rule, fs);
+ if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CONTROL)) {
+ struct flow_match_control match;
+
+ flow_rule_match_control(rule, &match);
+ addr_type = match.key->addr_type;
+
+ if (match.mask->flags & FLOW_DIS_IS_FRAGMENT) {
+ fs->val.frag = match.key->flags & FLOW_DIS_IS_FRAGMENT;
+ fs->mask.frag = true;
+ }
+
+ if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT,
+ match.mask->flags, extack))
+ return -EOPNOTSUPP;
+
+ } else if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IPV4_ADDRS)) {
+ addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
+ } else if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IPV6_ADDRS)) {
+ addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
+ }
+
+ cxgb4_process_flow_match(dev, rule, addr_type, fs);
cxgb4_process_flow_actions(dev, &rule->action, fs);
fs->hash = is_filter_exact_match(adap, fs);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] cxgb4: flower: add support for fragmentation
2025-10-28 7:52 [PATCH] cxgb4: flower: add support for fragmentation Harshita V Rajput
@ 2025-10-29 16:05 ` Simon Horman
2025-10-31 2:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-10-29 16:05 UTC (permalink / raw)
To: Harshita V Rajput
Cc: kuba, davem, kernelxing, imx, netdev, edumazet, pabeni,
Potnuri Bharat Teja
On Tue, Oct 28, 2025 at 01:22:55PM +0530, Harshita V Rajput wrote:
> This patch adds support for matching fragmented packets in tc flower
> filters.
>
> Previously, commit 93a8540aac72 ("cxgb4: flower: validate control flags")
> added a check using flow_rule_match_has_control_flags() to reject
> any rules with control flags, as the driver did not support
> fragmentation at that time.
>
> Now, with this patch, support for FLOW_DIS_IS_FRAGMENT is added:
> - The driver checks for control flags using
> flow_rule_is_supp_control_flags(), as recommended in
> commit d11e63119432 ("flow_offload: add control flag checking helpers").
> - If the fragmentation flag is present, the driver sets `fs->val.frag` and
> `fs->mask.frag` accordingly in the filter specification.
>
> Since fragmentation is now supported, the earlier check that rejected all
> control flags (flow_rule_match_has_control_flags()) has been removed.
>
> Signed-off-by: Harshita V Rajput <harshitha.vr@chelsio.com>
> Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
Thanks for the comprehensive commit message.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cxgb4: flower: add support for fragmentation
2025-10-28 7:52 [PATCH] cxgb4: flower: add support for fragmentation Harshita V Rajput
2025-10-29 16:05 ` Simon Horman
@ 2025-10-31 2:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-31 2:30 UTC (permalink / raw)
To: Harshita V Rajput
Cc: kuba, davem, kernelxing, imx, netdev, edumazet, pabeni, bharat
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 28 Oct 2025 13:22:55 +0530 you wrote:
> This patch adds support for matching fragmented packets in tc flower
> filters.
>
> Previously, commit 93a8540aac72 ("cxgb4: flower: validate control flags")
> added a check using flow_rule_match_has_control_flags() to reject
> any rules with control flags, as the driver did not support
> fragmentation at that time.
>
> [...]
Here is the summary with links:
- cxgb4: flower: add support for fragmentation
https://git.kernel.org/netdev/net-next/c/0d0eb186421d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-31 2:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28 7:52 [PATCH] cxgb4: flower: add support for fragmentation Harshita V Rajput
2025-10-29 16:05 ` Simon Horman
2025-10-31 2:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).