mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
traffic-pacing-edt: Use SKB->mark to identify different stages
This can be used by bpftrace programs to identify different stages, when trying to determine the EDT accuracy. Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
This commit is contained in:
@@ -135,6 +135,7 @@ static __always_inline int sched_departure(struct __sk_buff *skb, __u32 key)
|
||||
|
||||
WRITE_ONCE(edt->t_last, t_curr_next);
|
||||
skb->tstamp = t_curr_next;
|
||||
skb->mark = 1; /* No queue - add minimum delay */
|
||||
#else
|
||||
WRITE_ONCE(edt->t_last, t_curr);
|
||||
#endif
|
||||
@@ -156,10 +157,14 @@ static __always_inline int sched_departure(struct __sk_buff *skb, __u32 key)
|
||||
// if (codel_drop(edt, t_queue_sz, now))
|
||||
if (codel_drop(&edt->codel, t_queue_sz, t_next))
|
||||
return BPF_DROP;
|
||||
|
||||
skb->mark = 2; /* (time) queue exist - and small/below T_HORIZON_ECN */
|
||||
|
||||
/* ECN marking horizon */
|
||||
if (t_queue_sz >= T_HORIZON_ECN)
|
||||
if (t_queue_sz >= T_HORIZON_ECN) {
|
||||
skb->mark = 3; /* (time) queue exist - and is large */
|
||||
bpf_skb_ecn_set_ce(skb);
|
||||
}
|
||||
|
||||
/* Advance "time queue" */
|
||||
WRITE_ONCE(edt->t_last, t_next);
|
||||
|
Reference in New Issue
Block a user