From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by dpdk.org (Postfix) with ESMTP id 69D54C420 for ; Fri, 24 Jul 2015 14:59:06 +0200 (CEST) Received: by wibxm9 with SMTP id xm9so26948315wib.1 for ; Fri, 24 Jul 2015 05:59:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=6pPct8VyzMsI7QqL6x2G42k+35/evA0i9Onn0jUNi9s=; b=EF/WMI99Sf5XtQvlF2erfexfJb5U2y6TYbtNwPdSf5/2MHxV5pw0ISj92RXJwcGJVe 36PLPYxrnmV/MxYY0/xEiD5ogPUEezhvy6ilcZsRhLpvF7kw9Zr/8h1BlzorQMvSTgBW tzHLI3M6kM8dSgrep1aREceZob05qDDVV2a/PgZP2KnkoDg1LjlgyIifdpFDh1KVfomC v7q6pBHbH6/IWgDdbLVpsA5KJtgUt3fBjrTCwULAuGR3ENZHoSUVgWWLXR5E+hs9raB/ lOiPZFUcovoLJvW9B/GbmRFTj1pqKDbC6H1AyZSxIo/T9QRz/PxfSywxkl5R0013VPna 2ETw== X-Gm-Message-State: ALoCoQmRxr4lZ2xVcXE7hdRwIQeKfNQ0xSi0sD1VzmL1r4AwZWWrqLEomYfFwy8Pqok+npdxCepV X-Received: by 10.194.60.131 with SMTP id h3mr26351331wjr.156.1437742745988; Fri, 24 Jul 2015 05:59:05 -0700 (PDT) Received: from [192.168.0.101] ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id ib9sm12584138wjb.2.2015.07.24.05.59.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2015 05:59:05 -0700 (PDT) Message-ID: <55B2369A.6040006@linaro.org> Date: Fri, 24 Jul 2015 13:59:06 +0100 From: Zoltan Kiss User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ciprian Barbu , wenzhuo.lu@intel.com References: <1437732789-40397-1-git-send-email-ciprian.barbu@linaro.org> In-Reply-To: <1437732789-40397-1-git-send-email-ciprian.barbu@linaro.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [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 12:59:06 -0000 Hi, On 24/07/15 11:13, Ciprian Barbu wrote: > 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) I think the proper solution for this will be to introduce an explicit API which makes it possible for the application to call the actual PMD's callback function, which flushes out the completed buffers from the TX ring, if possible. Then in case of igb it could be a noop. See the discussion in this thread: http://dpdk.org/ml/archives/dev/2015-June/018487.html I'll plan to propose such API, but it won't be in the very near future, as 2.1 will come out soon and no new features accepted at the moment. For the short term we can introduce a check in ODP-DPDK, which avoids this rte_eth_tx_burst(..., 0) call if the PMD is igb. How about that? > > 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(); > >