From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id 65A8D5A51 for ; Tue, 16 Aug 2016 22:53:54 +0200 (CEST) Received: by mail-pa0-f46.google.com with SMTP id i5so29649886pat.2 for ; Tue, 16 Aug 2016 13:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bYQmJSIzNTR4UD5lqCEGafNbh6YtIBz6kIkz781xZnc=; b=UF7UZiN5KdvBUKGPiRFmll3NsPDAN3ZdmhRfPsmaOS3dbzbfJsejCHeURW+BCi6Nij BqVPfkpzc9TUmJCXEOjvZZx1OVbmkFp6Jv/XYqFVCodhULbWL/SX2M/zsWb1pX5z2tsj W9KZkVq2jo4ZnV300q01NgWkEQcs4ybjQoVPGgm73h2bi5HoT8wOrq6dAqnx3OlwSukl x7IMCtF7bwXT0bOtkTcg30+IKW1y9oVdd9hRZUBR1fduraqE0U3s8/mrNmhzFhHp9QgU jol77oKCTfCX/lnFC5elRCDYHDlSVFud4l/ZBabSD+BY6T0qrEe4EWBgnRsru8q0HdA8 uX3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bYQmJSIzNTR4UD5lqCEGafNbh6YtIBz6kIkz781xZnc=; b=DY8/+l24Yxzt6WeRQMIMNEf14znhzWkmI/5POrKamyS6+KaIOf8El0ayBbPZ63IWG6 IjIR6ZJTQ5BioWtQfm1a0QQCtfIfjxm4ORfEcNQxuP0AkNczuUWJ2kwZBtshbifEI6q0 Una8Y/zMjRbjfbS4CawVlr3C9qZOUE3P0ymXC+jZPrMQyV8Fzv6LxxIouLYbSXTTR360 TwEeIuYmxHiuDW74hKXo4KK1Oki5lm5ptNeAOPwayJ7EFrAGwLM/jPDFpLfvwKIaWxFn 4Q1xrg+c3m5PPzqehmi4H67HVspUhpFSRWS9PLbVrFuT9QgqyWOG9JG+ffwteqMsI/8L YFUQ== X-Gm-Message-State: AEkoousDCcsK/2NcF4Xw4NGcYIlfM9D0vvTeqlbx3i1w6QxWXkRgZvaSDi6gwS7vL0P0xQ== X-Received: by 10.66.182.232 with SMTP id eh8mr68020253pac.146.1471380833567; Tue, 16 Aug 2016 13:53:53 -0700 (PDT) Received: from xeon-e3 (static-50-53-69-251.bvtn.or.frontiernet.net. [50.53.69.251]) by smtp.gmail.com with ESMTPSA id c125sm41491011pfc.40.2016.08.16.13.53.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Aug 2016 13:53:53 -0700 (PDT) Date: Tue, 16 Aug 2016 13:54:01 -0700 From: Stephen Hemminger To: Maik Pfeil Cc: users@dpdk.org Message-ID: <20160816135401.0032c1f8@xeon-e3> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-users] Using rte_eth_tx_burst in a loop with sleep() X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2016 20:53:54 -0000 On Tue, 16 Aug 2016 22:47:06 +0200 Maik Pfeil wrote: > Hi, > > if I am using rte_eth_tx_burst() in a loop: > > for(;;) { > count_tx = rte_eth_tx_burst(0, 0, frame_burst, 9); > sleep(1); > ltime=time(NULL); > printf("%s", asctime(localtime(<ime))); > printf("`-- Sent %d packets.\n", asctime(localtime(<ime)), > count_tx); > } > > The array frame_burst[] is filled with 10 packets. > > I would expect to send every 1 second 10 frames. > > But after first 10 packets sent out and 1 second sleep, DPDK starts sending > out around 10k pps. > > Do you have any idea how to solve? When you pass frame_burst array to the device driver, the ownership of the mbuf's changes and after sending, the device driver will free them. Therefore you need to either: create a new set of mbufs into frame_burst array for each iteration; or increase the reference count on each mbuf in the frame_burst array before sending.