Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/29585/?format=api
https://patches.dpdk.org/api/patches/29585/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1507108515-186477-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": "<1507108515-186477-10-git-send-email-david.hunt@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1507108515-186477-10-git-send-email-david.hunt@intel.com", "date": "2017-10-04T09:15:15", "name": "[dpdk-dev,v4,9/9] examples/vm_power_mgr: set MAC address of VF", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "060ed208fd20d857d62e5e358c736632bcfae9d4", "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/1507108515-186477-10-git-send-email-david.hunt@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/29585/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/29585/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 C78DF1B65D;\n\tWed, 4 Oct 2017 11:55:50 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id AB9A21B64F\n\tfor <dev@dpdk.org>; Wed, 4 Oct 2017 11:55:47 +0200 (CEST)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Oct 2017 02:55:47 -0700", "from silpixa00397898.ir.intel.com (HELO\n\tsilpixa00397898.ger.corp.intel.com) ([10.237.223.116])\n\tby fmsmga006.fm.intel.com with ESMTP; 04 Oct 2017 02:55:46 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.42,477,1500966000\"; d=\"scan'208\";a=\"159205690\"", "From": "David Hunt <david.hunt@intel.com>", "To": "dev@dpdk.org", "Cc": "konstantin.ananyev@intel.com, jingjing.wu@intel.com,\n\tDavid Hunt <david.hunt@intel.com>", "Date": "Wed, 4 Oct 2017 10:15:15 +0100", "Message-Id": "<1507108515-186477-10-git-send-email-david.hunt@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1507108515-186477-1-git-send-email-david.hunt@intel.com>", "References": "<1506342429-199695-1-git-send-email-david.hunt@intel.com>\n\t<1507108515-186477-1-git-send-email-david.hunt@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 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 | 60 +++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 59 insertions(+), 1 deletion(-)", "diff": "diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c\nindex 698abca..18f5e7f 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@@ -273,7 +282,9 @@ main(int argc, char **argv)\n \tunsigned lcore_id;\n \tunsigned int nb_ports;\n \tstruct rte_mempool *mbuf_pool;\n+#ifdef RTE_LIBRTE_I40E_PMD\n \tuint8_t portid;\n+#endif\n \n \n \tret = rte_eal_init(argc, argv);\n@@ -300,13 +311,60 @@ main(int argc, char **argv)\n \t\trte_exit(EXIT_FAILURE, \"Cannot create mbuf pool\\n\");\n \n \t/* Initialize ports. */\n+#ifdef RTE_LIBRTE_I40E_PMD\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\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+#endif\n \n \tlcore_id = rte_get_next_lcore(-1, 1, 0);\n \tif (lcore_id == RTE_MAX_LCORE) {\n", "prefixes": [ "dpdk-dev", "v4", "9/9" ] }{ "id": 29585, "url": "