get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29740,
    "url": "https://patches.dpdk.org/api/patches/29740/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1507210100-69917-10-git-send-email-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": "<1507210100-69917-10-git-send-email-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1507210100-69917-10-git-send-email-david.hunt@intel.com",
    "date": "2017-10-05T13:28:20",
    "name": "[dpdk-dev,v7,9/9] examples/vm_power_mgr: set MAC address of VF",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9b01611ab2c971d646ab5940de043f46a507dadf",
    "submitter": {
        "id": 342,
        "url": "https://patches.dpdk.org/api/people/342/?format=api",
        "name": "Hunt, David",
        "email": "david.hunt@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1507210100-69917-10-git-send-email-david.hunt@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/29740/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/29740/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 1CACC1B27C;\n\tThu,  5 Oct 2017 15:28:47 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 636711B211\n\tfor <dev@dpdk.org>; Thu,  5 Oct 2017 15:28:43 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Oct 2017 06:28:43 -0700",
            "from silpixa00397898.ir.intel.com ([10.237.223.116])\n\tby orsmga004.jf.intel.com with ESMTP; 05 Oct 2017 06:28:41 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.42,481,1500966000\"; d=\"scan'208\";a=\"135515474\"",
        "From": "David Hunt <david.hunt@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "konstantin.ananyev@intel.com, jingjing.wu@intel.com,\n\tsantosh.shukla@caviumnetworks.com, David Hunt <david.hunt@intel.com>",
        "Date": "Thu,  5 Oct 2017 14:28:20 +0100",
        "Message-Id": "<1507210100-69917-10-git-send-email-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1507210100-69917-1-git-send-email-david.hunt@intel.com>",
        "References": "<1507206350-215367-1-git-send-email-david.hunt@intel.com>\n\t<1507210100-69917-1-git-send-email-david.hunt@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7 9/9] examples/vm_power_mgr: set MAC address of\n\tVF",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "We need to set vf mac from the host, so that they will be in sync on the\nguest and the host. Otherwise, we'll have a random mac on the guest, and\na 00:00:00:00:00:00 mac on the host.\n\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n examples/vm_power_manager/main.c | 43 +++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 42 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c\nindex 698abca..5147789 100644\n--- a/examples/vm_power_manager/main.c\n+++ b/examples/vm_power_manager/main.c\n@@ -58,6 +58,9 @@\n #include \"channel_monitor.h\"\n #include \"power_manager.h\"\n #include \"vm_power_cli.h\"\n+#include <rte_pmd_ixgbe.h>\n+#include <rte_pmd_i40e.h>\n+#include <rte_pmd_bnxt.h>\n \n #define RX_RING_SIZE 512\n #define TX_RING_SIZE 512\n@@ -222,7 +225,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)\n \t\t\t\t\t\t(uint8_t)portid);\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t       /* clear all_ports_up flag if any link down */\n+\t\t\t/* clear all_ports_up flag if any link down */\n \t\t\tif (link.link_status == ETH_LINK_DOWN) {\n \t\t\t\tall_ports_up = 0;\n \t\t\t\tbreak;\n@@ -301,11 +304,49 @@ main(int argc, char **argv)\n \n \t/* Initialize ports. */\n \tfor (portid = 0; portid < nb_ports; portid++) {\n+\t\tstruct ether_addr eth;\n+\t\tint w, j;\n+\t\tint ret = -ENOTSUP;\n+\n \t\tif ((enabled_port_mask & (1 << portid)) == 0)\n \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+\n \t\tif (port_init(portid, mbuf_pool) != 0)\n \t\t\trte_exit(EXIT_FAILURE, \"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\tif (ret == -ENOTSUP)\n+\t\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\t\t}\n+\t\t\t\tprintf(\"\\n\");\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n \t}\n \n \tlcore_id = rte_get_next_lcore(-1, 1, 0);\n",
    "prefixes": [
        "dpdk-dev",
        "v7",
        "9/9"
    ]
}