Skip to content

Commit

Permalink
net/bonding: fix flow count query
Browse files Browse the repository at this point in the history
[ upstream commit 02a2accb5f54183d448edf35902b71023ab908ac ]

The rte_flow_query_count structure returned from the bonding driver
always indicates that hits and bytes are invalid (bytes_set and
hits_set flags are zero) because bond_flow_query_count() from the
net/bonding driver does not set the bytes_set and hits_set flags.

Fixes: 49dad90 ("net/bonding: support flow API")

Signed-off-by: Mário Kuka <kuka@cesnet.cz>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
Mário Kuka authored and bluca committed Mar 7, 2024
1 parent 3bd1206 commit 32bf2f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/bonding/rte_eth_bond_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,

count->bytes = 0;
count->hits = 0;
count->bytes_set = 0;
count->hits_set = 0;
rte_memcpy(&slave_count, count, sizeof(slave_count));
for (i = 0; i < internals->slave_count; i++) {
ret = rte_flow_query(internals->slaves[i].port_id,
Expand All @@ -192,8 +194,12 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
}
count->bytes += slave_count.bytes;
count->hits += slave_count.hits;
count->bytes_set |= slave_count.bytes_set;
count->hits_set |= slave_count.hits_set;
slave_count.bytes = 0;
slave_count.hits = 0;
slave_count.bytes_set = 0;
slave_count.hits_set = 0;
}
return 0;
}
Expand Down

0 comments on commit 32bf2f2

Please sign in to comment.