Show a patch.

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

{
    "id": 41066,
    "url": "http://patches.dpdk.org/api/patches/41066/",
    "web_url": "http://patches.dpdk.org/patch/41066/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1528892062-4997-34-git-send-email-tomaszx.jozwiak@intel.com>",
    "date": "2018-06-13T12:14:17",
    "name": "[v3,33/38] crypto/qat: optimize adf modulo function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "776f302cbc67ae9c3e31b898d5b050170300e65c",
    "submitter": {
        "id": 949,
        "url": "http://patches.dpdk.org/api/people/949/",
        "name": "Tomasz Jozwiak",
        "email": "tomaszx.jozwiak@intel.com"
    },
    "delegate": {
        "id": 22,
        "url": "http://patches.dpdk.org/api/users/22/",
        "username": "pdelarag",
        "first_name": "Pablo",
        "last_name": "de Lara Guarch",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/41066/mbox/",
    "series": [
        {
            "id": 111,
            "url": "http://patches.dpdk.org/api/series/111/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=111",
            "date": "2018-06-13T12:13:44",
            "name": "crypto/qat: refactor to support multiple services",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/111/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41066/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/41066/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "References": "<1523040732-3290-1-git-send-email-fiona.trahe@intel.com>\n\t<1528892062-4997-1-git-send-email-tomaszx.jozwiak@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,218,1526367600\"; d=\"scan'208\";a=\"63727851\"",
        "Date": "Wed, 13 Jun 2018 14:14:17 +0200",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-ExtLoop1": "1",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1528892062-4997-34-git-send-email-tomaszx.jozwiak@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 24C441EF8F;\n\tWed, 13 Jun 2018 14:15:57 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id 203551EF93\n\tfor <dev@dpdk.org>; Wed, 13 Jun 2018 14:15:09 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Jun 2018 05:15:09 -0700",
            "from tjozwiax-mobl.ger.corp.intel.com (HELO localhost.localdomain)\n\t([10.103.104.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 13 Jun 2018 05:15:08 -0700"
        ],
        "Subject": "[dpdk-dev] [PATCH v3 33/38] crypto/qat: optimize adf modulo function",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-Mailer": "git-send-email 2.7.4",
        "Precedence": "list",
        "From": "Tomasz Jozwiak <tomaszx.jozwiak@intel.com>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-Amp-File-Uploaded": "False",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "In-Reply-To": "<1528892062-4997-1-git-send-email-tomaszx.jozwiak@intel.com>",
        "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "fiona.trahe@intel.com,\n\ttomaszx.jozwiak@intel.com,\n\tdev@dpdk.org",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "From: Fiona Trahe <fiona.trahe@intel.com>\n\nSigned-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>\nSigned-off-by: Fiona Trahe <fiona.trahe@intel.com>\n---\n drivers/crypto/qat/qat_qp.c | 19 ++++++++-----------\n drivers/crypto/qat/qat_qp.h |  2 +-\n 2 files changed, 9 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c\nindex 569eace57..b84ba643c 100644\n--- a/drivers/crypto/qat/qat_qp.c\n+++ b/drivers/crypto/qat/qat_qp.c\n@@ -376,7 +376,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,\n \n \tqueue->max_inflights = ADF_MAX_INFLIGHTS(queue->queue_size,\n \t\t\t\t\tADF_BYTES_TO_MSG_SIZE(desc_size));\n-\tqueue->modulo = ADF_RING_SIZE_MODULO(queue->queue_size);\n+\tqueue->modulo_mask = (1 << ADF_RING_SIZE_MODULO(queue->queue_size)) - 1;\n \n \tif (queue->max_inflights < 2) {\n \t\tPMD_DRV_LOG(ERR, \"Invalid num inflights\");\n@@ -401,11 +401,11 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,\n \t\t\tqueue->hw_queue_number, queue_base);\n \n \tPMD_DRV_LOG(DEBUG, \"RING: Name:%s, size in CSR: %u, in bytes %u,\"\n-\t\t\t\" nb msgs %u, msg_size %u, max_inflights %u modulo %u\",\n+\t\t\" nb msgs %u, msg_size %u, max_inflights %u modulo mask %u\",\n \t\t\tqueue->memz_name,\n \t\t\tqueue->queue_size, queue_size_bytes,\n \t\t\tqp_conf->nb_descriptors, desc_size,\n-\t\t\tqueue->max_inflights, queue->modulo);\n+\t\t\tqueue->max_inflights, queue->modulo_mask);\n \n \treturn 0;\n \n@@ -494,13 +494,9 @@ static void adf_configure_queues(struct qat_qp *qp)\n \t\t\tqueue->hw_queue_number, queue_config);\n }\n \n-\n-static inline uint32_t adf_modulo(uint32_t data, uint32_t shift)\n+static inline uint32_t adf_modulo(uint32_t data, uint32_t modulo_mask)\n {\n-\tuint32_t div = data >> shift;\n-\tuint32_t mult = div << shift;\n-\n-\treturn data - mult;\n+\treturn data & modulo_mask;\n }\n \n static inline void\n@@ -584,7 +580,7 @@ qat_enqueue_op_burst(void *qp, void **ops, uint16_t nb_ops)\n \t\t\tgoto kick_tail;\n \t\t}\n \n-\t\ttail = adf_modulo(tail + queue->msg_size, queue->modulo);\n+\t\ttail = adf_modulo(tail + queue->msg_size, queue->modulo_mask);\n \t\tops++;\n \t\tnb_ops_sent++;\n \t}\n@@ -620,7 +616,8 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)\n \t\t\ttmp_qp->op_cookies[head / rx_queue->msg_size],\n \t\t\ttmp_qp->qat_dev_gen);\n \n-\t\thead = adf_modulo(head + rx_queue->msg_size, rx_queue->modulo);\n+\t\thead = adf_modulo(head + rx_queue->msg_size,\n+\t\t\t\t  rx_queue->modulo_mask);\n \n \t\tresp_msg = (uint8_t *)rx_queue->base_addr + head;\n \t\tops++;\ndiff --git a/drivers/crypto/qat/qat_qp.h b/drivers/crypto/qat/qat_qp.h\nindex 6f07bd67c..764125d59 100644\n--- a/drivers/crypto/qat/qat_qp.h\n+++ b/drivers/crypto/qat/qat_qp.h\n@@ -59,7 +59,7 @@ struct qat_queue {\n \trte_iova_t\tbase_phys_addr;\t\t/* Queue physical address */\n \tuint32_t\thead;\t\t\t/* Shadow copy of the head */\n \tuint32_t\ttail;\t\t\t/* Shadow copy of the tail */\n-\tuint32_t\tmodulo;\n+\tuint32_t\tmodulo_mask;\n \tuint32_t\tmsg_size;\n \tuint16_t\tmax_inflights;\n \tuint32_t\tqueue_size;\n",
    "prefixes": [
        "v3",
        "33/38"
    ]
}