From: Lukasz Wojciechowski Date: Sat, 17 Oct 2020 03:06:56 +0000 (+0200) Subject: distributor: fix scalar matching X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=626ceefbf4e1786ded4fed6a4987e3f1d370e9c0;p=dpdk.git distributor: fix scalar matching Fix improper indexes while comparing tags. In the find_match_scalar() function: * j iterates over flow tags of following packets; * w iterates over backlog or in flight tags positions. Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski Acked-by: David Hunt --- diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c index 6e3eae58f8..9fea3f69ab 100644 --- a/lib/librte_distributor/rte_distributor.c +++ b/lib/librte_distributor/rte_distributor.c @@ -259,13 +259,13 @@ find_match_scalar(struct rte_distributor *d, for (j = 0; j < RTE_DIST_BURST_SIZE ; j++) for (w = 0; w < RTE_DIST_BURST_SIZE; w++) - if (d->in_flight_tags[i][j] == data_ptr[w]) { + if (d->in_flight_tags[i][w] == data_ptr[j]) { output_ptr[j] = i+1; break; } for (j = 0; j < RTE_DIST_BURST_SIZE; j++) for (w = 0; w < RTE_DIST_BURST_SIZE; w++) - if (bl->tags[j] == data_ptr[w]) { + if (bl->tags[w] == data_ptr[j]) { output_ptr[j] = i+1; break; }