get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92671,
    "url": "https://patches.dpdk.org/api/patches/92671/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210503152238.2437-34-pbhagavatula@marvell.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": "<20210503152238.2437-34-pbhagavatula@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210503152238.2437-34-pbhagavatula@marvell.com",
    "date": "2021-05-03T15:22:36",
    "name": "[v4,33/34] event/cnxk: add timer adapter start and stop",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2b604029533206a32e3568ab1b99833dc59b288b",
    "submitter": {
        "id": 1183,
        "url": "https://patches.dpdk.org/api/people/1183/?format=api",
        "name": "Pavan Nikhilesh Bhagavatula",
        "email": "pbhagavatula@marvell.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210503152238.2437-34-pbhagavatula@marvell.com/mbox/",
    "series": [
        {
            "id": 16799,
            "url": "https://patches.dpdk.org/api/series/16799/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16799",
            "date": "2021-05-03T15:22:03",
            "name": "Marvell CNXK Event device Driver",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/16799/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/92671/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/92671/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 98C60A0562;\n\tMon,  3 May 2021 17:26:57 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6C10B411DC;\n\tMon,  3 May 2021 17:24:45 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 54C5D411D8\n for <dev@dpdk.org>; Mon,  3 May 2021 17:24:44 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 143FA9eL032487 for <dev@dpdk.org>; Mon, 3 May 2021 08:24:43 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com with ESMTP id 38ad05herm-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Mon, 03 May 2021 08:24:43 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Mon, 3 May 2021 08:24:41 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Mon, 3 May 2021 08:24:40 -0700",
            "from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176])\n by maili.marvell.com (Postfix) with ESMTP id CB2DB3F703F;\n Mon,  3 May 2021 08:24:39 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=Ux8UPAEKVRmN/cl7dCFWVf7Kaar1hHC1ysMQsyst6ko=;\n b=A8cldfOA43hlI5Uw3Gt53/5mAcoLcgbgUysOKlkKs2icqW+5dtAHtZwaojVY7FjJ1CFp\n 8m8idFXvwV7LMTznB7+4fhblEOcexJk1tHrKsFJWCpt0vxA2cAdAH+kDdEGV+GRj5O17\n MgGc+xgKeiCXB2CVFlYytXXC2w8Bi2iJq8z8aGIC9aV0F9APd6VhkDsyZQIc69p7iyDT\n BasBsZ9sjKFdT0JrxnfSSNWHousTEq/gmuhHuz8cM4Ehh09DheQBM2ThSJpEfMwQ/cdb\n cq8RnBMAMgGRhn5Rr9MvH+c6a4g8w5m8NdWxHp4LD/+vtRIYvcRcr4frfR3j5NLEooxy tw==",
        "From": "<pbhagavatula@marvell.com>",
        "To": "<jerinj@marvell.com>, Pavan Nikhilesh <pbhagavatula@marvell.com>, \"Shijith\n Thotton\" <sthotton@marvell.com>",
        "CC": "<dev@dpdk.org>",
        "Date": "Mon, 3 May 2021 20:52:36 +0530",
        "Message-ID": "<20210503152238.2437-34-pbhagavatula@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210503152238.2437-1-pbhagavatula@marvell.com>",
        "References": "<20210430135336.2749-1-pbhagavatula@marvell.com>\n <20210503152238.2437-1-pbhagavatula@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "Z3ZrAlpiwIBj89EzoPuAxUeXL991EddL",
        "X-Proofpoint-ORIG-GUID": "Z3ZrAlpiwIBj89EzoPuAxUeXL991EddL",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761\n definitions=2021-05-03_10:2021-05-03,\n 2021-05-03 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v4 33/34] event/cnxk: add timer adapter start and\n stop",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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: Shijith Thotton <sthotton@marvell.com>\n\nAdd event timer adapter start and stop functions.\n\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\nSigned-off-by: Shijith Thotton <sthotton@marvell.com>\n---\n drivers/event/cnxk/cnxk_tim_evdev.c | 71 ++++++++++++++++++++++++++++-\n 1 file changed, 70 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/event/cnxk/cnxk_tim_evdev.c b/drivers/event/cnxk/cnxk_tim_evdev.c\nindex a73ca33d8..19b71b4f5 100644\n--- a/drivers/event/cnxk/cnxk_tim_evdev.c\n+++ b/drivers/event/cnxk/cnxk_tim_evdev.c\n@@ -246,6 +246,73 @@ cnxk_tim_ring_free(struct rte_event_timer_adapter *adptr)\n \treturn 0;\n }\n \n+static void\n+cnxk_tim_calibrate_start_tsc(struct cnxk_tim_ring *tim_ring)\n+{\n+#define CNXK_TIM_CALIB_ITER 1E6\n+\tuint32_t real_bkt, bucket;\n+\tint icount, ecount = 0;\n+\tuint64_t bkt_cyc;\n+\n+\tfor (icount = 0; icount < CNXK_TIM_CALIB_ITER; icount++) {\n+\t\treal_bkt = plt_read64(tim_ring->base + TIM_LF_RING_REL) >> 44;\n+\t\tbkt_cyc = cnxk_tim_cntvct();\n+\t\tbucket = (bkt_cyc - tim_ring->ring_start_cyc) /\n+\t\t\t tim_ring->tck_int;\n+\t\tbucket = bucket % (tim_ring->nb_bkts);\n+\t\ttim_ring->ring_start_cyc =\n+\t\t\tbkt_cyc - (real_bkt * tim_ring->tck_int);\n+\t\tif (bucket != real_bkt)\n+\t\t\tecount++;\n+\t}\n+\ttim_ring->last_updt_cyc = bkt_cyc;\n+\tplt_tim_dbg(\"Bucket mispredict %3.2f distance %d\\n\",\n+\t\t    100 - (((double)(icount - ecount) / (double)icount) * 100),\n+\t\t    bucket - real_bkt);\n+}\n+\n+static int\n+cnxk_tim_ring_start(const struct rte_event_timer_adapter *adptr)\n+{\n+\tstruct cnxk_tim_ring *tim_ring = adptr->data->adapter_priv;\n+\tstruct cnxk_tim_evdev *dev = cnxk_tim_priv_get();\n+\tint rc;\n+\n+\tif (dev == NULL)\n+\t\treturn -ENODEV;\n+\n+\trc = roc_tim_lf_enable(&dev->tim, tim_ring->ring_id,\n+\t\t\t       &tim_ring->ring_start_cyc, NULL);\n+\tif (rc < 0)\n+\t\treturn rc;\n+\n+\ttim_ring->tck_int = NSEC2TICK(tim_ring->tck_nsec, cnxk_tim_cntfrq());\n+\ttim_ring->tot_int = tim_ring->tck_int * tim_ring->nb_bkts;\n+\ttim_ring->fast_div = rte_reciprocal_value_u64(tim_ring->tck_int);\n+\ttim_ring->fast_bkt = rte_reciprocal_value_u64(tim_ring->nb_bkts);\n+\n+\tcnxk_tim_calibrate_start_tsc(tim_ring);\n+\n+\treturn rc;\n+}\n+\n+static int\n+cnxk_tim_ring_stop(const struct rte_event_timer_adapter *adptr)\n+{\n+\tstruct cnxk_tim_ring *tim_ring = adptr->data->adapter_priv;\n+\tstruct cnxk_tim_evdev *dev = cnxk_tim_priv_get();\n+\tint rc;\n+\n+\tif (dev == NULL)\n+\t\treturn -ENODEV;\n+\n+\trc = roc_tim_lf_disable(&dev->tim, tim_ring->ring_id);\n+\tif (rc < 0)\n+\t\tplt_err(\"Failed to disable timer ring\");\n+\n+\treturn rc;\n+}\n+\n static int\n cnxk_tim_stats_get(const struct rte_event_timer_adapter *adapter,\n \t\t   struct rte_event_timer_adapter_stats *stats)\n@@ -278,13 +345,14 @@ cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,\n \tstruct cnxk_tim_evdev *dev = cnxk_tim_priv_get();\n \n \tRTE_SET_USED(flags);\n-\tRTE_SET_USED(ops);\n \n \tif (dev == NULL)\n \t\treturn -ENODEV;\n \n \tcnxk_tim_ops.init = cnxk_tim_ring_create;\n \tcnxk_tim_ops.uninit = cnxk_tim_ring_free;\n+\tcnxk_tim_ops.start = cnxk_tim_ring_start;\n+\tcnxk_tim_ops.stop = cnxk_tim_ring_stop;\n \tcnxk_tim_ops.get_info = cnxk_tim_ring_info_get;\n \n \tif (dev->enable_stats) {\n@@ -295,6 +363,7 @@ cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,\n \t/* Store evdev pointer for later use. */\n \tdev->event_dev = (struct rte_eventdev *)(uintptr_t)evdev;\n \t*caps = RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT;\n+\t*ops = &cnxk_tim_ops;\n \n \treturn 0;\n }\n",
    "prefixes": [
        "v4",
        "33/34"
    ]
}