get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78710,
    "url": "https://patches.dpdk.org/api/patches/78710/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1600949555-28043-44-git-send-email-arybchenko@solarflare.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": "<1600949555-28043-44-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1600949555-28043-44-git-send-email-arybchenko@solarflare.com",
    "date": "2020-09-24T12:12:18",
    "name": "[v3,43/60] common/sfc_efx/base: add function control window concept",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "354e8c4efb1d67025c1454f0d33a5a1ef159922d",
    "submitter": {
        "id": 607,
        "url": "https://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1600949555-28043-44-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 12473,
            "url": "https://patches.dpdk.org/api/series/12473/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12473",
            "date": "2020-09-24T12:11:40",
            "name": "common/sfc_efx: support Riverhead NIC family",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/12473/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/78710/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/78710/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B8A66A04B1;\n\tThu, 24 Sep 2020 14:18:53 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C12771DEC0;\n\tThu, 24 Sep 2020 14:13:52 +0200 (CEST)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 638891DE25\n for <dev@dpdk.org>; Thu, 24 Sep 2020 14:13:01 +0200 (CEST)",
            "from mx1-us1.ppe-hosted.com (unknown [10.7.65.61])\n by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id\n E517B60054 for <dev@dpdk.org>; Thu, 24 Sep 2020 12:13:00 +0000 (UTC)",
            "from us4-mdac16-70.ut7.mdlocal (unknown [10.7.64.189])\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id E394C8009E\n for <dev@dpdk.org>; Thu, 24 Sep 2020 12:13:00 +0000 (UTC)",
            "from mx1-us1.ppe-hosted.com (unknown [10.7.65.200])\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 641F480057\n for <dev@dpdk.org>; Thu, 24 Sep 2020 12:13:00 +0000 (UTC)",
            "from webmail.solarflare.com (uk.solarflare.com [193.34.186.16])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n (No client certificate requested)\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id\n 1A9D1800060\n for <dev@dpdk.org>; Thu, 24 Sep 2020 12:13:00 +0000 (UTC)",
            "from ukex01.SolarFlarecom.com (10.17.10.4) by\n ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id\n 15.0.1497.2; Thu, 24 Sep 2020 13:12:48 +0100",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id\n 15.0.1497.2 via Frontend Transport; Thu, 24 Sep 2020 13:12:48 +0100",
            "from ukv-loginhost.uk.solarflarecom.com\n (ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 08OCCmQ1026056;\n Thu, 24 Sep 2020 13:12:48 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id EA4CE1613A9;\n Thu, 24 Sep 2020 13:12:47 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Igor Romanov <igor.romanov@oktetlabs.ru>",
        "Date": "Thu, 24 Sep 2020 13:12:18 +0100",
        "Message-ID": "<1600949555-28043-44-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1600949555-28043-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1600764594-14752-1-git-send-email-arybchenko@solarflare.com>\n <1600949555-28043-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-TM-AS-Product-Ver": "SMEX-12.5.0.1300-8.6.1012-25674.003",
        "X-TM-AS-Result": "No-11.629600-8.000000-10",
        "X-TMASE-MatchedRID": "4vv40XEOjZbqxxOtz59fBKiUivh0j2PvOyBTDrxRCti8rUtbtWe8+hPD\n uMJK1DSu/SwzVfmaVyhA08Pbjdhi2aX7JaGNhSXtnFVnNmvv47tLXPA26IG0hN9RlPzeVuQQiT4\n kZOz5KBOodXi+cHENhcF7vJPwNnevDHo0pZoqAoJlpwNsTvdlKeqhuTPUDQDtVlKhKARgvkIHHS\n QUALkucwY51sUbcr9ZnwOVQcNBSLk5cAShGM5e08nUT+eskUQPS6mvV++TKmkINBjyESk9WdNm9\n UP0X0/ol3kp0HYAUbXDnHvB74PWHCscSLtLQpT540jcxy3aXNrcVi8qZmJWcwpCjqVELlwVhnOL\n yflyxrNiTthHcHcV802vTymnH9dmlhtpzhf3gmf4KPASpfWnuStny2U8KNxMmyiLZetSf8mfop0\n ytGwvXiq2rl3dzGQ1zFbFAjs+0DmQGp5vcm3W9AJfK5fxxupHUGg6/BXfN5cEHzsByiYmvg==",
        "X-TM-AS-User-Approved-Sender": "Yes",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--11.629600-8.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.6.1012-25674.003",
        "X-MDID": "1600949580-clQrZDJHZNxT",
        "Subject": "[dpdk-dev] [PATCH v3 43/60] common/sfc_efx/base: add function\n\tcontrol window concept",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Igor Romanov <igor.romanov@oktetlabs.ru>\n\nFunction control window can be located at a different offset than\nother windows on Riverhead. Meaning that the drivers must handle\naccesses to the function control window differently in case of EF100.\n\nAdd accessor macros for function control window and change\nEFX NIC create API to facilitate that accessors.\n\nSigned-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/common/sfc_efx/base/ef10_mcdi.c | 21 ++++++++-----\n drivers/common/sfc_efx/base/efx.h       |  1 +\n drivers/common/sfc_efx/base/efx_impl.h  | 39 +++++++++++++++++++++++++\n drivers/common/sfc_efx/base/efx_nic.c   |  9 ++++++\n drivers/common/sfc_efx/base/rhead_ev.c  |  2 +-\n drivers/common/sfc_efx/base/rhead_nic.c |  2 +-\n drivers/net/sfc/sfc.c                   |  3 +-\n 7 files changed, 67 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/ef10_mcdi.c b/drivers/common/sfc_efx/base/ef10_mcdi.c\nindex 727f14826e..b324ec825b 100644\n--- a/drivers/common/sfc_efx/base/ef10_mcdi.c\n+++ b/drivers/common/sfc_efx/base/ef10_mcdi.c\n@@ -56,7 +56,7 @@ ef10_mcdi_init(\n \tswitch (enp->en_family) {\n #if EFSYS_OPT_RIVERHEAD\n \tcase EFX_FAMILY_RIVERHEAD:\n-\t\tEFX_BAR_WRITED(enp, ER_GZ_MC_DB_HWRD_REG, &dword, B_FALSE);\n+\t\tEFX_BAR_FCW_WRITED(enp, ER_GZ_MC_DB_HWRD_REG, &dword);\n \t\tbreak;\n #endif\t/* EFSYS_OPT_RIVERHEAD */\n \tdefault:\n@@ -166,7 +166,7 @@ ef10_mcdi_send_request(\n \tswitch (enp->en_family) {\n #if EFSYS_OPT_RIVERHEAD\n \tcase EFX_FAMILY_RIVERHEAD:\n-\t\tEFX_BAR_WRITED(enp, ER_GZ_MC_DB_LWRD_REG, &dword, B_FALSE);\n+\t\tEFX_BAR_FCW_WRITED(enp, ER_GZ_MC_DB_LWRD_REG, &dword);\n \t\tbreak;\n #endif\t/* EFSYS_OPT_RIVERHEAD */\n \tdefault:\n@@ -179,7 +179,7 @@ ef10_mcdi_send_request(\n \tswitch (enp->en_family) {\n #if EFSYS_OPT_RIVERHEAD\n \tcase EFX_FAMILY_RIVERHEAD:\n-\t\tEFX_BAR_WRITED(enp, ER_GZ_MC_DB_HWRD_REG, &dword, B_FALSE);\n+\t\tEFX_BAR_FCW_WRITED(enp, ER_GZ_MC_DB_HWRD_REG, &dword);\n \t\tbreak;\n #endif\t/* EFSYS_OPT_RIVERHEAD */\n \tdefault:\n@@ -237,11 +237,18 @@ ef10_mcdi_poll_reboot(\n \n \told_status = emip->emi_mc_reboot_status;\n \n-\tEFX_STATIC_ASSERT(ER_DZ_BIU_MC_SFT_STATUS_REG_OFST ==\n-\t    ER_GZ_MC_SFT_STATUS_OFST);\n-\n \t/* Update MC reboot status word */\n-\tEFX_BAR_TBL_READD(enp, ER_DZ_BIU_MC_SFT_STATUS_REG, 0, &dword, B_FALSE);\n+\tswitch (enp->en_family) {\n+#if EFSYS_OPT_RIVERHEAD\n+\tcase EFX_FAMILY_RIVERHEAD:\n+\t\tEFX_BAR_FCW_READD(enp, ER_GZ_MC_SFT_STATUS, &dword);\n+\t\tbreak;\n+#endif\t/* EFSYS_OPT_RIVERHEAD */\n+\tdefault:\n+\t\tEFX_BAR_READD(enp, ER_DZ_BIU_MC_SFT_STATUS_REG,\n+\t\t\t      &dword, B_FALSE);\n+\t\tbreak;\n+\t}\n \tnew_status = dword.ed_u32[0];\n \n \t/* MC has rebooted if the value has changed */\ndiff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex 41222a71f1..1531b7f57f 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -150,6 +150,7 @@ efx_nic_create(\n \t__in\t\tefx_family_t family,\n \t__in\t\tefsys_identifier_t *esip,\n \t__in\t\tefsys_bar_t *esbp,\n+\t__in\t\tuint32_t fcw_offset,\n \t__in\t\tefsys_lock_t *eslp,\n \t__deref_out\tefx_nic_t **enpp);\n \ndiff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h\nindex fc0a654f80..b1457f361a 100644\n--- a/drivers/common/sfc_efx/base/efx_impl.h\n+++ b/drivers/common/sfc_efx/base/efx_impl.h\n@@ -846,6 +846,7 @@ struct efx_nic_s {\n \t\t\tint\t\t\tena_vi_base;\n \t\t\tint\t\t\tena_vi_count;\n \t\t\tint\t\t\tena_vi_shift;\n+\t\t\tuint32_t\t\tena_fcw_base;\n #if EFSYS_OPT_VPD\n \t\t\tcaddr_t\t\t\tena_svpd;\n \t\t\tsize_t\t\t\tena_svpd_length;\n@@ -1114,6 +1115,9 @@ struct efx_txq_s {\n  * Code used on EF10 *must* use EFX_BAR_VI_*() macros for per-VI registers,\n  * to ensure the correct runtime VI window size is used on Medford2.\n  *\n+ * Code used on EF100 *must* use EFX_BAR_FCW_* macros for function control\n+ * window registers, to ensure the correct starting offset is used.\n+ *\n  * Siena-only code may continue using EFX_BAR_TBL_*() macros for VI registers.\n  */\n \n@@ -1218,6 +1222,41 @@ struct efx_txq_s {\n \t_NOTE(CONSTANTCONDITION)\t\t\t\t\t\\\n \t} while (B_FALSE)\n \n+/*\n+ * Accessors for memory BAR function control window registers.\n+ *\n+ * The function control window is located at an offset which can be\n+ * non-zero in case of Riverhead.\n+ */\n+\n+#if EFSYS_OPT_RIVERHEAD\n+\n+#define\tEFX_BAR_FCW_READD(_enp, _reg, _edp)\t\t\t\t\\\n+\tdo {\t\t\t\t\t\t\t\t\\\n+\t\tEFX_CHECK_REG((_enp), (_reg));\t\t\t\t\\\n+\t\tEFSYS_BAR_READD((_enp)->en_esbp, _reg ## _OFST +\t\\\n+\t\t    (_enp)->en_arch.ef10.ena_fcw_base,\t\t\t\\\n+\t\t    (_edp), B_FALSE);\t\t\t\t\t\\\n+\t\tEFSYS_PROBE3(efx_bar_fcw_readd, const char *, #_reg,\t\\\n+\t\t    uint32_t, _reg ## _OFST,\t\t\t\t\\\n+\t\t    uint32_t, (_edp)->ed_u32[0]);\t\t\t\\\n+\t_NOTE(CONSTANTCONDITION)\t\t\t\t\t\\\n+\t} while (B_FALSE)\n+\n+#define\tEFX_BAR_FCW_WRITED(_enp, _reg, _edp)\t\t\t\t\\\n+\tdo {\t\t\t\t\t\t\t\t\\\n+\t\tEFX_CHECK_REG((_enp), (_reg));\t\t\t\t\\\n+\t\tEFSYS_PROBE3(efx_bar_fcw_writed, const char *, #_reg,\t\\\n+\t\t    uint32_t, _reg ## _OFST,\t\t\t\t\\\n+\t\t    uint32_t, (_edp)->ed_u32[0]);\t\t\t\\\n+\t\tEFSYS_BAR_WRITED((_enp)->en_esbp, _reg ## _OFST +\t\\\n+\t\t    (_enp)->en_arch.ef10.ena_fcw_base,\t\t\t\\\n+\t\t    (_edp), B_FALSE);\t\t\t\t\t\\\n+\t_NOTE(CONSTANTCONDITION)\t\t\t\t\t\\\n+\t} while (B_FALSE)\n+\n+#endif\t/* EFSYS_OPT_RIVERHEAD */\n+\n /*\n  * Accessors for memory BAR per-VI registers.\n  *\ndiff --git a/drivers/common/sfc_efx/base/efx_nic.c b/drivers/common/sfc_efx/base/efx_nic.c\nindex 465e2c7a36..3dc287a095 100644\n--- a/drivers/common/sfc_efx/base/efx_nic.c\n+++ b/drivers/common/sfc_efx/base/efx_nic.c\n@@ -215,6 +215,7 @@ efx_nic_create(\n \t__in\t\tefx_family_t family,\n \t__in\t\tefsys_identifier_t *esip,\n \t__in\t\tefsys_bar_t *esbp,\n+\t__in\t\tuint32_t fcw_offset,\n \t__in\t\tefsys_lock_t *eslp,\n \t__deref_out\tefx_nic_t **enpp)\n {\n@@ -316,6 +317,7 @@ efx_nic_create(\n \t\t    EFX_FEATURE_MCDI |\n \t\t    EFX_FEATURE_MAC_HEADER_FILTERS |\n \t\t    EFX_FEATURE_MCDI_DMA;\n+\t\tenp->en_arch.ef10.ena_fcw_base = fcw_offset;\n \t\tbreak;\n #endif\t/* EFSYS_OPT_RIVERHEAD */\n \n@@ -324,6 +326,11 @@ efx_nic_create(\n \t\tgoto fail2;\n \t}\n \n+\tif ((family != EFX_FAMILY_RIVERHEAD) && (fcw_offset != 0)) {\n+\t\trc = EINVAL;\n+\t\tgoto fail3;\n+\t}\n+\n \tenp->en_family = family;\n \tenp->en_esip = esip;\n \tenp->en_esbp = esbp;\n@@ -333,6 +340,8 @@ efx_nic_create(\n \n \treturn (0);\n \n+fail3:\n+\tEFSYS_PROBE(fail3);\n fail2:\n \tEFSYS_PROBE(fail2);\n \ndiff --git a/drivers/common/sfc_efx/base/rhead_ev.c b/drivers/common/sfc_efx/base/rhead_ev.c\nindex 380729d174..8392a2be5b 100644\n--- a/drivers/common/sfc_efx/base/rhead_ev.c\n+++ b/drivers/common/sfc_efx/base/rhead_ev.c\n@@ -133,7 +133,7 @@ rhead_ev_qprime(\n \tEFX_POPULATE_DWORD_2(dword, ERF_GZ_EVQ_ID, eep->ee_index,\n \t    ERF_GZ_IDX, rptr);\n \t/* EVQ_INT_PRIME lives function control window only on Riverhead */\n-\tEFX_BAR_WRITED(enp, ER_GZ_EVQ_INT_PRIME, &dword, B_FALSE);\n+\tEFX_BAR_FCW_WRITED(enp, ER_GZ_EVQ_INT_PRIME, &dword);\n \n \treturn (0);\n }\ndiff --git a/drivers/common/sfc_efx/base/rhead_nic.c b/drivers/common/sfc_efx/base/rhead_nic.c\nindex 7fb28eae31..a773a43bcc 100644\n--- a/drivers/common/sfc_efx/base/rhead_nic.c\n+++ b/drivers/common/sfc_efx/base/rhead_nic.c\n@@ -456,7 +456,7 @@ rhead_nic_hw_unavailable(\n \tif (enp->en_reset_flags & EFX_RESET_HW_UNAVAIL)\n \t\treturn (B_TRUE);\n \n-\tEFX_BAR_READD(enp, ER_GZ_MC_SFT_STATUS, &dword, B_FALSE);\n+\tEFX_BAR_FCW_READD(enp, ER_GZ_MC_SFT_STATUS, &dword);\n \tif (EFX_DWORD_FIELD(dword, EFX_DWORD_0) == 0xffffffff)\n \t\tgoto unavail;\n \ndiff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c\nindex 03ea5dc128..4be65c15dc 100644\n--- a/drivers/net/sfc/sfc.c\n+++ b/drivers/net/sfc/sfc.c\n@@ -1046,7 +1046,8 @@ sfc_probe(struct sfc_adapter *sa)\n \tsfc_log_init(sa, \"create nic\");\n \trte_spinlock_init(&sa->nic_lock);\n \trc = efx_nic_create(sa->family, (efsys_identifier_t *)sa,\n-\t\t\t    &sa->mem_bar, &sa->nic_lock, &enp);\n+\t\t\t    &sa->mem_bar, 0,\n+\t\t\t    &sa->nic_lock, &enp);\n \tif (rc != 0)\n \t\tgoto fail_nic_create;\n \tsa->nic = enp;\n",
    "prefixes": [
        "v3",
        "43/60"
    ]
}