From 8c089ecc0bb98486ec06306ef5312dbee8347e52 Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Tue, 10 Mar 2015 17:29:53 +0300 Subject: [PATCH] We should use number of threads equal to number ot NIC rings --- netmap_plugin/netmap_collector.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/netmap_plugin/netmap_collector.cpp b/netmap_plugin/netmap_collector.cpp index e1abd95b..f4525f48 100644 --- a/netmap_plugin/netmap_collector.cpp +++ b/netmap_plugin/netmap_collector.cpp @@ -134,6 +134,12 @@ void receiver(void) { logger.info("Mapped %dKB memory at %p", netmap_descriptor->req.nr_memsize>>10, netmap_descriptor->mem); logger.info("We have %d tx and %d rx rings", netmap_descriptor->req.nr_tx_rings, netmap_descriptor->req.nr_rx_rings); + if (num_cpus > netmap_descriptor->req.nr_rx_rings) { + num_cpus = netmap_descriptor->req.nr_rx_rings; + + logger.info("We have number of CPUs bigger than number of NIC RX queues. Set number of CPU's to number of threads"); + } + /* protocol stack and may cause a reset of the card, which in turn may take some time for the PHY to @@ -165,7 +171,7 @@ void receiver(void) { struct nm_desc* new_nmd = nm_open(interface.c_str(), NULL, nmd_flags | NM_OPEN_IFNAME | NM_OPEN_NO_MMAP, &nmd); if (new_nmd == NULL) { - logger.error("Can't open netmap descriptor for netmap"); + logger.error("Can't open netmap descriptor for netmap per nardware queue thread"); exit(1); }