net/bonding: fix query-count flags not set

Message ID 20240103111035.361905-1-kuka@cesnet.cz (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/bonding: fix query-count flags not set |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing warning Testing issues

Commit Message

Mário Kuka Jan. 3, 2024, 11:10 a.m. UTC
  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

Ferruh Yigit Feb. 8, 2024, 10:27 p.m. UTC | #1
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.
  

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c
index 71a91675f7..5d0be5caf5 100644
--- a/drivers/net/bonding/rte_eth_bond_flow.c
+++ b/drivers/net/bonding/rte_eth_bond_flow.c
@@ -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;
 }