diff mbox series

[ovs-dev,v2] netdev-dpdk: add mempool count in cmd get-mempool-info

Message ID 20220125094125.33915-1-wanjunjie@bytedance.com
State Accepted
Commit 9016592ca09043d5c10f424fb6c8717f270fdfaf
Headers show
Series [ovs-dev,v2] netdev-dpdk: add mempool count in cmd get-mempool-info | expand

Checks

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

Commit Message

Wan Junjie Jan. 25, 2022, 9:41 a.m. UTC
The ```rte_mempool_avail_count``` and ```rte_mempool_in_use_count```
can tell us the usage of the mempool. It could be helpful for debug
on any memleak in the mempool.
Add a line in the cmd's output.
- Count: avail (118988), in use (12084)

Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Wan Junjie <wanjunjie@bytedance.com>
---
v2: remove prefix '-' from output
---
 lib/netdev-dpdk.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Kevin Traynor Jan. 25, 2022, 11:41 a.m. UTC | #1
On 25/01/2022 09:41, Wan Junjie wrote:
> The ```rte_mempool_avail_count``` and ```rte_mempool_in_use_count```
> can tell us the usage of the mempool. It could be helpful for debug
> on any memleak in the mempool.
> Add a line in the cmd's output.
> - Count: avail (118988), in use (12084)
> 

Hi Wan Junjie, Not important, but just fyi, for consistency with other 
commit messages and to match the v2 output, the commit message could be 
like below. If you agree, then probably the maintainers can update it 
when applying.

Either way, thanks for the improvement.

Acked-by: Kevin Traynor <ktraynor@redhat.com>

--
netdev-dpdk: Add mempool count in cmd get-mempool-info.

The rte_mempool_avail_count() and rte_mempool_in_use_count() DPDK API
can tell us the usage of the mempool. It could be helpful for debug
on any memleak in the mempool.

Add a line in the cmd's output:
     count: avail (118988), in use (12084)


> Acked-by: Aaron Conole <aconole@redhat.com>
> Signed-off-by: Wan Junjie <wanjunjie@bytedance.com>
> ---
> v2: remove prefix '-' from output
> ---
>   lib/netdev-dpdk.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index b6b29c75e..334e348fc 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -3864,6 +3864,9 @@ netdev_dpdk_get_mempool_info(struct unixctl_conn *conn,
>           ovs_mutex_lock(&dpdk_mp_mutex);
>   
>           rte_mempool_dump(stream, dev->dpdk_mp->mp);
> +        fprintf(stream, "    count: avail (%u), in use (%u)\n",
> +                rte_mempool_avail_count(dev->dpdk_mp->mp),
> +                rte_mempool_in_use_count(dev->dpdk_mp->mp));
>   
>           ovs_mutex_unlock(&dpdk_mp_mutex);
>           ovs_mutex_unlock(&dev->mutex);
>
Ilya Maximets March 4, 2022, 11:10 p.m. UTC | #2
On 1/25/22 12:41, Kevin Traynor wrote:
> On 25/01/2022 09:41, Wan Junjie wrote:
>> The ```rte_mempool_avail_count``` and ```rte_mempool_in_use_count```
>> can tell us the usage of the mempool. It could be helpful for debug
>> on any memleak in the mempool.
>> Add a line in the cmd's output.
>> - Count: avail (118988), in use (12084)
>>
> 
> Hi Wan Junjie, Not important, but just fyi, for consistency with other commit messages and to match the v2 output, the commit message could be like below. If you agree, then probably the maintainers can update it when applying.
> 
> Either way, thanks for the improvement.
> 
> Acked-by: Kevin Traynor <ktraynor@redhat.com>
> 
> -- 
> netdev-dpdk: Add mempool count in cmd get-mempool-info.
> 
> The rte_mempool_avail_count() and rte_mempool_in_use_count() DPDK API
> can tell us the usage of the mempool. It could be helpful for debug
> on any memleak in the mempool.
> 
> Add a line in the cmd's output:
>     count: avail (118988), in use (12084)

Thanks!  Applied.

Best regards, Ilya Maximets.

> 
> 
>> Acked-by: Aaron Conole <aconole@redhat.com>
>> Signed-off-by: Wan Junjie <wanjunjie@bytedance.com>
>> ---
>> v2: remove prefix '-' from output
>> ---
>>   lib/netdev-dpdk.c | 3 +++
>>   1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index b6b29c75e..334e348fc 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -3864,6 +3864,9 @@  netdev_dpdk_get_mempool_info(struct unixctl_conn *conn,
         ovs_mutex_lock(&dpdk_mp_mutex);
 
         rte_mempool_dump(stream, dev->dpdk_mp->mp);
+        fprintf(stream, "    count: avail (%u), in use (%u)\n",
+                rte_mempool_avail_count(dev->dpdk_mp->mp),
+                rte_mempool_in_use_count(dev->dpdk_mp->mp));
 
         ovs_mutex_unlock(&dpdk_mp_mutex);
         ovs_mutex_unlock(&dev->mutex);