net/bonding: fix query-count flags not set
Checks
Commit Message
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: 49dad9028e2a ("net/bonding: support flow API")
Cc: matan@mellanox.com
Signed-off-by: Mário Kuka <kuka@cesnet.cz>
---
drivers/net/bonding/rte_eth_bond_flow.c | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On 1/3/2024 11:10 AM, Mário Kuka wrote:
> 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: 49dad9028e2a ("net/bonding: support flow API")
> Cc: matan@mellanox.com
>
> Signed-off-by: Mário Kuka <kuka@cesnet.cz>
>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
Applied to dpdk-next-net/main, thanks.
@@ -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(&member_count, count, sizeof(member_count));
for (i = 0; i < internals->member_count; i++) {
ret = rte_flow_query(internals->members[i].port_id,
@@ -192,8 +194,12 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
}
count->bytes += member_count.bytes;
count->hits += member_count.hits;
+ count->bytes_set |= member_count.bytes_set;
+ count->hits_set |= member_count.hits_set;
member_count.bytes = 0;
member_count.hits = 0;
+ member_count.bytes_set = 0;
+ member_count.hits_set = 0;
}
return 0;
}