All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled
@ 2022-03-07 18:26 Felix Fietkau
  2022-03-07 18:26 ` [PATCH 2/2] sch_fq_codel: fix running with classifiers that don't set a classid Felix Fietkau
  2022-03-07 20:37 ` [PATCH 1/2] sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled Toke Høiland-Jørgensen
  0 siblings, 2 replies; 5+ messages in thread
From: Felix Fietkau @ 2022-03-07 18:26 UTC (permalink / raw)
  To: netdev

Allows the 'nonat' option to be specified

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/sched/sch_cake.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index a43a58a73d09..57c0095a831b 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -2583,9 +2583,11 @@ static int cake_change(struct Qdisc *sch, struct nlattr *opt,
 		q->flow_mode |= CAKE_FLOW_NAT_FLAG *
 			!!nla_get_u32(tb[TCA_CAKE_NAT]);
 #else
-		NL_SET_ERR_MSG_ATTR(extack, tb[TCA_CAKE_NAT],
-				    "No conntrack support in kernel");
-		return -EOPNOTSUPP;
+		if (nla_get_u32(tb[TCA_CAKE_NAT])) {
+			NL_SET_ERR_MSG_ATTR(extack, tb[TCA_CAKE_NAT],
+					    "No conntrack support in kernel");
+			return -EOPNOTSUPP;
+		}
 #endif
 	}
 
-- 
2.32.0 (Apple Git-132)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] sch_fq_codel: fix running with classifiers that don't set a classid
  2022-03-07 18:26 [PATCH 1/2] sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled Felix Fietkau
@ 2022-03-07 18:26 ` Felix Fietkau
  2022-03-07 20:41   ` Toke Høiland-Jørgensen
  2022-03-07 20:37 ` [PATCH 1/2] sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled Toke Høiland-Jørgensen
  1 sibling, 1 reply; 5+ messages in thread
From: Felix Fietkau @ 2022-03-07 18:26 UTC (permalink / raw)
  To: netdev

If no valid classid is provided, fall back to calculating the hash directly,
in order to avoid dropping packets

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/sched/sch_fq_codel.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 839e1235db05..b2a13185bb63 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -88,7 +88,7 @@ static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch,
 
 	filter = rcu_dereference_bh(q->filter_list);
 	if (!filter)
-		return fq_codel_hash(q, skb) + 1;
+		goto out;
 
 	*qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
 	result = tcf_classify(skb, NULL, filter, &res, false);
@@ -104,10 +104,13 @@ static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch,
 			return 0;
 		}
 #endif
-		if (TC_H_MIN(res.classid) <= q->flows_cnt)
+		if (TC_H_MIN(res.classid) > 0 &&
+		    TC_H_MIN(res.classid) <= q->flows_cnt)
 			return TC_H_MIN(res.classid);
 	}
-	return 0;
+
+out:
+	return fq_codel_hash(q, skb) + 1;
 }
 
 /* helper functions : might be changed when/if skb use a standard list_head */
-- 
2.32.0 (Apple Git-132)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled
  2022-03-07 18:26 [PATCH 1/2] sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled Felix Fietkau
  2022-03-07 18:26 ` [PATCH 2/2] sch_fq_codel: fix running with classifiers that don't set a classid Felix Fietkau
@ 2022-03-07 20:37 ` Toke Høiland-Jørgensen
  1 sibling, 0 replies; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2022-03-07 20:37 UTC (permalink / raw)
  To: Felix Fietkau, netdev

Felix Fietkau <nbd@nbd.name> writes:

> Allows the 'nonat' option to be specified
>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

Right, makes sense!

Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] sch_fq_codel: fix running with classifiers that don't set a classid
  2022-03-07 18:26 ` [PATCH 2/2] sch_fq_codel: fix running with classifiers that don't set a classid Felix Fietkau
@ 2022-03-07 20:41   ` Toke Høiland-Jørgensen
  2022-03-07 22:43     ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2022-03-07 20:41 UTC (permalink / raw)
  To: Felix Fietkau, netdev

Felix Fietkau <nbd@nbd.name> writes:

> If no valid classid is provided, fall back to calculating the hash directly,
> in order to avoid dropping packets
>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

While I agree that this behaviour makes more sense, it's also a
user-facing API change; I suppose there may be filters out there relying
on the fact that invalid (or unset) class ID values lead to dropped
packets?

-Toke


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] sch_fq_codel: fix running with classifiers that don't set a classid
  2022-03-07 20:41   ` Toke Høiland-Jørgensen
@ 2022-03-07 22:43     ` Eric Dumazet
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2022-03-07 22:43 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, Felix Fietkau, netdev


On 3/7/22 12:41, Toke Høiland-Jørgensen wrote:
> Felix Fietkau <nbd@nbd.name> writes:
>
>> If no valid classid is provided, fall back to calculating the hash directly,
>> in order to avoid dropping packets
>>
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> While I agree that this behaviour makes more sense, it's also a
> user-facing API change; I suppose there may be filters out there relying
> on the fact that invalid (or unset) class ID values lead to dropped
> packets?


Indeed.

This part was copied from SFQ, so if we want to (optionally ?) change 
the behavior,

same change should be applied to SFQ.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-07 22:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 18:26 [PATCH 1/2] sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled Felix Fietkau
2022-03-07 18:26 ` [PATCH 2/2] sch_fq_codel: fix running with classifiers that don't set a classid Felix Fietkau
2022-03-07 20:41   ` Toke Høiland-Jørgensen
2022-03-07 22:43     ` Eric Dumazet
2022-03-07 20:37 ` [PATCH 1/2] sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled Toke Høiland-Jørgensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.