Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/61523/?format=api
http://patches.dpdk.org/api/patches/61523/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191021062951.23562-2-g.singh@nxp.com/", "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", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20191021062951.23562-2-g.singh@nxp.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191021062951.23562-2-g.singh@nxp.com", "date": "2019-10-21T06:29:51", "name": "[2/2] net/enetc: set random MAC in case no MAC for SI", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "97ded8d804bb92f9c91597ef369989e061f185a5", "submitter": { "id": 1068, "url": "http://patches.dpdk.org/api/people/1068/?format=api", "name": "Gagandeep Singh", "email": "g.singh@nxp.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191021062951.23562-2-g.singh@nxp.com/mbox/", "series": [ { "id": 6956, "url": "http://patches.dpdk.org/api/series/6956/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6956", "date": "2019-10-21T06:29:50", "name": "[1/2] net/enetc: add macro for BD ring alignment", "version": 1, "mbox": "http://patches.dpdk.org/series/6956/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/61523/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/61523/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 EA4182BCE;\n\tMon, 21 Oct 2019 08:45:51 +0200 (CEST)", "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n\tby dpdk.org (Postfix) with ESMTP id B638129AC\n\tfor <dev@dpdk.org>; Mon, 21 Oct 2019 08:45:47 +0200 (CEST)", "from inva020.nxp.com (localhost [127.0.0.1])\n\tby inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 605E61A04E7;\n\tMon, 21 Oct 2019 08:45:47 +0200 (CEST)", "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n\t[165.114.16.14])\n\tby inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 8B42B1A04DF;\n\tMon, 21 Oct 2019 08:45:45 +0200 (CEST)", "from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179])\n\tby invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5F4E3402D3;\n\tMon, 21 Oct 2019 14:45:42 +0800 (SGT)" ], "From": "Gagandeep Singh <g.singh@nxp.com>", "To": "dev@dpdk.org,\n\tferruh.yigit@intel.com", "Cc": "Gagandeep Singh <g.singh@nxp.com>", "Date": "Mon, 21 Oct 2019 11:59:51 +0530", "Message-Id": "<20191021062951.23562-2-g.singh@nxp.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20191021062951.23562-1-g.singh@nxp.com>", "References": "<20191021062951.23562-1-g.singh@nxp.com>", "X-Virus-Scanned": "ClamAV using ClamSMTP", "Subject": "[dpdk-dev] [PATCH 2/2] net/enetc: set random MAC in case no MAC for\n\tSI", "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": "for SGMII interfaces, there can be 0 value\nwritten on MAC registers.\nThis patch set the random MAC address for those\ninterfaces.\n\nSigned-off-by: Gagandeep Singh <g.singh@nxp.com>\n---\n drivers/net/enetc/enetc_ethdev.c | 33 +++++++++++++++++++++++++++++++-\n 1 file changed, 32 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c\nindex 4e978348c..cc8fdd051 100644\n--- a/drivers/net/enetc/enetc_ethdev.c\n+++ b/drivers/net/enetc/enetc_ethdev.c\n@@ -4,6 +4,7 @@\n \n #include <stdbool.h>\n #include <rte_ethdev_pci.h>\n+#include <rte_random.h>\n \n #include \"enetc_logs.h\"\n #include \"enetc.h\"\n@@ -123,11 +124,21 @@ enetc_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)\n \treturn rte_eth_linkstatus_set(dev, &link);\n }\n \n+static void\n+print_ethaddr(const char *name, const struct ether_addr *eth_addr)\n+{\n+\tchar buf[ETHER_ADDR_FMT_SIZE];\n+\tether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);\n+\tENETC_PMD_INFO(\"%s%s\\n\", name, buf);\n+}\n+\n static int\n enetc_hardware_init(struct enetc_eth_hw *hw)\n {\n \tstruct enetc_hw *enetc_hw = &hw->hw;\n \tuint32_t *mac = (uint32_t *)hw->mac.addr;\n+\tuint32_t high_mac = 0;\n+\tuint16_t low_mac = 0;\n \n \tPMD_INIT_FUNC_TRACE();\n \t/* Calculating and storing the base HW addresses */\n@@ -138,8 +149,28 @@ enetc_hardware_init(struct enetc_eth_hw *hw)\n \tenetc_wr(enetc_hw, ENETC_SIMR, ENETC_SIMR_EN);\n \n \t*mac = (uint32_t)enetc_port_rd(enetc_hw, ENETC_PSIPMAR0(0));\n+\thigh_mac = (uint32_t)*mac;\n \tmac++;\n \t*mac = (uint16_t)enetc_port_rd(enetc_hw, ENETC_PSIPMAR1(0));\n+\tlow_mac = (uint16_t)*mac;\n+\n+\tif ((high_mac | low_mac) == 0) {\n+\t\tchar *first_byte;\n+\n+\t\tENETC_PMD_INFO(\"MAC is not available for this SI, \"\n+\t\t\t \"set random MAC\\n\");\n+\t\tmac = (uint32_t *)hw->mac.addr;\n+\t\t*mac = (uint32_t)rte_rand();\n+\t\tfirst_byte = (char *)mac;\n+\t\t*first_byte &= 0xfe;\t/* clear multicast bit */\n+\t\t*first_byte |= 0x02;\t/* set local assignment bit (IEEE802) */\n+\n+\t\tenetc_port_wr(enetc_hw, ENETC_PSIPMAR0(0), *mac);\n+\t\tmac++;\n+\t\t*mac = (uint16_t)rte_rand();\n+\t\tenetc_port_wr(enetc_hw, ENETC_PSIPMAR1(0), *mac);\n+\t\tprint_ethaddr(\"New address: \", (const struct ether_addr *)hw->mac.addr);\n+\t}\n \n \treturn 0;\n }\n@@ -906,5 +937,5 @@ RTE_INIT(enetc_pmd_init_log)\n {\n \tenetc_logtype_pmd = rte_log_register(\"pmd.net.enetc\");\n \tif (enetc_logtype_pmd >= 0)\n-\t\trte_log_set_level(enetc_logtype_pmd, RTE_LOG_NOTICE);\n+\t\trte_log_set_level(enetc_logtype_pmd, RTE_LOG_INFO);\n }\n", "prefixes": [ "2/2" ] }{ "id": 61523, "url": "