From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 40BEEA0540 for ; Mon, 13 Jul 2020 08:32:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A64E31C434; Mon, 13 Jul 2020 08:32:13 +0200 (CEST) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by dpdk.org (Postfix) with ESMTP id 954D01C1AB for ; Mon, 13 Jul 2020 08:32:12 +0200 (CEST) Received: by mail-lf1-f54.google.com with SMTP id d21so7844366lfb.6 for ; Sun, 12 Jul 2020 23:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6yRQ1xwCjBBu+UtIb5lTrJMzDvheq2gCk17N8kCujCQ=; b=coQfRps4xczHWd7sraPHoVt50Uj2nX7rBSqSkPTC7Mr+G1zXlnAXeOCSH5MgMPWU6r l06jMQ7ss9z/63jFmlTiUeSJkutah97EVnYQpNCgIekVIZ2QnbKff8fo1t4nrxNBgmIe LTKHCyv9vJjU5aYxXLH4bLXD3NX+cE/n9K1ZQTQRPwP1rSuM2DSI+3EMeTls6JrrjfHf EJxaq9+fomeEVOxAjmMxgDKy/OitmI/2YqpY1UG8deutBiAPBdFbGeXujsb8a/BAcptW u3a76fwfQJDnhHzrNffSkqN4vfxqxPV7N4lrGLPe+wOAJ0Gz438eOonpyVJ4U0/98ZCi 0TSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6yRQ1xwCjBBu+UtIb5lTrJMzDvheq2gCk17N8kCujCQ=; b=PddjImqtSSVVvntvfx7KMf7Vq5INFnLREqjye1Ry+e/Hbw1mmEnwwKSX3nUtr9oWzU L/OuaUnCRbdmR0YEKfKp0w9hmBcJaA3JfvXoDDjwhLNrd6xMfd56Zf/syBfhRXmnQI3E gVyxd5lCr/s+bzvqqRslehRMHSL/zpHPaIHiNjULCI7FluePQUBAncHO7eHEITm/66nR gn8Wi4ZVMb0F9EaZWQ8IoJjPbXWENUKp0QsKAQwxk8kKxmlnYCrvHGOXnVqDLUbTm1nW uQb0op7Gq+M25Pb0qMga/6BFDC86sgPUApSHM/XxoYx9x+OTMFWsLpHj6j2n3Z+CbS2n UXBg== X-Gm-Message-State: AOAM532NMBp22C1tX91BCD6YTCIUBDh5UthNIslYAqX5TM0Pd9v1jO9G SHBMnB7pEHWn+s191Pc+On8Xr5UuIXAWX4XYKz4= X-Google-Smtp-Source: ABdhPJzWCStsNE8+aBvwHHOi29zaXMM4Ab9YgwbTUe3GcCSxKcc92Zb1eXQgJy76JsvVCScTDOpYh/MkQ8ZjKrm6WJw= X-Received: by 2002:ac2:4db2:: with SMTP id h18mr52055286lfe.167.1594621932153; Sun, 12 Jul 2020 23:32:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Manish Kumar Date: Sun, 12 Jul 2020 23:32:01 -0700 Message-ID: To: Suraj R Gupta Cc: Bev SCHWARTZ , "users@dpdk.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] Significant performance degradation when using tx buffers rather than rte_eth_tx_burst X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" I agree with Suraj on the same. @Bev : Were you trying to use rte_eth_tx_buffer function as part of just an experiment ? As per your email you already got performance with the rte_eth_tx_burst function. Regards Manish On Wed, Jul 8, 2020 at 1:42 PM Suraj R Gupta wrote: > Hi bev, > If my understanding is right, rte_eth_tx_burst transmits output packets > immediately with a specified number of packets. > While, 'rte_eth_tx_buffer' buffers the packet in the queue of the port, > the packets would be transmitted only when buffer is or > rte_eth_tx_buffer_flush is called. > Since you are buffering packets one by one and then you are calling flush, > this may have contributed to the delay. > Thanks and Regards > Suraj R Gupta > > > On Wed, Jul 8, 2020 at 10:53 PM Bev SCHWARTZ > wrote: > > > I am writing a bridge using DPDK, where I have traffic read from one port > > transmitted to the other. Here is the core of the program, based on > > basicfwd.c. > > > > while (!force_quit) { > > nb_rx = rte_eth_rx_burst(rx_port, rx_queue, bufs, BURST_SIZE); > > for (i = 0; i < nb_rx; i++) { > > /* inspect packet */ > > } > > nb_tx = rte_eth_tx_burst(tx_port, tx_queue, bufs, nb_rx); > > for (i = nb_tx; i < nb_rx; i++) { > > rte_pktmbuf_free(bufs[i]); > > } > > } > > > > (A bunch of error checking and such left out for brevity.) > > > > This worked great, I got bandwidth equivalent to using a Linux Bridge. > > > > I then tried using tx buffers instead. (Initialization code left out for > > brevity.) Here is the new loop. > > > > while (!force_quit) { > > nb_rx = rte_eth_rx_burst(rx_port, rx_queue, bufs, BURST_SIZE); > > for (i = 0; i < nb_rx; i++) { > > /* inspect packet */ > > rte_eth_tx_buffer(tx_port, tx_queue, tx_buffer, bufs[i]); > > } > > rte_eth_tx_buffer_flush(tx_port, tx_queue, tx_buffer); > > } > > > > (Once again, error checking left out for brevity.) > > > > I am running this on 8 cores, each core has its own loop. (tx_buffer is > > created for each core.) > > > > If I have well balanced traffic across the cores, then my performance > goes > > down, about 5% or so. If I have unbalanced traffic such as all traffic > > coming from a single flow, my performance goes down 80% from about 10 gbs > > to 2gbs. > > > > I want to stress that the ONLY thing that changed in this code is > changing > > how I transmit packets. Everything else is the same. > > > > Any idea why this would cause such a degradation in bit rate? > > > > -Bev > > > > -- > Thanks and Regards > Suraj R Gupta > -- Thanks Manish Kumar