Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/54927/?format=api
https://patches.dpdk.org/api/patches/54927/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190618163537.14642-1-stephen@networkplumber.org/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20190618163537.14642-1-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20190618163537.14642-1-stephen@networkplumber.org", "date": "2019-06-18T16:35:37", "name": "[v2] examples/multi_process - fix crash in mp_client with sparse ports", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "013918fc1b432ae7b90895a077972285d4c3092e", "submitter": { "id": 27, "url": "https://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190618163537.14642-1-stephen@networkplumber.org/mbox/", "series": [ { "id": 5064, "url": "https://patches.dpdk.org/api/series/5064/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5064", "date": "2019-06-18T16:35:37", "name": "[v2] examples/multi_process - fix crash in mp_client with sparse ports", "version": 2, "mbox": "https://patches.dpdk.org/series/5064/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/54927/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/54927/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3667E1C23C;\n\tTue, 18 Jun 2019 18:35:47 +0200 (CEST)", "from mail-pl1-f195.google.com (mail-pl1-f195.google.com\n\t[209.85.214.195]) by dpdk.org (Postfix) with ESMTP id EE5BC1C218\n\tfor <dev@dpdk.org>; Tue, 18 Jun 2019 18:35:45 +0200 (CEST)", "by mail-pl1-f195.google.com with SMTP id k8so4964615plt.3\n\tfor <dev@dpdk.org>; Tue, 18 Jun 2019 09:35:45 -0700 (PDT)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tu21sm18477247pfl.33.2019.06.18.09.35.44\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tTue, 18 Jun 2019 09:35:44 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=sbupyVG4Xfwd+q4+eSyzmdONYTtJNBAldraFpXs5bYM=;\n\tb=O/8JjnZSbmOn66lD5swJgD6l/Po/+gN4SML3L0JNsVQWs8ZXs1BZfv1VstPmaHL/3g\n\t535nN1N1JX2pQ9izCSk6zCalnpoN16Wi1fFbOIkRO71QffBgkFGh6gBqfbmEz6V7RTQ6\n\tbHaGIm6/kgFn6OxLYadD2cg1xUeE9a/JOYNJ4jFHKAo+zdnLQDAGTzCAwQYIJrSJp1Hl\n\tOLtKp2QBJeHBoYn+Rl7Is/RLSGPWFYVyLhaH9tG4CjpFw041eXoMjwyONybA2P55P2DE\n\tzfSycx9m1WkuDpp4wv8I4m6fqtl3lZI4z+f4XKKz+Z8R0qaLqovqiKS+fDSvuiacmQMT\n\tgqlg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=sbupyVG4Xfwd+q4+eSyzmdONYTtJNBAldraFpXs5bYM=;\n\tb=S8IwhbZItT3Wy06RaUbLx5S9ewnfq/gMRcDlpxzcrxDFkXM00ceZJbzMOrKcZB8Mjp\n\t+0FhyJo/sT+y2tpIo7S2E8BWHqj583KNFbo8Fyfo+CvYVOLjoT6fk/f6UzMBDGzrqXXR\n\t1BP/40iR3cOkjvi4T2+hvRrxqFyAGWt7cS7v4+8JxZgCobL0bFvfvGsINhyrIZqbBzGV\n\t7nzCqnuMWoPCvXpT2+BfgXBi4siiR6AidrYrdw4xnWG0DVph1v4/oudvTZTUiLL96gHz\n\tEX6iRdj/VhQ2nX6Ue6rpbuYmb/e1DGZdCtc7GJgw+G/PBG8e5IXXRRSC2Ln5snNesF8Z\n\trTgA==", "X-Gm-Message-State": "APjAAAWUlUJAQkF0mPYubCnIF/nIvPmA2XHH1iSg2QEDAZ18nxg8JUJL\n\tYqYFDXrUf6+Tpxafda14LW+iPBhoPYs=", "X-Google-Smtp-Source": "APXvYqzMTnL/WFkMWD8ckJ5esVGy2Bg0ZiyVvJ0i3u11svTh4j/SYbw7wxV78afkBxr7sgSa0OFoVg==", "X-Received": "by 2002:a17:902:4222:: with SMTP id\n\tg31mr36851785pld.41.1560875744883; \n\tTue, 18 Jun 2019 09:35:44 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <sthemmin@microsoft.com>", "Date": "Tue, 18 Jun 2019 09:35:37 -0700", "Message-Id": "<20190618163537.14642-1-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190604000431.28763-1-stephen@networkplumber.org>", "References": "<20190604000431.28763-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2] examples/multi_process - fix crash in\n\tmp_client with sparse ports", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Stephen Hemminger <sthemmin@microsoft.com>\n\nThe mp_client crashes if run on Azure or any system where ethdev\nports are owned. This is because the flush loop is confusing the\nindex into the array of ports[] with the port id.\n\nFor example if the server has Ports 3 and 5. Then calling\nrte_eth_tx_buffer_flush on any other buffer will dereference null\nbecause the tx buffer for that port was not allocated.\n\nAlso:\n - the flush code is common enough that it should not be marked\n unlikely\n - combine conditions to reduce indentation\n - avoid unnecessary if() if sent is zero.\n\nFixes: e2366e74e029 (\"examples: use buffered Tx\")\nSigned-off-by: Stephen Hemminger <sthemmin@microsoft.com>\n---\n .../client_server_mp/mp_client/client.c | 19 ++++++++++---------\n 1 file changed, 10 insertions(+), 9 deletions(-)", "diff": "diff --git a/examples/multi_process/client_server_mp/mp_client/client.c b/examples/multi_process/client_server_mp/mp_client/client.c\nindex c23dd3f378f7..db9ebbe2402a 100644\n--- a/examples/multi_process/client_server_mp/mp_client/client.c\n+++ b/examples/multi_process/client_server_mp/mp_client/client.c\n@@ -246,19 +246,20 @@ main(int argc, char *argv[])\n \n \tfor (;;) {\n \t\tuint16_t i, rx_pkts;\n-\t\tuint16_t port;\n \n \t\trx_pkts = rte_ring_dequeue_burst(rx_ring, pkts,\n \t\t\t\tPKT_READ_SIZE, NULL);\n \n-\t\tif (unlikely(rx_pkts == 0)){\n-\t\t\tif (need_flush)\n-\t\t\t\tfor (port = 0; port < ports->num_ports; port++) {\n-\t\t\t\t\tsent = rte_eth_tx_buffer_flush(ports->id[port], client_id,\n-\t\t\t\t\t\t\ttx_buffer[port]);\n-\t\t\t\t\tif (unlikely(sent))\n-\t\t\t\t\t\ttx_stats->tx[port] += sent;\n-\t\t\t\t}\n+\t\tif (rx_pkts == 0 && need_flush) {\n+\t\t\tfor (i = 0; i < ports->num_ports; i++) {\n+\t\t\t\tuint16_t port = ports->id[i];\n+\n+\t\t\t\tsent = rte_eth_tx_buffer_flush(port,\n+\t\t\t\t\t\t\t client_id,\n+\t\t\t\t\t\t\t tx_buffer[port]);\n+\t\t\t\tif (unlikely(sent))\n+\t\t\t\t\ttx_stats->tx[port] += sent;\n+\t\t\t}\n \t\t\tneed_flush = 0;\n \t\t\tcontinue;\n \t\t}\n", "prefixes": [ "v2" ] }{ "id": 54927, "url": "