Skip to content

Commit

Permalink
[DEBUG] DO NOT MERGE: fix reclaim logic to be more aggressive
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Oct 15, 2019
1 parent 37913bc commit ad71d9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libknet/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ static void _reclaim_old_defrag_buf(struct knet_host *host, seq_num_t seq_num)
seq_num_t head, tail; /* circular buffer indexes */
int i;

head = seq_num + (KNET_MAX_LINK * 2);
tail = seq_num + 1;
head = seq_num + 1;
tail = seq_num - (KNET_MAX_LINK + 1);

/*
* expire old defrag buffers
Expand All @@ -579,12 +579,12 @@ static void _reclaim_old_defrag_buf(struct knet_host *host, seq_num_t seq_num)
* head has done a rollover to 0+
*/
if (tail > head) {
if ((host->defrag_buf[i].pckt_seq <= head) || (host->defrag_buf[i].pckt_seq >= tail)) {
if ((host->defrag_buf[i].pckt_seq >= head) && (host->defrag_buf[i].pckt_seq <= tail)) {
printf("BLA1: seq: %u head: %u tail: %u wipe: %u\n", seq_num, head, tail, host->defrag_buf[i].pckt_seq);
host->defrag_buf[i].in_use = 0;
}
} else {
if ((host->defrag_buf[i].pckt_seq <= head) && (host->defrag_buf[i].pckt_seq >= tail)){
if ((host->defrag_buf[i].pckt_seq >= head) || (host->defrag_buf[i].pckt_seq <= tail)){
printf("BLA2: seq: %u head: %u tail: %u wipe: %u\n", seq_num, head, tail, host->defrag_buf[i].pckt_seq);
host->defrag_buf[i].in_use = 0;
}
Expand Down

0 comments on commit ad71d9d

Please sign in to comment.