get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52690,
    "url": "http://patches.dpdk.org/api/patches/52690/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190412105105.24351-7-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": "<20190412105105.24351-7-g.singh@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190412105105.24351-7-g.singh@nxp.com",
    "date": "2019-04-12T11:01:33",
    "name": "[v3,06/13] net/enetc: replace register read/write macros with functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "75bce4838b4ddd709d62229b9a45f15711c0e223",
    "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@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190412105105.24351-7-g.singh@nxp.com/mbox/",
    "series": [
        {
            "id": 4280,
            "url": "http://patches.dpdk.org/api/series/4280/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4280",
            "date": "2019-04-12T11:01:11",
            "name": "ENETC PMD basic features and bug fixes",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/4280/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52690/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52690/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "X-BeenThere": "dev@dpdk.org",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "MIME-Version": "1.0",
        "X-MS-TNEF-Correlator": "",
        "Subject": "[dpdk-dev] [PATCH v3 06/13] net/enetc: replace register read/write\n\tmacros with functions",
        "Message-ID": "<20190412105105.24351-7-g.singh@nxp.com>",
        "Accept-Language": "en-US",
        "received-spf": "None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "References": "<1555075598-4988-1-git-send-email-g.singh@nxp.com>\n\t<20190412105105.24351-1-g.singh@nxp.com>",
        "In-Reply-To": "<20190412105105.24351-1-g.singh@nxp.com>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "VE1PR04MB6462",
        "X-MS-Exchange-CrossTenant-id": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "CC": "Gagandeep Singh <G.Singh@nxp.com>",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(136003)(376002)(366004)(396003)(346002)(39860400002)(189003)(199004)(2501003)(186003)(97736004)(7736002)(3846002)(110136005)(99286004)(6116002)(102836004)(86362001)(316002)(2616005)(11346002)(476003)(6506007)(446003)(76176011)(305945005)(26005)(1076003)(106356001)(66066001)(486006)(4326008)(105586002)(386003)(478600001)(52116002)(72206003)(50226002)(5660300002)(6436002)(81156014)(6512007)(71200400001)(8936002)(71190400001)(6486002)(68736007)(53936002)(256004)(25786009)(8676002)(81166006)(36756003)(14454004)(2906002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6462;\n\tH:VE1PR04MB6365.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en;\n\tPTR:InfoNoRecords; MX:1; A:1; ",
        "Content-Transfer-Encoding": "base64",
        "Thread-Index": "AQHU8R8WdFE5Vc3pLEWqVPR0Fuzfuw==",
        "X-OriginatorOrg": "nxp.com",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "7ad141bc-6ffc-4359-ef2d-08d6bf363918",
        "Date": "Fri, 12 Apr 2019 11:01:33 +0000",
        "From": "Gagandeep Singh <G.Singh@nxp.com>",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "12 Apr 2019 11:01:33.1111\n\t(UTC)",
        "X-Mailman-Version": "2.1.15",
        "List-Post": "<mailto:dev@dpdk.org>",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=aqCl+0c5enr2SVKrmXPkybgaE7Exio66vOZgzaphGn0=;\n\tb=q2yPYG1XRQqkyf7KU2BIl5VkOeYr5ZurGNmQPfYCytjr1FnVfbam2xkpaPaxA5RMySf6mSjivesJEvWURt2/42IU82bLssJ4/hgSmqSkG1TMghIieEVD2IRDnEwav4pHpaDHMCKinAKml16T2c95h0mWv8/p2FkzNKUXIofAunE=",
        "x-ms-exchange-senderadcheck": "1",
        "To": "\"dev@dpdk.org\" <dev@dpdk.org>, \"ferruh.yigit@intel.com\"\n\t<ferruh.yigit@intel.com>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2FEA81B0FF;\n\tFri, 12 Apr 2019 13:01:40 +0200 (CEST)",
            "from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-eopbgr140049.outbound.protection.outlook.com [40.107.14.49])\n\tby dpdk.org (Postfix) with ESMTP id 925D87D52\n\tfor <dev@dpdk.org>; Fri, 12 Apr 2019 13:01:34 +0200 (CEST)",
            "from VE1PR04MB6365.eurprd04.prod.outlook.com (10.255.118.78) by\n\tVE1PR04MB6462.eurprd04.prod.outlook.com (20.179.233.19) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1771.21; Fri, 12 Apr 2019 11:01:33 +0000",
            "from VE1PR04MB6365.eurprd04.prod.outlook.com\n\t([fe80::f5ad:f178:4c55:13e0]) by\n\tVE1PR04MB6365.eurprd04.prod.outlook.com\n\t([fe80::f5ad:f178:4c55:13e0%3]) with mapi id 15.20.1792.016;\n\tFri, 12 Apr 2019 11:01:33 +0000"
        ],
        "X-MS-Has-Attach": "",
        "x-microsoft-antispam-message-info": "CLsm9QugAl/62TbuNPwcQUG4AhSwIT3Q1MtYmtXcBOmYx69RB7bQeM67IkySlA9A6D1dyrMlZzWlRxvLBjyW74Nd6YYZwNtF8Xq2Y21A1Zf1tnCcA0zsb9kf+166k+zGeK+JNEVoUOttxROeFlQr3cp6CIrcT4+rbkLDKLtfSJomVq/Jk+36eoGHePXMS0GXI3yO3xxoMRG+xkASbppqJ6OQR9GnEw/v/XLIVqCpcR7zAfsso5DQto23V2LqNv99EG9Rbv9wo/lGMjqqstY1wF8S4F10zeQGBze6YlvKnGuyr/adRu0PMH/jLoVBR6RU793b7whaiIFRjE2XeXUiHZ/brXbno7OPBSNmBVUJ/HmFvkjJDattPXErDMQYhY1fmOjAzMboNCR9s5l5JHgOEmOXgpb45FrG8a+Rd/fTn6U=",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020);\n\tSRVR:VE1PR04MB6462; ",
        "Errors-To": "dev-bounces@dpdk.org",
        "x-clientproxiedby": "TYAPR01CA0204.jpnprd01.prod.outlook.com\n\t(2603:1096:404:29::24) To VE1PR04MB6365.eurprd04.prod.outlook.com\n\t(2603:10a6:803:12a::14)",
        "x-ms-traffictypediagnostic": "VE1PR04MB6462:",
        "x-originating-ip": "[92.120.1.68]",
        "Delivered-To": "patchwork@dpdk.org",
        "X-Original-To": "patchwork@dpdk.org",
        "x-forefront-prvs": "0005B05917",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-antispam-prvs": "<VE1PR04MB64628D37FC2487868B5F9F61E1280@VE1PR04MB6462.eurprd04.prod.outlook.com>",
        "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED",
        "x-mailer": "git-send-email 2.17.1",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=G.Singh@nxp.com; ",
        "Thread-Topic": "[PATCH v3 06/13] net/enetc: replace register read/write macros\n\twith functions",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Content-Language": "en-US",
        "x-ms-office365-filtering-correlation-id": "7ad141bc-6ffc-4359-ef2d-08d6bf363918",
        "Precedence": "list"
    },
    "content": "Replacing read-write macros with already available\nread-write functions.\n\nSigned-off-by: Gagandeep Singh <g.singh@nxp.com>\n---\n drivers/net/enetc/enetc.h        |  7 +----\n drivers/net/enetc/enetc_ethdev.c | 61 ++++++++++++++++++++--------------------\n 2 files changed, 31 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/drivers/net/enetc/enetc.h b/drivers/net/enetc/enetc.h\r\nindex 0e80d1c..56454dc 100644\r\n--- a/drivers/net/enetc/enetc.h\r\n+++ b/drivers/net/enetc/enetc.h\r\n@@ -1,5 +1,5 @@\r\n /* SPDX-License-Identifier: BSD-3-Clause\r\n- * Copyright 2018 NXP\r\n+ * Copyright 2018-2019 NXP\r\n  */\r\n \r\n #ifndef _ENETC_H_\r\n@@ -86,11 +86,6 @@ struct enetc_eth_adapter {\r\n #define ENETC_DEV_PRIVATE_TO_INTR(adapter) \\\r\n \t(&((struct enetc_eth_adapter *)adapter)->intr)\r\n \r\n-#define ENETC_GET_HW_ADDR(reg, addr) ((void *)(((size_t)reg) + (addr)))\r\n-#define ENETC_REG_READ(addr) (*(uint32_t *)addr)\r\n-#define ENETC_REG_WRITE(addr, val) (*(uint32_t *)addr = val)\r\n-#define ENETC_REG_WRITE_RELAXED(addr, val) (*(uint32_t *)addr = val)\r\n-\r\n /*\r\n  * RX/TX ENETC function prototypes\r\n  */\r\ndiff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c\r\nindex 10b2b39..2d8c4e6 100644\r\n--- a/drivers/net/enetc/enetc_ethdev.c\r\n+++ b/drivers/net/enetc/enetc_ethdev.c\r\n@@ -131,28 +131,31 @@ static int enetc_stats_get(struct rte_eth_dev *dev,\r\n {\r\n \tstruct enetc_eth_hw *hw =\r\n \t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\r\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\r\n \tuint32_t val;\r\n \r\n \tPMD_INIT_FUNC_TRACE();\r\n-\tval = ENETC_REG_READ(ENETC_GET_HW_ADDR(hw->hw.port,\r\n-\t\t\t     ENETC_PM0_CMD_CFG));\r\n-\tENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PM0_CMD_CFG),\r\n-\t\t\tval | ENETC_PM0_TX_EN | ENETC_PM0_RX_EN);\r\n+\tval = enetc_port_rd(enetc_hw, ENETC_PM0_CMD_CFG);\r\n+\tenetc_port_wr(enetc_hw, ENETC_PM0_CMD_CFG,\r\n+\t\t      val | ENETC_PM0_TX_EN | ENETC_PM0_RX_EN);\r\n \r\n \t/* Enable port */\r\n-\tval = ENETC_REG_READ(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PMR));\r\n-\tENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PMR),\r\n-\t\t\tval | ENETC_PMR_EN);\r\n+\tval = enetc_port_rd(enetc_hw, ENETC_PMR);\r\n+\tenetc_port_wr(enetc_hw, ENETC_PMR, val | ENETC_PMR_EN);\r\n \r\n \t/* set auto-speed for RGMII */\r\n-\tif (enetc_port_rd(&hw->hw, ENETC_PM0_IF_MODE) & ENETC_PMO_IFM_RG) {\r\n-\t\tenetc_port_wr(&hw->hw, ENETC_PM0_IF_MODE, ENETC_PM0_IFM_RGAUTO);\r\n-\t\tenetc_port_wr(&hw->hw, ENETC_PM1_IF_MODE, ENETC_PM0_IFM_RGAUTO);\r\n+\tif (enetc_port_rd(enetc_hw, ENETC_PM0_IF_MODE) & ENETC_PMO_IFM_RG) {\r\n+\t\tenetc_port_wr(enetc_hw, ENETC_PM0_IF_MODE,\r\n+\t\t\t      ENETC_PM0_IFM_RGAUTO);\r\n+\t\tenetc_port_wr(enetc_hw, ENETC_PM1_IF_MODE,\r\n+\t\t\t      ENETC_PM0_IFM_RGAUTO);\r\n \t}\r\n-\tif (enetc_global_rd(&hw->hw,\r\n+\tif (enetc_global_rd(enetc_hw,\r\n \t\t\t    ENETC_G_EPFBLPR(1)) == ENETC_G_EPFBLPR1_XGMII) {\r\n-\t\tenetc_port_wr(&hw->hw, ENETC_PM0_IF_MODE, ENETC_PM0_IFM_XGMII);\r\n-\t\tenetc_port_wr(&hw->hw, ENETC_PM1_IF_MODE, ENETC_PM0_IFM_XGMII);\r\n+\t\tenetc_port_wr(enetc_hw, ENETC_PM0_IF_MODE,\r\n+\t\t\t      ENETC_PM0_IFM_XGMII);\r\n+\t\tenetc_port_wr(enetc_hw, ENETC_PM1_IF_MODE,\r\n+\t\t\t      ENETC_PM0_IFM_XGMII);\r\n \t}\r\n \r\n \treturn 0;\r\n@@ -163,18 +166,17 @@ static int enetc_stats_get(struct rte_eth_dev *dev,\r\n {\r\n \tstruct enetc_eth_hw *hw =\r\n \t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\r\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\r\n \tuint32_t val;\r\n \r\n \tPMD_INIT_FUNC_TRACE();\r\n \t/* Disable port */\r\n-\tval = ENETC_REG_READ(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PMR));\r\n-\tENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PMR),\r\n-\t\t\tval & (~ENETC_PMR_EN));\r\n-\r\n-\tval = ENETC_REG_READ(ENETC_GET_HW_ADDR(hw->hw.port,\r\n-\t\t\t     ENETC_PM0_CMD_CFG));\r\n-\tENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PM0_CMD_CFG),\r\n-\t\t\tval & (~(ENETC_PM0_TX_EN | ENETC_PM0_RX_EN)));\r\n+\tval = enetc_port_rd(enetc_hw, ENETC_PMR);\r\n+\tenetc_port_wr(enetc_hw, ENETC_PMR, val & (~ENETC_PMR_EN));\r\n+\r\n+\tval = enetc_port_rd(enetc_hw, ENETC_PM0_CMD_CFG);\r\n+\tenetc_port_wr(enetc_hw, ENETC_PM0_CMD_CFG,\r\n+\t\t      val & (~(ENETC_PM0_TX_EN | ENETC_PM0_RX_EN)));\r\n }\r\n \r\n static void\r\n@@ -221,6 +223,7 @@ static int enetc_stats_get(struct rte_eth_dev *dev,\r\n {\r\n \tstruct enetc_eth_hw *hw =\r\n \t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\r\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\r\n \tstruct rte_eth_link link;\r\n \tuint32_t status;\r\n \r\n@@ -228,8 +231,7 @@ static int enetc_stats_get(struct rte_eth_dev *dev,\r\n \r\n \tmemset(&link, 0, sizeof(link));\r\n \r\n-\tstatus = ENETC_REG_READ(ENETC_GET_HW_ADDR(hw->hw.port,\r\n-\t\t\t\tENETC_PM0_STATUS));\r\n+\tstatus = enetc_port_rd(enetc_hw, ENETC_PM0_STATUS);\r\n \r\n \tif (status & ENETC_LINK_MODE)\r\n \t\tlink.link_duplex = ETH_LINK_FULL_DUPLEX;\r\n@@ -262,6 +264,7 @@ static int enetc_stats_get(struct rte_eth_dev *dev,\r\n enetc_hardware_init(struct enetc_eth_hw *hw)\r\n {\r\n \tuint32_t psipmr = 0;\r\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\r\n \r\n \tPMD_INIT_FUNC_TRACE();\r\n \t/* Calculating and storing the base HW addresses */\r\n@@ -269,8 +272,7 @@ static int enetc_stats_get(struct rte_eth_dev *dev,\r\n \thw->hw.global = (void *)((size_t)hw->hw.reg + ENETC_GLOBAL_BASE);\r\n \r\n \t/* Enabling Station Interface */\r\n-\tENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.reg, ENETC_SIMR),\r\n-\t\t\t\t\t  ENETC_SIMR_EN);\r\n+\tenetc_wr(enetc_hw, ENETC_SIMR, ENETC_SIMR_EN);\r\n \r\n \t/* Setting to accept broadcast packets for each inetrface */\r\n \tpsipmr |= ENETC_PSIPMR_SET_UP(0) | ENETC_PSIPMR_SET_MP(0) |\r\n@@ -280,14 +282,11 @@ static int enetc_stats_get(struct rte_eth_dev *dev,\r\n \tpsipmr |= ENETC_PSIPMR_SET_UP(2) | ENETC_PSIPMR_SET_MP(2) |\r\n \t\t  ENETC_PSIPMR_SET_VLAN_MP(2);\r\n \r\n-\tENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PSIPMR),\r\n-\t\t\tpsipmr);\r\n+\tenetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);\r\n \r\n \t/* Enabling broadcast address */\r\n-\tENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PSIPMAR0(0)),\r\n-\t\t\t0xFFFFFFFF);\r\n-\tENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PSIPMAR1(0)),\r\n-\t\t\t0xFFFF << 16);\r\n+\tenetc_port_wr(enetc_hw, ENETC_PSIPMAR0(0), 0xFFFFFFFF);\r\n+\tenetc_port_wr(enetc_hw, ENETC_PSIPMAR1(0), 0xFFFF << 16);\r\n \r\n \treturn 0;\r\n }\r\n",
    "prefixes": [
        "v3",
        "06/13"
    ]
}