From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx-3.enea.com (sestofw01.enea.se [192.36.1.252]) by dpdk.org (Postfix) with SMTP id F2DDD2716 for ; Fri, 24 Jul 2015 12:13:11 +0200 (CEST) Received: from sestofb10.enea.se (172.21.3.145) by smtp.enea.com (172.21.1.209) with Microsoft SMTP Server id 14.3.224.2; Fri, 24 Jul 2015 12:13:10 +0200 Received: by sestofb10.enea.se (Postfix, from userid 4272) id 3376528E77D; Fri, 24 Jul 2015 12:13:11 +0200 (CEST) From: Ciprian Barbu To: Date: Fri, 24 Jul 2015 12:13:09 +0200 Message-ID: <1437732789-40397-1-git-send-email-ciprian.barbu@linaro.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: SoftFail (SESTOEX03.enea.se: domain of transitioning ciprian.barbu@linaro.org discourages use of 172.21.3.145 as permitted sender) Cc: dev@dpdk.org Subject: [dpdk-dev] [RFC] l2fwd: trying to expose eth_igb_xmit_pkts unusual behavior X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 10:13:12 -0000 From: Ciprian Barbu This tries to show an approximate behavior described in an earlier discussion called "can eth_igb_xmit_pkts called with len 0 affect transmission?" I'm using Intel i350 dual port 1Gb card and I've tweaked the pool size to the minimum possible. But unmodified l2fwd still worked withouth a sweat. After applying this patch transmission stopped after maybe 30 seconds. Lowering the 'magic' number causes l2fwd to stop sending packets even earlier. Using gdb I could see eth_igb_xmit_pkts always returning because nb_tx was 0 and E1000_TXD_STAT_DD was not set (approx igb_rxtx.c : 476) Signed-off-by: Ciprian Barbu --- examples/l2fwd/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 17621ee..623b836 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -72,7 +72,7 @@ #define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1 #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) -#define NB_MBUF 8192 +#define NB_MBUF 1024 #define MAX_PKT_BURST 32 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -260,7 +260,7 @@ l2fwd_main_loop(void) struct rte_mbuf *m; unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc, timer_tsc; - unsigned i, j, portid, nb_rx; + unsigned i, j, portid, nb_rx, magic = 0; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -285,6 +285,15 @@ l2fwd_main_loop(void) } while (1) { + if (++magic == 50000) { + magic = 0; + l2fwd_send_burst(&lcore_queue_conf[lcore_id], + 0, + (uint8_t) 0); + l2fwd_send_burst(&lcore_queue_conf[lcore_id], + 0, + (uint8_t) 1); + } cur_tsc = rte_rdtsc(); -- 1.9.1