From patchwork Wed Jan 3 11:10:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?M=C3=A1rio_Kuka?= X-Patchwork-Id: 135705 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E29A1437DF; Wed, 3 Jan 2024 12:10:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 767B5402E9; Wed, 3 Jan 2024 12:10:45 +0100 (CET) Received: from office2.cesnet.cz (office2.cesnet.cz [78.128.248.237]) by mails.dpdk.org (Postfix) with ESMTP id D0907402BE for ; Wed, 3 Jan 2024 12:10:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2-2020; t=1704280242; bh=i0U2AEPAAWAtAdgJjb9nyQti/m4+VvdvOC7RzXFGppM=; h=From:To:Cc:Subject:Date; b=fnPdEYjvzxZXrQ2OJ+SdgdUTiNwH2d/V9Q4JM4zD9p9DxASspoJyimse4MJY2wQji N/D5pBkm6jblwZlpcKi89Q/xikKjTfJxrGYBBK8I570R3V8o3W9wZ8potnFEKopvTz oWulw+LO9Or0/U2RTk4dW4uCx+tY0y6eZfabW9gXMPiJV8mKiiuMJHyWyA4wyf6lVt LyyeojdONR9AE33FqG8f26KmhqZhakZ7eSQNSCxXxaDFDJxGsZd5pRxySbzkFJh2ai PrgNzvz4DvFRTaNxxG1/LdxjDTDWGLJHSzWaoi0Csaw+iEsjwIL59N44GOZXcsTK9v rjZYC6q6JS8Pw== Received: from ovs.liberouter.org (rt-tmc-kou.liberouter.org [195.113.172.126]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id C32DF118007D; Wed, 3 Jan 2024 12:10:37 +0100 (CET) From: =?utf-8?q?M=C3=A1rio_Kuka?= To: Chas Williams , "Min Hu (Connor)" , Declan Doherty , Matan Azrad Cc: dev@dpdk.org, =?utf-8?q?M=C3=A1rio_Kuka?= , matan@mellanox.com Subject: [PATCH] net/bonding: fix query-count flags not set Date: Wed, 3 Jan 2024 12:10:35 +0100 Message-Id: <20240103111035.361905-1-kuka@cesnet.cz> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Ferruh Yigit --- drivers/net/bonding/rte_eth_bond_flow.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; }