mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
traffic-pacing-edt: whitespace cleanups
Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
This commit is contained in:
committed by
Jesper Dangaard Brouer
parent
ea11864db2
commit
b4dad87cad
@ -16,7 +16,7 @@ char _license[] SEC("license") = "GPL";
|
||||
*
|
||||
* Production use-case is pacing traffic at 1Gbit/s wirespeed, using a
|
||||
* 10Gbit/s NIC, because 1G end-user switch cannot handle bursts.
|
||||
*
|
||||
*
|
||||
* (https://en.wikipedia.org/wiki/Interpacket_gap
|
||||
* 12 bytes = interframe gap (IFG) 96 bit
|
||||
|
||||
@ -110,7 +110,7 @@ static __always_inline int sched_departure(struct __sk_buff *skb, __u32 key)
|
||||
*/
|
||||
wire_len = skb->wire_len + OVERHEAD;
|
||||
wire_len = wire_len > ETH_MIN ? wire_len : ETH_MIN;
|
||||
|
||||
|
||||
t_xmit_ns = (wire_len) * NS_PER_SEC / RATE_IN_BYTES;
|
||||
|
||||
// t_xmit_ns = ((__u64)skb->wire_len) * NS_PER_SEC / RATE_IN_BYTES;
|
||||
@ -174,7 +174,7 @@ static __always_inline int sched_departure(struct __sk_buff *skb, __u32 key)
|
||||
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) {
|
||||
skb->mark = 3; /* (time) queue exist - and is large */
|
||||
@ -272,7 +272,7 @@ SEC("classifier") int tc_edt_vlan(struct __sk_buff *skb)
|
||||
|
||||
vlan_key = extract_vlan_key(skb, &vlans);
|
||||
|
||||
/* Each (inner) VLAN id gets it own EDT pacing */
|
||||
/* Each (inner) VLAN id gets it own EDT pacing */
|
||||
return sched_departure(skb, vlan_key);
|
||||
|
||||
out:
|
||||
|
Reference in New Issue
Block a user