Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/28001/?format=api
https://patches.dpdk.org/api/patches/28001/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1503676941-80981-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": "<1503676941-80981-10-git-send-email-david.hunt@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1503676941-80981-10-git-send-email-david.hunt@intel.com", "date": "2017-08-25T16:02:20", "name": "[dpdk-dev,v1,09/10] examples/vm_power_mgr: set MAC address of VF", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "f75fbc8f9693ec2da00bc725e5539cccfc348a39", "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/1503676941-80981-10-git-send-email-david.hunt@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/28001/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/28001/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 46B1690FA;\n\tFri, 25 Aug 2017 18:02:47 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 48E657D8E\n\tfor <dev@dpdk.org>; Fri, 25 Aug 2017 18:02:40 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Aug 2017 09:02:39 -0700", "from silpixa00397898.ir.intel.com (HELO\n\tsilpixa00397898.ger.corp.intel.com) ([10.237.223.116])\n\tby fmsmga001.fm.intel.com with ESMTP; 25 Aug 2017 09:02:38 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.41,426,1498546800\"; d=\"scan'208\";\n\ta=\"1188144679\"", "From": "David Hunt <david.hunt@intel.com>", "To": "dev@dpdk.org", "Cc": "David Hunt <david.hunt@intel.com>", "Date": "Fri, 25 Aug 2017 17:02:20 +0100", "Message-Id": "<1503676941-80981-10-git-send-email-david.hunt@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1503676941-80981-1-git-send-email-david.hunt@intel.com>", "References": "<1503676941-80981-1-git-send-email-david.hunt@intel.com>", "Subject": "[dpdk-dev] [PATCH v1 09/10] examples/vm_power_mgr: set MAC address\n\tof VF", "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 | 58 +++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 57 insertions(+), 1 deletion(-)", "diff": "diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c\nindex 698abca..f307ec7 100644\n--- a/examples/vm_power_manager/main.c\n+++ b/examples/vm_power_manager/main.c\n@@ -58,6 +58,15 @@\n #include \"channel_monitor.h\"\n #include \"power_manager.h\"\n #include \"vm_power_cli.h\"\n+#ifdef RTE_LIBRTE_IXGBE_PMD\n+#include <rte_pmd_ixgbe.h>\n+#endif\n+#ifdef RTE_LIBRTE_I40E_PMD\n+#include <rte_pmd_i40e.h>\n+#endif\n+#ifdef RTE_LIBRTE_BNXT_PMD\n+#include <rte_pmd_bnxt.h>\n+#endif\n \n #define RX_RING_SIZE 512\n #define TX_RING_SIZE 512\n@@ -222,7 +231,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 +310,58 @@ 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+#ifdef RTE_LIBRTE_IXGBE_PMD\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, ð);\n+#endif\n+#ifdef RTE_LIBRTE_I40E_PMD\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+#endif\n+#ifdef RTE_LIBRTE_BNXT_PMD\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+#endif\n+\n+\n+\t\t\tret = rte_pmd_i40e_set_vf_mac_addr(portid, w,\n+\t\t\t\t\tð);\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", "v1", "09/10" ] }{ "id": 28001, "url": "