diff mbox series

[ovs-dev,v5] netdev_offload_dpdk: Fix error decremented of hw-offload counters.

Message ID 20250822094621.1568-1-linda.wang@jaguarmicro.com
State Accepted
Delegated to: Kevin Traynor
Headers show
Series [ovs-dev,v5] netdev_offload_dpdk: Fix error decremented of hw-offload counters. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/cirrus-robot success cirrus build: passed
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Linda Wang Aug. 22, 2025, 9:46 a.m. UTC
Fixes: 0e6366c2399d ("netdev-offload-dpdk: Implement hw-offload statistics read.")

Signed-off-by: Linda Wang <linda.wang@jaguarmicro.com>

---
 If the device is a vport, the following steps occur:
 1.netdev_offload_dpdk_add_flow()->netdev_offload_dpdk_actions(patterns.physdev)
   ->netdev_offload_dpdk_flow_create()->data->rte_flow_counters[tid]++.
   The incremented of hardware offload counters use physdev in the code.
 2.The decremented of hardware offload counters use netdev.
   In this case, when all the flow tables are deleted, the hw-offload statistics   shows an incorrect value.
---
 lib/netdev-offload-dpdk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kevin Traynor Sept. 2, 2025, 8:52 a.m. UTC | #1
On 22/08/2025 10:46, Linda Wang via dev wrote:
> Fixes: 0e6366c2399d ("netdev-offload-dpdk: Implement hw-offload statistics read.")
> 
> Signed-off-by: Linda Wang <linda.wang@jaguarmicro.com>
> 
> ---
>  If the device is a vport, the following steps occur:
>  1.netdev_offload_dpdk_add_flow()->netdev_offload_dpdk_actions(patterns.physdev)
>    ->netdev_offload_dpdk_flow_create()->data->rte_flow_counters[tid]++.
>    The incremented of hardware offload counters use physdev in the code.
>  2.The decremented of hardware offload counters use netdev.
>    In this case, when all the flow tables are deleted, the hw-offload statistics   shows an incorrect value.
> ---
>  lib/netdev-offload-dpdk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
> index 6ca271489..08740a27a 100644
> --- a/lib/netdev-offload-dpdk.c
> +++ b/lib/netdev-offload-dpdk.c
> @@ -2375,7 +2375,7 @@ netdev_offload_dpdk_flow_destroy(struct ufid_to_rte_flow_data *rte_flow_data)
>          unsigned int tid = netdev_offload_thread_id();
>  
>          data = (struct netdev_offload_dpdk_data *)
> -            ovsrcu_get(void *, &netdev->hw_info.offload_data);
> +            ovsrcu_get(void *, &physdev->hw_info.offload_data);
>          data->rte_flow_counters[tid]--;
>  
>          VLOG_DBG_RL(&rl, "%s/%s: rte_flow 0x%"PRIxPTR

Thanks Linda. I updated the commit title/description and applied on main
branch down to branch-3.3.

I also added you to the AUTHORS.rst - welcome :-)

Best regards,
Kevin.
diff mbox series

Patch

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 6ca271489..08740a27a 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -2375,7 +2375,7 @@  netdev_offload_dpdk_flow_destroy(struct ufid_to_rte_flow_data *rte_flow_data)
         unsigned int tid = netdev_offload_thread_id();
 
         data = (struct netdev_offload_dpdk_data *)
-            ovsrcu_get(void *, &netdev->hw_info.offload_data);
+            ovsrcu_get(void *, &physdev->hw_info.offload_data);
         data->rte_flow_counters[tid]--;
 
         VLOG_DBG_RL(&rl, "%s/%s: rte_flow 0x%"PRIxPTR