Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/41364/?format=api
https://patches.dpdk.org/api/patches/41364/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180621132414.39047-2-david.hunt@intel.com/", "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": "<20180621132414.39047-2-david.hunt@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180621132414.39047-2-david.hunt@intel.com", "date": "2018-06-21T13:24:07", "name": "[v2,1/8] examples/vm_power: add check for port count", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "a79d29ee9004b7acd3acef875dea062414525bad", "submitter": { "id": 342, "url": "https://patches.dpdk.org/api/people/342/?format=api", "name": "Hunt, David", "email": "david.hunt@intel.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180621132414.39047-2-david.hunt@intel.com/mbox/", "series": [ { "id": 193, "url": "https://patches.dpdk.org/api/series/193/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=193", "date": "2018-06-21T13:24:10", "name": "examples/vm_power: 100% Busy Polling", "version": 2, "mbox": "https://patches.dpdk.org/series/193/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/41364/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/41364/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 E57FA1BB5C;\n\tThu, 21 Jun 2018 15:25:19 +0200 (CEST)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 65D771BAA0\n\tfor <dev@dpdk.org>; Thu, 21 Jun 2018 15:25:07 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Jun 2018 06:25:01 -0700", "from silpixa00399952.ir.intel.com (HELO\n\tsilpixa00399952.ger.corp.intel.com) ([10.237.223.64])\n\tby orsmga002.jf.intel.com with ESMTP; 21 Jun 2018 06:24:49 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,252,1526367600\"; d=\"scan'208\";a=\"68839748\"", "From": "David Hunt <david.hunt@intel.com>", "To": "dev@dpdk.org", "Cc": "david.hunt@intel.com", "Date": "Thu, 21 Jun 2018 14:24:07 +0100", "Message-Id": "<20180621132414.39047-2-david.hunt@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20180621132414.39047-1-david.hunt@intel.com>", "References": "<20180607073705.32895-2-david.hunt@intel.com>\n\t<20180621132414.39047-1-david.hunt@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 1/8] examples/vm_power: add check for port\n\tcount", "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": "If we don't pass any ports to the app, we don't need to create\nany mempools, and we don't need to init any ports.\n\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n examples/vm_power_manager/main.c | 81 +++++++++++++++++---------------\n 1 file changed, 43 insertions(+), 38 deletions(-)", "diff": "diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c\nindex c9805a461..043b374bc 100644\n--- a/examples/vm_power_manager/main.c\n+++ b/examples/vm_power_manager/main.c\n@@ -280,51 +280,56 @@ main(int argc, char **argv)\n \n \tnb_ports = rte_eth_dev_count_avail();\n \n-\tmbuf_pool = rte_pktmbuf_pool_create(\"MBUF_POOL\", NUM_MBUFS * nb_ports,\n-\t\tMBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());\n+\tif (nb_ports > 0) {\n+\t\tmbuf_pool = rte_pktmbuf_pool_create(\"MBUF_POOL\",\n+\t\t\t\tNUM_MBUFS * nb_ports, MBUF_CACHE_SIZE, 0,\n+\t\t\t\tRTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());\n \n-\tif (mbuf_pool == NULL)\n-\t\trte_exit(EXIT_FAILURE, \"Cannot create mbuf pool\\n\");\n+\t\tif (mbuf_pool == NULL)\n+\t\t\trte_exit(EXIT_FAILURE, \"Cannot create mbuf pool\\n\");\n \n-\t/* Initialize ports. */\n-\tRTE_ETH_FOREACH_DEV(portid) {\n-\t\tstruct ether_addr eth;\n-\t\tint w, j;\n-\t\tint ret;\n+\t\t/* Initialize ports. */\n+\t\tRTE_ETH_FOREACH_DEV(portid) {\n+\t\t\tstruct ether_addr eth;\n+\t\t\tint w, j;\n+\t\t\tint ret;\n \n-\t\tif ((enabled_port_mask & (1 << portid)) == 0)\n-\t\t\tcontinue;\n+\t\t\tif ((enabled_port_mask & (1 << portid)) == 0)\n+\t\t\t\tcontinue;\n \n-\t\teth.addr_bytes[0] = 0xe0;\n-\t\teth.addr_bytes[1] = 0xe0;\n-\t\teth.addr_bytes[2] = 0xe0;\n-\t\teth.addr_bytes[3] = 0xe0;\n-\t\teth.addr_bytes[4] = portid + 0xf0;\n+\t\t\teth.addr_bytes[0] = 0xe0;\n+\t\t\teth.addr_bytes[1] = 0xe0;\n+\t\t\teth.addr_bytes[2] = 0xe0;\n+\t\t\teth.addr_bytes[3] = 0xe0;\n+\t\t\teth.addr_bytes[4] = portid + 0xf0;\n \n-\t\tif (port_init(portid, mbuf_pool) != 0)\n-\t\t\trte_exit(EXIT_FAILURE, \"Cannot init port %\"PRIu8 \"\\n\",\n+\t\t\tif (port_init(portid, mbuf_pool) != 0)\n+\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\"Cannot init port %\"PRIu8 \"\\n\",\n \t\t\t\t\tportid);\n \n-\t\tfor (w = 0; w < MAX_VFS; w++) {\n-\t\t\teth.addr_bytes[5] = w + 0xf0;\n-\n-\t\t\tret = rte_pmd_ixgbe_set_vf_mac_addr(portid,\n-\t\t\t\t\t\tw, ð);\n-\t\t\tif (ret == -ENOTSUP)\n-\t\t\t\tret = rte_pmd_i40e_set_vf_mac_addr(portid,\n-\t\t\t\t\t\tw, ð);\n-\t\t\tif (ret == -ENOTSUP)\n-\t\t\t\tret = rte_pmd_bnxt_set_vf_mac_addr(portid,\n-\t\t\t\t\t\tw, ð);\n-\n-\t\t\tswitch (ret) {\n-\t\t\tcase 0:\n-\t\t\t\tprintf(\"Port %d VF %d MAC: \",\n-\t\t\t\t\t\tportid, w);\n-\t\t\t\tfor (j = 0; j < 6; j++) {\n-\t\t\t\t\tprintf(\"%02x\", eth.addr_bytes[j]);\n-\t\t\t\t\tif (j < 5)\n-\t\t\t\t\t\tprintf(\":\");\n+\t\t\tfor (w = 0; w < MAX_VFS; w++) {\n+\t\t\t\teth.addr_bytes[5] = w + 0xf0;\n+\n+\t\t\t\tret = rte_pmd_ixgbe_set_vf_mac_addr(portid,\n+\t\t\t\t\t\t\tw, ð);\n+\t\t\t\tif (ret == -ENOTSUP)\n+\t\t\t\t\tret = rte_pmd_i40e_set_vf_mac_addr(\n+\t\t\t\t\t\t\tportid, w, ð);\n+\t\t\t\tif (ret == -ENOTSUP)\n+\t\t\t\t\tret = rte_pmd_bnxt_set_vf_mac_addr(\n+\t\t\t\t\t\t\tportid, w, ð);\n+\n+\t\t\t\tswitch (ret) {\n+\t\t\t\tcase 0:\n+\t\t\t\t\tprintf(\"Port %d VF %d MAC: \",\n+\t\t\t\t\t\t\tportid, w);\n+\t\t\t\t\tfor (j = 0; j < 5; j++) {\n+\t\t\t\t\t\tprintf(\"%02x:\",\n+\t\t\t\t\t\t\teth.addr_bytes[j]);\n+\t\t\t\t\t}\n+\t\t\t\t\tprintf(\"%02x\\n\", eth.addr_bytes[5]);\n+\t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\tprintf(\"\\n\");\n \t\t\t\tbreak;\n", "prefixes": [ "v2", "1/8" ] }{ "id": 41364, "url": "