[v3] dumpcap: fix mbuf pool ring type

Message ID 20231108174738.185933-1-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v3] dumpcap: fix mbuf pool ring type |

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/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Stephen Hemminger Nov. 8, 2023, 5:47 p.m. UTC
  The internal buffer pool used for copies of mbufs captured
needs to be thread safe.  If capturing on multiple interfaces
or multiple queues, the same pool will be used (consumers).
And if the capture ring gets full, the queues will need
to put back the capture buffer which leads to multiple producers.

Bugzilla ID: 1271
Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
v3 - just change ops, don't use default pool ops

 app/dumpcap/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Morten Brørup Nov. 9, 2023, 7:21 a.m. UTC | #1
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Wednesday, 8 November 2023 18.48
> 
> The internal buffer pool used for copies of mbufs captured
> needs to be thread safe.  If capturing on multiple interfaces
> or multiple queues, the same pool will be used (consumers).
> And if the capture ring gets full, the queues will need
> to put back the capture buffer which leads to multiple producers.
> 
> Bugzilla ID: 1271
> Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---

Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
  
Thomas Monjalon Nov. 12, 2023, 2:05 p.m. UTC | #2
09/11/2023 08:21, Morten Brørup:
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Wednesday, 8 November 2023 18.48
> > 
> > The internal buffer pool used for copies of mbufs captured
> > needs to be thread safe.  If capturing on multiple interfaces
> > or multiple queues, the same pool will be used (consumers).
> > And if the capture ring gets full, the queues will need
> > to put back the capture buffer which leads to multiple producers.
> > 
> > Bugzilla ID: 1271
> > Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>

Applied, thanks.
  

Patch

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 64294bbfb3e6..4f581bd341d8 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -694,7 +694,7 @@  static struct rte_mempool *create_mempool(void)
 	mp = rte_pktmbuf_pool_create_by_ops(pool_name, num_mbufs,
 					    MBUF_POOL_CACHE_SIZE, 0,
 					    data_size,
-					    rte_socket_id(), "ring_mp_sc");
+					    rte_socket_id(), "ring_mp_mc");
 	if (mp == NULL)
 		rte_exit(EXIT_FAILURE,
 			 "Mempool (%s) creation failed: %s\n", pool_name,