From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 084C6A00E6 for ; Fri, 14 Jun 2019 09:53:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 015401D4E2; Fri, 14 Jun 2019 09:53:57 +0200 (CEST) Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 037811D3F5 for ; Fri, 14 Jun 2019 09:53:55 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id 190so1191209vsf.9 for ; Fri, 14 Jun 2019 00:53:55 -0700 (PDT) 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=WBiyyp8kkEM+MZlfpXPxT7YNcde9rbX6Y1asHpwIepw=; b=Tn93rtXML1ztDu1yvKA8k9HRE7QfK+lAhwrt05Fj7PGk4rzRGhFBCmnZqgR3AvM/Ds F0feZYA4kEJb2+aBJqjxiGsFrL822jvOiCdJBGTUF7DJxWwSNhSbjyO89FQl/xgIjD85 7GDdVQPD8huXDhiEBFgYeKMaF03LZcNrCiLxmekV1yLRv0e/aCSWS4AHTtn5EKEKjTsI bBKU/zX9ZTCL8Zm/Rrg0j2iKHe9c6g00Ev6BEEtMubYLKfMW5HotbQAzxU3yc07n5sPz A1MbQmQW/FF2APXjL04hm6UPy+foTxfZdHcHdmo9dk6PZOxUr2MhxAdyB2dGZoAibebp pHBg== X-Gm-Message-State: APjAAAW8ZgZgBkB15yhxrUIulRIbIfd+9QUjV+PbJfa3WFTXjirNHvQR NFo2KXyKaCnXV0kPbR/MMccNQ8FPc7GjgW/DIFy4dQ== X-Google-Smtp-Source: APXvYqyqHUkDyRXTBhQN9uo4erMbSsx0VRJwILcZXeyz/ZwtNmNG/mSF2Hu3yGaPFNcjXEJX2fIOtvX8roewWbB51pg= X-Received: by 2002:a67:f998:: with SMTP id b24mr41149535vsq.180.1560498835394; Fri, 14 Jun 2019 00:53:55 -0700 (PDT) MIME-Version: 1.0 References: <20190604000431.28763-1-stephen@networkplumber.org> In-Reply-To: <20190604000431.28763-1-stephen@networkplumber.org> From: David Marchand Date: Fri, 14 Jun 2019 09:53:44 +0200 Message-ID: To: Stephen Hemminger Cc: tomaszx.kulasek@intel.com, dev , Stephen Hemminger Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] examples/multi_process - fix crash in mp_client with sparse ports X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jun 4, 2019 at 2:05 AM Stephen Hemminger wrote: > From: Stephen Hemminger > > The mp_client crashes if run on Azure or any system where ethdev > ports are owned. In that case, the tx_buffer and tx_stats for the > real port were initialized correctly, but the wrong port was used. > > For example if the server has Ports 3 and 5. Then calling > rte_eth_tx_buffer_flush on any other buffer will dereference null > because the tx buffer for that port was not allocated. > > Fixes: e2366e74e029 ("examples: use buffered Tx") > Signed-off-by: Stephen Hemminger > --- > examples/multi_process/client_server_mp/mp_client/client.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/examples/multi_process/client_server_mp/mp_client/client.c > b/examples/multi_process/client_server_mp/mp_client/client.c > index c23dd3f378f7..c1d2d975b717 100644 > --- a/examples/multi_process/client_server_mp/mp_client/client.c > +++ b/examples/multi_process/client_server_mp/mp_client/client.c > @@ -246,15 +246,16 @@ main(int argc, char *argv[]) > > for (;;) { > uint16_t i, rx_pkts; > - uint16_t port; > > rx_pkts = rte_ring_dequeue_burst(rx_ring, pkts, > PKT_READ_SIZE, NULL); > > if (unlikely(rx_pkts == 0)){ > if (need_flush) > - for (port = 0; port < ports->num_ports; > port++) { > - sent = > rte_eth_tx_buffer_flush(ports->id[port], client_id, > + for (i = 0; i < ports->num_ports; i++) { > + uint16_t port = ports->id[i]' > Syntax error. + > + sent = > rte_eth_tx_buffer_flush(ports, client_id, > Not sure passing ports is intended. tx_buffer[port]); > if (unlikely(sent)) > tx_stats->tx[port] += sent; > > -- David Marchand