get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78712,
    "url": "https://patches.dpdk.org/api/patches/78712/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1600949555-28043-32-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-32-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1600949555-28043-32-git-send-email-arybchenko@solarflare.com",
    "date": "2020-09-24T12:12:06",
    "name": "[v3,31/60] common/sfc_efx/base: move Rx index check to generic code",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d71cd8516a58da000f7563158da36922c9f1da40",
    "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-32-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/78712/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/78712/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 5A636A04B1;\n\tThu, 24 Sep 2020 14:19:14 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3F2E31DE20;\n\tThu, 24 Sep 2020 14:13:55 +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 C7F261DE1C\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 55F7E600C0 for <dev@dpdk.org>; Thu, 24 Sep 2020 12:13:01 +0000 (UTC)",
            "from us4-mdac16-10.ut7.mdlocal (unknown [10.7.65.180])\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 551008009E\n for <dev@dpdk.org>; Thu, 24 Sep 2020 12:13:01 +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 C3C228005B\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 79DFF800069\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:47 +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:47 +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 08OCClRt025996\n for <dev@dpdk.org>; Thu, 24 Sep 2020 13:12:47 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 4E9381613A9\n for <dev@dpdk.org>; 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>",
        "Date": "Thu, 24 Sep 2020 13:12:06 +0100",
        "Message-ID": "<1600949555-28043-32-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-2.231200-8.000000-10",
        "X-TMASE-MatchedRID": "TuwRzrPxPxaBQUeOBghpX2pvRxhlGy+njs/yyyVHGh4n7t9EiNpFYdiO\n xhBTfwbD2XHJ0L4jOIQs/31GzKkTsbf0EuHoGRzunFVnNmvv47tLXPA26IG0hN9RlPzeVuQQrIV\n tWePlRJEeJ0wmJxvV41SCmfT2v3te3qZ3A4FG8d0Pe5gzF3TVt/ngX/aL8PCN75lKyW2tHKQcdi\n Rl7mICUb7aCg+WDekTzSnARADUO4E5hou9z/6pqcebIMlISwjbZ/rAPfrtWC1IyDY579vwTPZYo\n 7afros8qgyzmJ7g5Yn7oAlJCBIVEm+sGcdbpdKcB8Lglj0iCAA62UeHb6mkT5soi2XrUn/Jn6Kd\n MrRsL14qtq5d3cxkNRG3Wvo6dLnKAp0+1fBJa7XOAWkguhdMXgaqEj2XS4S7IC1BmkfEf03Zfuc\n dhXi/szJz+ZpGve4c+9DWaBRT9txZTi9y8F542STAx8myLbWyI6KkAL2A5kcMtYrw9BuTwqSmSP\n RgKSZM0Hy8mOlvvF7vdCUIFuasqw==",
        "X-TM-AS-User-Approved-Sender": "Yes",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10-2.231200-8.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.6.1012-25674.003",
        "X-MDID": "1600949581-AFTZb6J3YTLM",
        "Subject": "[dpdk-dev] [PATCH v3 31/60] common/sfc_efx/base: move Rx index\n\tcheck to generic code",
        "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": "Make NIC family specific functions a bit shorter and reduce\ncode duplication.\n\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/common/sfc_efx/base/ef10_rx.c | 45 +++++++++++----------------\n drivers/common/sfc_efx/base/efx_rx.c  | 31 +++++++++---------\n 2 files changed, 35 insertions(+), 41 deletions(-)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/ef10_rx.c b/drivers/common/sfc_efx/base/ef10_rx.c\nindex 58152be768..48666be5b5 100644\n--- a/drivers/common/sfc_efx/base/ef10_rx.c\n+++ b/drivers/common/sfc_efx/base/ef10_rx.c\n@@ -845,16 +845,11 @@ ef10_rx_qcreate(\n \tEFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << ESF_DZ_RX_QLABEL_WIDTH));\n \tEFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);\n \n-\tif (index >= encp->enc_rxq_limit) {\n-\t\trc = EINVAL;\n-\t\tgoto fail1;\n-\t}\n-\n \tswitch (type) {\n \tcase EFX_RXQ_TYPE_DEFAULT:\n \t\tif (type_data == NULL) {\n \t\t\trc = EINVAL;\n-\t\t\tgoto fail2;\n+\t\t\tgoto fail1;\n \t\t}\n \t\terp->er_buf_size = type_data->ertd_default.ed_buf_size;\n \t\tps_buf_size = 0;\n@@ -863,7 +858,7 @@ ef10_rx_qcreate(\n \tcase EFX_RXQ_TYPE_PACKED_STREAM:\n \t\tif (type_data == NULL) {\n \t\t\trc = EINVAL;\n-\t\t\tgoto fail3;\n+\t\t\tgoto fail2;\n \t\t}\n \t\tswitch (type_data->ertd_packed_stream.eps_buf_size) {\n \t\tcase EFX_RXQ_PACKED_STREAM_BUF_SIZE_1M:\n@@ -883,7 +878,7 @@ ef10_rx_qcreate(\n \t\t\tbreak;\n \t\tdefault:\n \t\t\trc = ENOTSUP;\n-\t\t\tgoto fail4;\n+\t\t\tgoto fail3;\n \t\t}\n \t\terp->er_buf_size = type_data->ertd_packed_stream.eps_buf_size;\n \t\tbreak;\n@@ -892,7 +887,7 @@ ef10_rx_qcreate(\n \tcase EFX_RXQ_TYPE_ES_SUPER_BUFFER:\n \t\tif (type_data == NULL) {\n \t\t\trc = EINVAL;\n-\t\t\tgoto fail5;\n+\t\t\tgoto fail4;\n \t\t}\n \t\tps_buf_size = 0;\n \t\tes_bufs_per_desc =\n@@ -907,7 +902,7 @@ ef10_rx_qcreate(\n #endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */\n \tdefault:\n \t\trc = ENOTSUP;\n-\t\tgoto fail6;\n+\t\tgoto fail5;\n \t}\n \n #if EFSYS_OPT_RX_PACKED_STREAM\n@@ -915,13 +910,13 @@ ef10_rx_qcreate(\n \t\t/* Check if datapath firmware supports packed stream mode */\n \t\tif (encp->enc_rx_packed_stream_supported == B_FALSE) {\n \t\t\trc = ENOTSUP;\n-\t\t\tgoto fail7;\n+\t\t\tgoto fail6;\n \t\t}\n \t\t/* Check if packed stream allows configurable buffer sizes */\n \t\tif ((ps_buf_size != MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M) &&\n \t\t    (encp->enc_rx_var_packed_stream_supported == B_FALSE)) {\n \t\t\trc = ENOTSUP;\n-\t\t\tgoto fail8;\n+\t\t\tgoto fail7;\n \t\t}\n \t}\n #else /* EFSYS_OPT_RX_PACKED_STREAM */\n@@ -932,17 +927,17 @@ ef10_rx_qcreate(\n \tif (es_bufs_per_desc > 0) {\n \t\tif (encp->enc_rx_es_super_buffer_supported == B_FALSE) {\n \t\t\trc = ENOTSUP;\n-\t\t\tgoto fail9;\n+\t\t\tgoto fail8;\n \t\t}\n \t\tif (!EFX_IS_P2ALIGNED(uint32_t, es_max_dma_len,\n \t\t\t    EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) {\n \t\t\trc = EINVAL;\n-\t\t\tgoto fail10;\n+\t\t\tgoto fail9;\n \t\t}\n \t\tif (!EFX_IS_P2ALIGNED(uint32_t, es_buf_stride,\n \t\t\t    EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) {\n \t\t\trc = EINVAL;\n-\t\t\tgoto fail11;\n+\t\t\tgoto fail10;\n \t\t}\n \t}\n #else /* EFSYS_OPT_RX_ES_SUPER_BUFFER */\n@@ -964,7 +959,7 @@ ef10_rx_qcreate(\n \t\t    esmp, disable_scatter, want_inner_classes, erp->er_buf_size,\n \t\t    ps_buf_size, es_bufs_per_desc, es_max_dma_len,\n \t\t    es_buf_stride, hol_block_timeout)) != 0)\n-\t\tgoto fail12;\n+\t\tgoto fail11;\n \n \terp->er_eep = eep;\n \terp->er_label = label;\n@@ -975,36 +970,34 @@ ef10_rx_qcreate(\n \n \treturn (0);\n \n-fail12:\n-\tEFSYS_PROBE(fail12);\n-#if EFSYS_OPT_RX_ES_SUPER_BUFFER\n fail11:\n \tEFSYS_PROBE(fail11);\n+#if EFSYS_OPT_RX_ES_SUPER_BUFFER\n fail10:\n \tEFSYS_PROBE(fail10);\n fail9:\n \tEFSYS_PROBE(fail9);\n-#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */\n-#if EFSYS_OPT_RX_PACKED_STREAM\n fail8:\n \tEFSYS_PROBE(fail8);\n+#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */\n+#if EFSYS_OPT_RX_PACKED_STREAM\n fail7:\n \tEFSYS_PROBE(fail7);\n-#endif /* EFSYS_OPT_RX_PACKED_STREAM */\n fail6:\n \tEFSYS_PROBE(fail6);\n-#if EFSYS_OPT_RX_ES_SUPER_BUFFER\n+#endif /* EFSYS_OPT_RX_PACKED_STREAM */\n fail5:\n \tEFSYS_PROBE(fail5);\n-#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */\n-#if EFSYS_OPT_RX_PACKED_STREAM\n+#if EFSYS_OPT_RX_ES_SUPER_BUFFER\n fail4:\n \tEFSYS_PROBE(fail4);\n+#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */\n+#if EFSYS_OPT_RX_PACKED_STREAM\n fail3:\n \tEFSYS_PROBE(fail3);\n-#endif /* EFSYS_OPT_RX_PACKED_STREAM */\n fail2:\n \tEFSYS_PROBE(fail2);\n+#endif /* EFSYS_OPT_RX_PACKED_STREAM */\n fail1:\n \tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n \ndiff --git a/drivers/common/sfc_efx/base/efx_rx.c b/drivers/common/sfc_efx/base/efx_rx.c\nindex d208c2292e..bacab5ec67 100644\n--- a/drivers/common/sfc_efx/base/efx_rx.c\n+++ b/drivers/common/sfc_efx/base/efx_rx.c\n@@ -824,11 +824,16 @@ efx_rx_qcreate_internal(\n \tEFSYS_ASSERT(ISP2(encp->enc_rxq_max_ndescs));\n \tEFSYS_ASSERT(ISP2(encp->enc_rxq_min_ndescs));\n \n+\tif (index >= encp->enc_rxq_limit) {\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\n \tif (!ISP2(ndescs) ||\n \t    ndescs < encp->enc_rxq_min_ndescs ||\n \t    ndescs > encp->enc_rxq_max_ndescs) {\n \t\trc = EINVAL;\n-\t\tgoto fail1;\n+\t\tgoto fail2;\n \t}\n \n \t/* Allocate an RXQ object */\n@@ -836,7 +841,7 @@ efx_rx_qcreate_internal(\n \n \tif (erp == NULL) {\n \t\trc = ENOMEM;\n-\t\tgoto fail2;\n+\t\tgoto fail3;\n \t}\n \n \terp->er_magic = EFX_RXQ_MAGIC;\n@@ -847,17 +852,19 @@ efx_rx_qcreate_internal(\n \n \tif ((rc = erxop->erxo_qcreate(enp, index, label, type, type_data, esmp,\n \t    ndescs, id, flags, eep, erp)) != 0)\n-\t\tgoto fail3;\n+\t\tgoto fail4;\n \n \tenp->en_rx_qcount++;\n \t*erpp = erp;\n \n \treturn (0);\n \n-fail3:\n-\tEFSYS_PROBE(fail3);\n+fail4:\n+\tEFSYS_PROBE(fail4);\n \n \tEFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);\n+fail3:\n+\tEFSYS_PROBE(fail3);\n fail2:\n \tEFSYS_PROBE(fail2);\n fail1:\n@@ -1635,10 +1642,6 @@ siena_rx_qcreate(\n \t    (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH));\n \tEFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);\n \n-\tif (index >= encp->enc_rxq_limit) {\n-\t\trc = EINVAL;\n-\t\tgoto fail1;\n-\t}\n \tfor (size = 0;\n \t    (1U << size) <= encp->enc_rxq_max_ndescs / encp->enc_rxq_min_ndescs;\n \t    size++)\n@@ -1646,7 +1649,7 @@ siena_rx_qcreate(\n \t\t\tbreak;\n \tif (id + (1 << size) >= encp->enc_buftbl_limit) {\n \t\trc = EINVAL;\n-\t\tgoto fail2;\n+\t\tgoto fail1;\n \t}\n \n \tswitch (type) {\n@@ -1656,7 +1659,7 @@ siena_rx_qcreate(\n \n \tdefault:\n \t\trc = EINVAL;\n-\t\tgoto fail3;\n+\t\tgoto fail2;\n \t}\n \n \tif (flags & EFX_RXQ_FLAG_SCATTER) {\n@@ -1664,7 +1667,7 @@ siena_rx_qcreate(\n \t\tjumbo = B_TRUE;\n #else\n \t\trc = EINVAL;\n-\t\tgoto fail4;\n+\t\tgoto fail3;\n #endif\t/* EFSYS_OPT_RX_SCATTER */\n \t}\n \n@@ -1684,11 +1687,9 @@ siena_rx_qcreate(\n \treturn (0);\n \n #if !EFSYS_OPT_RX_SCATTER\n-fail4:\n-\tEFSYS_PROBE(fail4);\n-#endif\n fail3:\n \tEFSYS_PROBE(fail3);\n+#endif\n fail2:\n \tEFSYS_PROBE(fail2);\n fail1:\n",
    "prefixes": [
        "v3",
        "31/60"
    ]
}