|
|
@@ -86,7 +86,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
/* indices for dequeue */
|
|
|
u16 cur_tin;
|
|
|
-@@ -1195,7 +1197,7 @@ static bool cake_tcph_may_drop(const str
|
|
|
+@@ -1198,7 +1200,7 @@ static bool cake_tcph_may_drop(const str
|
|
|
static struct sk_buff *cake_ack_filter(struct cake_sched_data *q,
|
|
|
struct cake_flow *flow)
|
|
|
{
|
|
|
@@ -95,7 +95,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
struct sk_buff *elig_ack = NULL, *elig_ack_prev = NULL;
|
|
|
struct sk_buff *skb_check, *skb_prev = NULL;
|
|
|
const struct ipv6hdr *ipv6h, *ipv6h_check;
|
|
|
-@@ -1355,15 +1357,17 @@ static u64 cake_ewma(u64 avg, u64 sample
|
|
|
+@@ -1358,15 +1360,17 @@ static u64 cake_ewma(u64 avg, u64 sample
|
|
|
return avg;
|
|
|
}
|
|
|
|
|
|
@@ -118,7 +118,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
len += q->rate_overhead;
|
|
|
|
|
|
-@@ -1382,10 +1386,10 @@ static u32 cake_calc_overhead(struct cak
|
|
|
+@@ -1385,10 +1389,10 @@ static u32 cake_calc_overhead(struct cak
|
|
|
len += (len + 63) / 64;
|
|
|
}
|
|
|
|
|
|
@@ -133,16 +133,16 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
return len;
|
|
|
}
|
|
|
-@@ -1587,7 +1591,7 @@ static unsigned int cake_drop(struct Qdi
|
|
|
+@@ -1592,7 +1596,7 @@ static unsigned int cake_drop(struct Qdi
|
|
|
+ flow->dropped++;
|
|
|
b->tin_dropped++;
|
|
|
- sch->qstats.drops++;
|
|
|
|
|
|
- if (q->rate_flags & CAKE_FLAG_INGRESS)
|
|
|
+ if (q->config->rate_flags & CAKE_FLAG_INGRESS)
|
|
|
cake_advance_shaper(q, b, skb, now, true);
|
|
|
|
|
|
- __qdisc_drop(skb, to_free);
|
|
|
-@@ -1657,7 +1661,8 @@ static u8 cake_handle_diffserv(struct sk
|
|
|
+ qdisc_drop_reason(skb, sch, to_free, SKB_DROP_REASON_QDISC_OVERLIMIT);
|
|
|
+@@ -1662,7 +1666,8 @@ static u8 cake_handle_diffserv(struct sk
|
|
|
static struct cake_tin_data *cake_select_tin(struct Qdisc *sch,
|
|
|
struct sk_buff *skb)
|
|
|
{
|
|
|
@@ -152,7 +152,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
u32 tin, mark;
|
|
|
bool wash;
|
|
|
u8 dscp;
|
|
|
-@@ -1674,24 +1679,24 @@ static struct cake_tin_data *cake_select
|
|
|
+@@ -1679,24 +1684,24 @@ static struct cake_tin_data *cake_select
|
|
|
if (q->tin_mode == CAKE_DIFFSERV_BESTEFFORT)
|
|
|
tin = 0;
|
|
|
|
|
|
@@ -184,7 +184,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
}
|
|
|
|
|
|
static u32 cake_classify(struct Qdisc *sch, struct cake_tin_data **t,
|
|
|
-@@ -1747,7 +1752,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
+@@ -1752,7 +1757,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
bool same_flow = false;
|
|
|
|
|
|
/* choose flow to insert into */
|
|
|
@@ -193,7 +193,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
if (idx == 0) {
|
|
|
if (ret & __NET_XMIT_BYPASS)
|
|
|
qdisc_qstats_drop(sch);
|
|
|
-@@ -1782,7 +1787,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
+@@ -1787,7 +1792,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
if (unlikely(len > b->max_skblen))
|
|
|
b->max_skblen = len;
|
|
|
|
|
|
@@ -202,7 +202,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
struct sk_buff *segs, *nskb;
|
|
|
netdev_features_t features = netif_skb_features(skb);
|
|
|
unsigned int slen = 0, numsegs = 0;
|
|
|
-@@ -1823,7 +1828,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
+@@ -1828,7 +1833,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
get_cobalt_cb(skb)->adjusted_len = cake_overhead(q, skb);
|
|
|
flow_queue_add(flow, skb);
|
|
|
|
|
|
@@ -211,7 +211,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
ack = cake_ack_filter(q, flow);
|
|
|
|
|
|
if (ack) {
|
|
|
-@@ -1832,7 +1837,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
+@@ -1837,7 +1842,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
ack_pkt_len = qdisc_pkt_len(ack);
|
|
|
b->bytes += ack_pkt_len;
|
|
|
q->buffer_used += skb->truesize - ack->truesize;
|
|
|
@@ -220,7 +220,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
cake_advance_shaper(q, b, ack, now, true);
|
|
|
|
|
|
qdisc_tree_reduce_backlog(sch, 1, ack_pkt_len);
|
|
|
-@@ -1855,7 +1860,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
+@@ -1860,7 +1865,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
cake_heapify_up(q, b->overflow_idx[idx]);
|
|
|
|
|
|
/* incoming bandwidth capacity estimate */
|
|
|
@@ -229,7 +229,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
u64 packet_interval = \
|
|
|
ktime_to_ns(ktime_sub(now, q->last_packet_time));
|
|
|
|
|
|
-@@ -1887,7 +1892,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
+@@ -1892,7 +1897,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
if (ktime_after(now,
|
|
|
ktime_add_ms(q->last_reconfig_time,
|
|
|
250))) {
|
|
|
@@ -238,7 +238,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
cake_reconfigure(sch);
|
|
|
}
|
|
|
}
|
|
|
-@@ -1907,7 +1912,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
+@@ -1912,7 +1917,7 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
flow->set = CAKE_SET_SPARSE;
|
|
|
b->sparse_flow_count++;
|
|
|
|
|
|
@@ -247,7 +247,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
} else if (flow->set == CAKE_SET_SPARSE_WAIT) {
|
|
|
/* this flow was empty, accounted as a sparse flow, but actually
|
|
|
* in the bulk rotation.
|
|
|
-@@ -1916,8 +1921,8 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
+@@ -1921,8 +1926,8 @@ static s32 cake_enqueue(struct sk_buff *
|
|
|
b->sparse_flow_count--;
|
|
|
b->bulk_flow_count++;
|
|
|
|
|
|
@@ -258,7 +258,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
}
|
|
|
|
|
|
if (q->buffer_used > q->buffer_max_used)
|
|
|
-@@ -2103,8 +2108,8 @@ retry:
|
|
|
+@@ -2109,8 +2114,8 @@ retry:
|
|
|
b->sparse_flow_count--;
|
|
|
b->bulk_flow_count++;
|
|
|
|
|
|
@@ -269,7 +269,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
flow->set = CAKE_SET_BULK;
|
|
|
} else {
|
|
|
-@@ -2116,7 +2121,7 @@ retry:
|
|
|
+@@ -2122,7 +2127,7 @@ retry:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -278,7 +278,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
list_move_tail(&flow->flowchain, &b->old_flows);
|
|
|
|
|
|
goto retry;
|
|
|
-@@ -2140,8 +2145,8 @@ retry:
|
|
|
+@@ -2146,8 +2151,8 @@ retry:
|
|
|
if (flow->set == CAKE_SET_BULK) {
|
|
|
b->bulk_flow_count--;
|
|
|
|
|
|
@@ -289,7 +289,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
b->decaying_flow_count++;
|
|
|
} else if (flow->set == CAKE_SET_SPARSE ||
|
|
|
-@@ -2159,8 +2164,8 @@ retry:
|
|
|
+@@ -2165,8 +2170,8 @@ retry:
|
|
|
else if (flow->set == CAKE_SET_BULK) {
|
|
|
b->bulk_flow_count--;
|
|
|
|
|
|
@@ -300,14 +300,15 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
} else
|
|
|
b->decaying_flow_count--;
|
|
|
|
|
|
-@@ -2172,13 +2177,13 @@ retry:
|
|
|
+@@ -2177,14 +2182,14 @@ retry:
|
|
|
+
|
|
|
+ reason = cobalt_should_drop(&flow->cvars, &b->cparams, now, skb,
|
|
|
+ (b->bulk_flow_count *
|
|
|
+- !!(q->rate_flags &
|
|
|
++ !!(q->config->rate_flags &
|
|
|
+ CAKE_FLAG_INGRESS)));
|
|
|
/* Last packet in queue may be marked, shouldn't be dropped */
|
|
|
- if (!cobalt_should_drop(&flow->cvars, &b->cparams, now, skb,
|
|
|
- (b->bulk_flow_count *
|
|
|
-- !!(q->rate_flags &
|
|
|
-+ !!(q->config->rate_flags &
|
|
|
- CAKE_FLAG_INGRESS))) ||
|
|
|
- !flow->head)
|
|
|
+ if (reason == SKB_NOT_DROPPED_YET || !flow->head)
|
|
|
break;
|
|
|
|
|
|
/* drop this packet, get another one */
|
|
|
@@ -316,16 +317,16 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
len = cake_advance_shaper(q, b, skb,
|
|
|
now, true);
|
|
|
flow->deficit -= len;
|
|
|
-@@ -2189,7 +2194,7 @@ retry:
|
|
|
+@@ -2195,7 +2200,7 @@ retry:
|
|
|
qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb));
|
|
|
qdisc_qstats_drop(sch);
|
|
|
- kfree_skb(skb);
|
|
|
+ kfree_skb_reason(skb, reason);
|
|
|
- if (q->rate_flags & CAKE_FLAG_INGRESS)
|
|
|
+ if (q->config->rate_flags & CAKE_FLAG_INGRESS)
|
|
|
goto retry;
|
|
|
}
|
|
|
|
|
|
-@@ -2311,7 +2316,7 @@ static int cake_config_besteffort(struct
|
|
|
+@@ -2317,7 +2322,7 @@ static int cake_config_besteffort(struct
|
|
|
struct cake_sched_data *q = qdisc_priv(sch);
|
|
|
struct cake_tin_data *b = &q->tins[0];
|
|
|
u32 mtu = psched_mtu(qdisc_dev(sch));
|
|
|
@@ -334,7 +335,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
q->tin_cnt = 1;
|
|
|
|
|
|
-@@ -2319,7 +2324,7 @@ static int cake_config_besteffort(struct
|
|
|
+@@ -2325,7 +2330,7 @@ static int cake_config_besteffort(struct
|
|
|
q->tin_order = normal_order;
|
|
|
|
|
|
cake_set_rate(b, rate, mtu,
|
|
|
@@ -343,7 +344,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
b->tin_quantum = 65535;
|
|
|
|
|
|
return 0;
|
|
|
-@@ -2330,7 +2335,7 @@ static int cake_config_precedence(struct
|
|
|
+@@ -2336,7 +2341,7 @@ static int cake_config_precedence(struct
|
|
|
/* convert high-level (user visible) parameters into internal format */
|
|
|
struct cake_sched_data *q = qdisc_priv(sch);
|
|
|
u32 mtu = psched_mtu(qdisc_dev(sch));
|
|
|
@@ -352,7 +353,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
u32 quantum = 256;
|
|
|
u32 i;
|
|
|
|
|
|
-@@ -2341,8 +2346,8 @@ static int cake_config_precedence(struct
|
|
|
+@@ -2347,8 +2352,8 @@ static int cake_config_precedence(struct
|
|
|
for (i = 0; i < q->tin_cnt; i++) {
|
|
|
struct cake_tin_data *b = &q->tins[i];
|
|
|
|
|
|
@@ -363,7 +364,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
b->tin_quantum = max_t(u16, 1U, quantum);
|
|
|
|
|
|
-@@ -2419,7 +2424,7 @@ static int cake_config_diffserv8(struct
|
|
|
+@@ -2425,7 +2430,7 @@ static int cake_config_diffserv8(struct
|
|
|
|
|
|
struct cake_sched_data *q = qdisc_priv(sch);
|
|
|
u32 mtu = psched_mtu(qdisc_dev(sch));
|
|
|
@@ -372,7 +373,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
u32 quantum = 256;
|
|
|
u32 i;
|
|
|
|
|
|
-@@ -2433,8 +2438,8 @@ static int cake_config_diffserv8(struct
|
|
|
+@@ -2439,8 +2444,8 @@ static int cake_config_diffserv8(struct
|
|
|
for (i = 0; i < q->tin_cnt; i++) {
|
|
|
struct cake_tin_data *b = &q->tins[i];
|
|
|
|
|
|
@@ -383,7 +384,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
b->tin_quantum = max_t(u16, 1U, quantum);
|
|
|
|
|
|
-@@ -2463,7 +2468,7 @@ static int cake_config_diffserv4(struct
|
|
|
+@@ -2469,7 +2474,7 @@ static int cake_config_diffserv4(struct
|
|
|
|
|
|
struct cake_sched_data *q = qdisc_priv(sch);
|
|
|
u32 mtu = psched_mtu(qdisc_dev(sch));
|
|
|
@@ -392,7 +393,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
u32 quantum = 1024;
|
|
|
|
|
|
q->tin_cnt = 4;
|
|
|
-@@ -2474,13 +2479,13 @@ static int cake_config_diffserv4(struct
|
|
|
+@@ -2480,13 +2485,13 @@ static int cake_config_diffserv4(struct
|
|
|
|
|
|
/* class characteristics */
|
|
|
cake_set_rate(&q->tins[0], rate, mtu,
|
|
|
@@ -410,7 +411,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
/* bandwidth-sharing weights */
|
|
|
q->tins[0].tin_quantum = quantum;
|
|
|
-@@ -2500,7 +2505,7 @@ static int cake_config_diffserv3(struct
|
|
|
+@@ -2506,7 +2511,7 @@ static int cake_config_diffserv3(struct
|
|
|
*/
|
|
|
struct cake_sched_data *q = qdisc_priv(sch);
|
|
|
u32 mtu = psched_mtu(qdisc_dev(sch));
|
|
|
@@ -419,7 +420,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
u32 quantum = 1024;
|
|
|
|
|
|
q->tin_cnt = 3;
|
|
|
-@@ -2511,11 +2516,11 @@ static int cake_config_diffserv3(struct
|
|
|
+@@ -2517,11 +2522,11 @@ static int cake_config_diffserv3(struct
|
|
|
|
|
|
/* class characteristics */
|
|
|
cake_set_rate(&q->tins[0], rate, mtu,
|
|
|
@@ -434,7 +435,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
/* bandwidth-sharing weights */
|
|
|
q->tins[0].tin_quantum = quantum;
|
|
|
-@@ -2527,7 +2532,8 @@ static int cake_config_diffserv3(struct
|
|
|
+@@ -2533,7 +2538,8 @@ static int cake_config_diffserv3(struct
|
|
|
|
|
|
static void cake_reconfigure(struct Qdisc *sch)
|
|
|
{
|
|
|
@@ -444,7 +445,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
int c, ft;
|
|
|
|
|
|
switch (q->tin_mode) {
|
|
|
-@@ -2553,36 +2559,37 @@ static void cake_reconfigure(struct Qdis
|
|
|
+@@ -2559,36 +2565,37 @@ static void cake_reconfigure(struct Qdis
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
@@ -493,7 +494,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
struct nlattr *tb[TCA_CAKE_MAX + 1];
|
|
|
u16 rate_flags;
|
|
|
u8 flow_mode;
|
|
|
-@@ -2636,19 +2643,19 @@ static int cake_change(struct Qdisc *sch
|
|
|
+@@ -2642,19 +2649,19 @@ static int cake_change(struct Qdisc *sch
|
|
|
nla_get_s32(tb[TCA_CAKE_OVERHEAD]));
|
|
|
rate_flags |= CAKE_FLAG_OVERHEAD;
|
|
|
|
|
|
@@ -521,7 +522,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
}
|
|
|
|
|
|
if (tb[TCA_CAKE_MPU])
|
|
|
-@@ -2704,7 +2711,7 @@ static int cake_change(struct Qdisc *sch
|
|
|
+@@ -2710,7 +2717,7 @@ static int cake_change(struct Qdisc *sch
|
|
|
|
|
|
WRITE_ONCE(q->rate_flags, rate_flags);
|
|
|
WRITE_ONCE(q->flow_mode, flow_mode);
|
|
|
@@ -530,7 +531,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
sch_tree_lock(sch);
|
|
|
cake_reconfigure(sch);
|
|
|
sch_tree_unlock(sch);
|
|
|
-@@ -2720,14 +2727,20 @@ static void cake_destroy(struct Qdisc *s
|
|
|
+@@ -2726,14 +2733,20 @@ static void cake_destroy(struct Qdisc *s
|
|
|
qdisc_watchdog_cancel(&q->watchdog);
|
|
|
tcf_block_put(q->block);
|
|
|
kvfree(q->tins);
|
|
|
@@ -552,7 +553,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
sch->limit = 10240;
|
|
|
q->tin_mode = CAKE_DIFFSERV_DIFFSERV3;
|
|
|
q->flow_mode = CAKE_FLOW_TRIPLE;
|
|
|
-@@ -2739,33 +2752,36 @@ static int cake_init(struct Qdisc *sch,
|
|
|
+@@ -2745,33 +2758,36 @@ static int cake_init(struct Qdisc *sch,
|
|
|
* for 5 to 10% of interval
|
|
|
*/
|
|
|
q->rate_flags |= CAKE_FLAG_SPLIT_GSO;
|
|
|
@@ -600,7 +601,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
INIT_LIST_HEAD(&b->new_flows);
|
|
|
INIT_LIST_HEAD(&b->old_flows);
|
|
|
-@@ -2781,22 +2797,27 @@ static int cake_init(struct Qdisc *sch,
|
|
|
+@@ -2787,22 +2803,27 @@ static int cake_init(struct Qdisc *sch,
|
|
|
INIT_LIST_HEAD(&flow->flowchain);
|
|
|
cobalt_vars_init(&flow->cvars);
|
|
|
|