Skip to content

Commit

Permalink
Fixed persistant
Browse files Browse the repository at this point in the history
Signed-off-by: Frey Alfredsson <[email protected]>
  • Loading branch information
freysteinn committed May 19, 2022
1 parent 9d5ba29 commit 65f86f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions xdq-tester/sched_sprio.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,12 @@ void *dequeue_prog(struct dequeue_ctx *ctx)
goto err;

flow->pkts--;
if (flow->pkts <= 0 && !flow->persistent)
bpf_map_delete_elem(&flow_states, &nt);
if (flow->pkts <= 0) {
if (!flow->persistent)
bpf_map_delete_elem(&flow_states, &nt);
else
flow->finish_bytes = 0;
}

bpf_printk("DEQUEUE SPRIO with priority %d", prio);
return pkt;
Expand Down
8 changes: 6 additions & 2 deletions xdq-tester/sched_wfq.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ void *dequeue_prog(struct dequeue_ctx *ctx)
goto err;

flow->pkts--;
if (flow->pkts <= 0 && !flow->persistent)
bpf_map_delete_elem(&flow_states, &nt);
if (flow->pkts <= 0) {
if (!flow->persistent)
bpf_map_delete_elem(&flow_states, &nt);
else
flow->finish_bytes = 0;
}

virtual_time_bytes = prio;

Expand Down

0 comments on commit 65f86f1

Please sign in to comment.