From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id CB8351B70C for ; Fri, 10 Nov 2017 17:10:24 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id l8so9001701wre.12 for ; Fri, 10 Nov 2017 08:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oIlROpwPVv+EzYEBFsB7nElba7MqrnnC+tGaj6syaWk=; b=QoxeNmBtVbDZO9Hj/UXp49jZam+u2Qhct07sGVD3+V14SgPggPvrjGqje88YWgBw42 kga7Xmjr1JusFBpxs+g/EuHV5xUkt/lDoHdtKeZLri+b4JIqWwKPzgQPdH9WdL7h/xhV Z0Ez4OvE/nfOcajrVqUT2VCs3pqvSnUMmgt9Tajc8oLEu8vtAxStSiQDhIMhyYs8lXK2 gMS0+PKheH/TSQBWwNDjq85GSDFCbVNCq3/XCd77gEhz1ysLRASxFJdExaHPPMsdlic0 FinEPy0DDALCV5TNuoNqCMQlavdzCmR4pHBWF6bKbEPvficHJDBt91Am1tzetGYRnk0F 3BhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oIlROpwPVv+EzYEBFsB7nElba7MqrnnC+tGaj6syaWk=; b=JmIcUHrA6AhsR+DfoEn2vXQtvyFXN4my7CqBEiRTNeRBqMSoYILhkHQhUimD0p83yV a5ylwJw9iHJxtBkSszLGYrIEjmYooxbWXt8LkPc7iOPVk0vnCRmKc1cS/WDCIiQz2Z// 4C/JM+C2TGq0tIb6WazOpZF2iEUraTVUqcvndFXehYkcPKekG6w6+MLdhBbSbioiKuNS eqMYAVIKoBJTDHuonjVMQwC5H35Aa/csxSf0ENpT5GZxTaeVs7w5zPuNj/vEzReYnqrm ZlDDiH8yajgdA0AskI8hOQGWznLlIspEm0ity1guWwilNom4AXfBnoD3d9cHpcLQi9G7 NOYg== X-Gm-Message-State: AJaThX6Oqaat5RNgHuothMiYXfYqgm9FWK1bva79u3j5SJM1FEusTM6a yHO1WqVgEDk0WtdTaNceUYDsTcgVap8= X-Google-Smtp-Source: AGs4zMY55o8cwKxRzyMzRneLV1XfwV2H2MvVxBTWvee/+oOv6n3tQfUfNSWHUfoCRexKRj+BuF/asw== X-Received: by 10.223.161.158 with SMTP id u30mr686880wru.199.1510330224503; Fri, 10 Nov 2017 08:10:24 -0800 (PST) Received: from localhost ([2a00:23c5:bef3:400:4a51:b7ff:fe0b:4749]) by smtp.gmail.com with ESMTPSA id f84sm2569962wmh.47.2017.11.10.08.10.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Nov 2017 08:10:23 -0800 (PST) From: luca.boccassi@gmail.com To: Daniel Mrzyglod Cc: Michal Jastrzebski , dpdk stable Date: Fri, 10 Nov 2017 16:09:54 +0000 Message-Id: <20171110161000.15369-10-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171110161000.15369-1-luca.boccassi@gmail.com> References: <20171102120247.10565-18-luca.boccassi@gmail.com> <20171110161000.15369-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'test/pmd_perf: fix crash with multiple devices' has been queued to LTS release 16.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 16:10:25 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/17. So please shout if anyone has objections. Thanks. Kind regards, Luca Boccassi --- >>From a2dbf2c661dfbe1a1f92af7124ec5b199b064d98 Mon Sep 17 00:00:00 2001 From: Daniel Mrzyglod Date: Fri, 27 Oct 2017 18:24:08 +0200 Subject: [PATCH] test/pmd_perf: fix crash with multiple devices [ upstream commit 7fd72d49ea789d35230f2f4f28a27baa1164c68c ] Error can be reproduce if we run pmd_perf_autotest with more then one device in such way: RTE>>set_rxtx_sc poll_before_xmit RTE>>pmd_perf_autotest if first burst was value less than MAX_PKT_BURST in the end we overwrite pkts_burst table for rx which was supposed for another interface. Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx") Signed-off-by: Daniel Mrzyglod Acked-by: Michal Jastrzebski --- app/test/test_pmd_perf.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index 1ffd65a52..afab180f9 100644 --- a/app/test/test_pmd_perf.c +++ b/app/test/test_pmd_perf.c @@ -572,6 +572,7 @@ poll_burst(void *args) unsigned i, portid, nb_rx = 0; uint64_t total; uint64_t timeout = MAX_IDLE; + int num[RTE_MAX_ETHPORTS]; lcore_id = rte_lcore_id(); conf = &lcore_conf[lcore_id]; @@ -591,6 +592,7 @@ poll_burst(void *args) for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; next[portid] = i * pkt_per_port; + num[portid] = pkt_per_port; } while (!rte_atomic64_read(&start)) @@ -601,8 +603,8 @@ poll_burst(void *args) for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, - &pkts_burst[next[portid]], - MAX_PKT_BURST); + &pkts_burst[next[portid]], + RTE_MIN(MAX_PKT_BURST, num[portid])); if (unlikely(nb_rx == 0)) { timeout--; if (unlikely(timeout == 0)) @@ -610,6 +612,7 @@ poll_burst(void *args) continue; } next[portid] += nb_rx; + num[portid] -= nb_rx; total -= nb_rx; } } @@ -618,7 +621,6 @@ timeout: printf("%"PRIu64" packets lost, IDLE %"PRIu64" times\n", total, MAX_IDLE - timeout); - /* clean up */ total = pkt_per_port * conf->nb_ports - total; for (i = 0; i < total; i++) @@ -644,7 +646,7 @@ exec_burst(uint32_t flags, int lcore) conf = &lcore_conf[lcore]; pkt_per_port = MAX_TRAFFIC_BURST; - num = pkt_per_port; + num = pkt_per_port * conf->nb_ports; rte_atomic64_init(&start); @@ -661,11 +663,12 @@ exec_burst(uint32_t flags, int lcore) nb_tx = RTE_MIN(MAX_PKT_BURST, num); for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - rte_eth_tx_burst(portid, 0, + nb_tx = rte_eth_tx_burst(portid, 0, &tx_burst[idx], nb_tx); idx += nb_tx; + num -= nb_tx; } - num -= nb_tx; + } sleep(5); -- 2.11.0