Show a patch.

GET /api/patches/43055/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 43055,
    "url": "http://patches.dpdk.org/api/patches/43055/?format=api",
    "web_url": "http://patches.dpdk.org/patch/43055/",
    "project": {
        "id": 1,
        "url": "http://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"
    },
    "msgid": "<20180713142302.34576-2-david.hunt@intel.com>",
    "date": "2018-07-13T14:22:54",
    "name": "[v4,1/9] examples/vm_power: add check for port count",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a79d29ee9004b7acd3acef875dea062414525bad",
    "submitter": {
        "id": 342,
        "url": "http://patches.dpdk.org/api/people/342/?format=api",
        "name": "David Hunt",
        "email": "david.hunt@intel.com"
    },
    "delegate": {
        "id": 22,
        "url": "http://patches.dpdk.org/api/users/22/?format=api",
        "username": "pdelarag",
        "first_name": "Pablo",
        "last_name": "de Lara Guarch",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/43055/mbox/",
    "series": [
        {
            "id": 568,
            "url": "http://patches.dpdk.org/api/series/568/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=568",
            "date": "2018-07-13T14:22:53",
            "name": "examples/vm_power: 100% Busy Polling",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/568/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43055/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43055/checks/",
    "tags": {},
    "headers": {
        "X-Mailer": "git-send-email 2.17.1",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Date": "Fri, 13 Jul 2018 15:22:54 +0100",
        "X-Mailman-Version": "2.1.15",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "Cc": "david.hunt@intel.com,\n\tthomas@monjalon.net",
        "To": "dev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<20180626092317.11031-2-david.hunt@intel.com>\n\t<20180713142302.34576-1-david.hunt@intel.com>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "From": "David Hunt <david.hunt@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,347,1526367600\"; d=\"scan'208\";a=\"56278182\"",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E668B2BF5;\n\tFri, 13 Jul 2018 16:23:22 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 772981E2F\n\tfor <dev@dpdk.org>; Fri, 13 Jul 2018 16:23:20 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Jul 2018 07:23:19 -0700",
            "from silpixa00399952.ir.intel.com (HELO\n\tsilpixa00399952.ger.corp.intel.com) ([10.237.223.64])\n\tby orsmga007.jf.intel.com with ESMTP; 13 Jul 2018 07:23:18 -0700"
        ],
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Amp-File-Uploaded": "False",
        "Subject": "[dpdk-dev] [PATCH v4 1/9] examples/vm_power: add check for port\n\tcount",
        "In-Reply-To": "<20180713142302.34576-1-david.hunt@intel.com>",
        "Message-Id": "<20180713142302.34576-2-david.hunt@intel.com>",
        "X-ExtLoop1": "1",
        "X-BeenThere": "dev@dpdk.org",
        "X-Original-To": "patchwork@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>\nAcked-by: Radu Nicolau <radu.nicolau@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 8911f2659..0d3846971 100644\n--- a/examples/vm_power_manager/main.c\n+++ b/examples/vm_power_manager/main.c\n@@ -278,51 +278,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, &eth);\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, &eth);\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, &eth);\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, &eth);\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, &eth);\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, &eth);\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": [
        "v4",
        "1/9"
    ]
}