get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50211,
    "url": "http://patches.dpdk.org/api/patches/50211/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1549556983-10896-14-git-send-email-arybchenko@solarflare.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": "<1549556983-10896-14-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1549556983-10896-14-git-send-email-arybchenko@solarflare.com",
    "date": "2019-02-07T16:29:18",
    "name": "[13/38] net/sfc/base: move Rx descs number check to generic place",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0e78811c737fa7de778b818eec1ae87c8b49997e",
    "submitter": {
        "id": 607,
        "url": "http://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.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/1549556983-10896-14-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 3411,
            "url": "http://patches.dpdk.org/api/series/3411/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3411",
            "date": "2019-02-07T16:29:05",
            "name": "net/sfc: update base driver",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3411/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50211/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50211/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 EBA3C1B5E3;\n\tThu,  7 Feb 2019 17:30:55 +0100 (CET)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n\t[67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 109CF1B584\n\tfor <dev@dpdk.org>; Thu,  7 Feb 2019 17:30:37 +0100 (CET)",
            "from webmail.solarflare.com (webmail.solarflare.com\n\t[12.187.104.26])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with\n\tESMTPS id 7E3F0B800AB; Thu,  7 Feb 2019 16:30:35 +0000 (UTC)",
            "from ocex03.SolarFlarecom.com (10.20.40.36) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id 15.0.1395.4; Thu, 7 Feb 2019 08:30:31 -0800",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id\n\t15.0.1395.4 via Frontend Transport; Thu, 7 Feb 2019 08:30:30 -0800",
            "from ukv-loginhost.uk.solarflarecom.com\n\t(ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n\tby opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tx17GUTI4015297; Thu, 7 Feb 2019 16:30:29 GMT",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\tB152E1613EB; Thu,  7 Feb 2019 16:30:29 +0000 (GMT)"
        ],
        "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, 7 Feb 2019 16:29:18 +0000",
        "Message-ID": "<1549556983-10896-14-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1549556983-10896-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1549556983-10896-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.5.1010-24412.006",
        "X-TM-AS-Result": "No-0.697500-4.000000-10",
        "X-TMASE-MatchedRID": "9WYT2qPyU1YiEWtcrbQQlEhwlOfYeSqxAZn/4A9db2Q6iP0NczjR0rMj\n\t3GAElQGEkIlKoLwVBVA7vXufZrD7R1/ag3kgZsCOA9lly13c/gG2McZY43zJ423D6f6IpbLIvYJ\n\tm+b+NbBTkobaacTqc3kAlaGOdOryH/2Js40AzW7HFdQh7TH86oFo1rFkFFs1ab2/9OR1aBlmuX8\n\trN1wOiubrayfVfLsmBR9eR7TRsHPp4ha1qhP6vPs36paW7ZnFoD/niSB+IuEubKItl61J/yZ+in\n\tTK0bC9eKrauXd3MZDVCXUhkf96YXMC6mJ/CnWEKN0y0VBKx2wGrgqPqvh2MJtWtKMIgNtBun1Qq\n\t1dVkUMqpOemTJhoD9dMAF2ohZVO6QxX6aTAKrcVGkBjbMbD9rzigZBQJvBjlD6DuZ3COjrnoW0N\n\tkKZgEnVjylogJTbSO73QlCBbmrKs=",
        "X-TM-AS-User-Approved-Sender": "No",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10-0.697500-4.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24412.006",
        "X-MDID": "1549557036-jo4zcEeRwY0m",
        "Subject": "[dpdk-dev] [PATCH 13/38] net/sfc/base: move Rx descs number check\n\tto generic place",
        "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": "From: Igor Romanov <igor.romanov@oktetlabs.ru>\n\nNow we have min/max limits in NIC config, so we can do check against\nmin/max in a generic place instead of NIC family specific functions.\nCheck that the descriptors number is a power of 2 is also can be\nmade common. It removes code duplication and makes NIC family\nspecific functions a bit shorter.\n\nSigned-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/sfc/base/ef10_rx.c | 49 +++++++++++++---------------------\n drivers/net/sfc/base/efx_rx.c  | 42 +++++++++++++++--------------\n 2 files changed, 41 insertions(+), 50 deletions(-)",
    "diff": "diff --git a/drivers/net/sfc/base/ef10_rx.c b/drivers/net/sfc/base/ef10_rx.c\nindex 1f2a6e009..f2b72571a 100644\n--- a/drivers/net/sfc/base/ef10_rx.c\n+++ b/drivers/net/sfc/base/ef10_rx.c\n@@ -1012,18 +1012,9 @@ ef10_rx_qcreate(\n \tEFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);\n \tEFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);\n \n-\tEFSYS_ASSERT(ISP2(encp->enc_rxq_max_ndescs));\n-\tEFSYS_ASSERT(ISP2(encp->enc_rxq_min_ndescs));\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}\n \tif (index >= encp->enc_rxq_limit) {\n \t\trc = EINVAL;\n-\t\tgoto fail2;\n+\t\tgoto fail1;\n \t}\n \n \tswitch (type) {\n@@ -1034,7 +1025,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@@ -1054,7 +1045,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\tbreak;\n #endif /* EFSYS_OPT_RX_PACKED_STREAM */\n@@ -1062,7 +1053,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@@ -1077,7 +1068,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@@ -1085,13 +1076,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@@ -1102,17 +1093,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 (!IS_P2ALIGNED(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 (!IS_P2ALIGNED(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@@ -1134,7 +1125,7 @@ ef10_rx_qcreate(\n \t\t    esmp, disable_scatter, want_inner_classes,\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@@ -1145,36 +1136,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/net/sfc/base/efx_rx.c b/drivers/net/sfc/base/efx_rx.c\nindex 332f8c800..8910cd5f7 100644\n--- a/drivers/net/sfc/base/efx_rx.c\n+++ b/drivers/net/sfc/base/efx_rx.c\n@@ -794,17 +794,28 @@ efx_rx_qcreate_internal(\n {\n \tconst efx_rx_ops_t *erxop = enp->en_erxop;\n \tefx_rxq_t *erp;\n+\tconst efx_nic_cfg_t *encp = efx_nic_cfg_get(enp);\n \tefx_rc_t rc;\n \n \tEFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);\n \tEFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);\n \n+\tEFSYS_ASSERT(ISP2(encp->enc_rxq_max_ndescs));\n+\tEFSYS_ASSERT(ISP2(encp->enc_rxq_min_ndescs));\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}\n+\n \t/* Allocate an RXQ object */\n \tEFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_rxq_t), erp);\n \n \tif (erp == NULL) {\n \t\trc = ENOMEM;\n-\t\tgoto fail1;\n+\t\tgoto fail2;\n \t}\n \n \terp->er_magic = EFX_RXQ_MAGIC;\n@@ -815,17 +826,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 fail2;\n+\t\tgoto fail3;\n \n \tenp->en_rx_qcount++;\n \t*erpp = erp;\n \n \treturn (0);\n \n-fail2:\n-\tEFSYS_PROBE(fail2);\n+fail3:\n+\tEFSYS_PROBE(fail3);\n \n \tEFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);\n+fail2:\n+\tEFSYS_PROBE(fail2);\n fail1:\n \tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n \n@@ -1590,18 +1603,9 @@ siena_rx_qcreate(\n \tEFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);\n \tEFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);\n \n-\tEFSYS_ASSERT(ISP2(encp->enc_rxq_max_ndescs));\n-\tEFSYS_ASSERT(ISP2(encp->enc_rxq_min_ndescs));\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}\n \tif (index >= encp->enc_rxq_limit) {\n \t\trc = EINVAL;\n-\t\tgoto fail2;\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@@ -1610,7 +1614,7 @@ siena_rx_qcreate(\n \t\t\tbreak;\n \tif (id + (1 << size) >= encp->enc_buftbl_limit) {\n \t\trc = EINVAL;\n-\t\tgoto fail3;\n+\t\tgoto fail2;\n \t}\n \n \tswitch (type) {\n@@ -1619,7 +1623,7 @@ siena_rx_qcreate(\n \n \tdefault:\n \t\trc = EINVAL;\n-\t\tgoto fail4;\n+\t\tgoto fail3;\n \t}\n \n \tif (flags & EFX_RXQ_FLAG_SCATTER) {\n@@ -1627,7 +1631,7 @@ siena_rx_qcreate(\n \t\tjumbo = B_TRUE;\n #else\n \t\trc = EINVAL;\n-\t\tgoto fail5;\n+\t\tgoto fail4;\n #endif\t/* EFSYS_OPT_RX_SCATTER */\n \t}\n \n@@ -1647,11 +1651,9 @@ siena_rx_qcreate(\n \treturn (0);\n \n #if !EFSYS_OPT_RX_SCATTER\n-fail5:\n-\tEFSYS_PROBE(fail5);\n-#endif\n fail4:\n \tEFSYS_PROBE(fail4);\n+#endif\n fail3:\n \tEFSYS_PROBE(fail3);\n fail2:\n",
    "prefixes": [
        "13/38"
    ]
}