Show a patch.

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

{
    "id": 74577,
    "url": "https://patches.dpdk.org/api/patches/74577/",
    "web_url": "https://patches.dpdk.org/patch/74577/",
    "project": {
        "id": 1,
        "url": "https://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": "<20200721144107.25550-2-ophirmu@mellanox.com>",
    "date": "2020-07-21T14:41:07",
    "name": "[v3] net/mlx5: return EAGAIN on premature disable interrupt calls",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ae8c624e4b2ce3059ce4d2f65501d0d7bec5cb2d",
    "submitter": {
        "id": 793,
        "url": "https://patches.dpdk.org/api/people/793/",
        "name": "Ophir Munk",
        "email": "ophirmu@mellanox.com"
    },
    "delegate": {
        "id": 3268,
        "url": "https://patches.dpdk.org/api/users/3268/",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@mellanox.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74577/mbox/",
    "series": [
        {
            "id": 11214,
            "url": "https://patches.dpdk.org/api/series/11214/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11214",
            "date": "2020-07-21T14:41:07",
            "name": "[v3] net/mlx5: return EAGAIN on premature disable interrupt calls",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/11214/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74577/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74577/checks/",
    "tags": {},
    "headers": {
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-Mailman-Version": "2.1.15",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM6PR05MB6055",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "X-MS-Exchange-Transport-Forked": "True",
        "X-BeenThere": "dev@dpdk.org",
        "X-LD-Processed": "a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd",
        "X-ClientProxiedBy": "AM4PR07CA0012.eurprd07.prod.outlook.com\n (2603:10a6:205:1::25) To AM6PR05MB4216.eurprd05.prod.outlook.com\n (2603:10a6:209:41::13)",
        "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n 5xjcvbb07uLXn2sjrogB5s8ekegEPD8mQQrzE13WwUOGmh8aPsM5WQ4h3h2pX6rOJXpnkzEtO6uyH5QbFa6h5w==",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-AntiSpam-MessageData": "\n xIe5wQiFcP93mpmz7nDt9PhUTrxZMMO1lLjASsmeg8s7OQdyHbVQ8tHdYHWXJLRssaViSScsm2vWAFusd2TVFP1zuKAAYyjc1+K6PB+AtZaAcpIjyW2HFOQfkw4TweTXhmT+lQ9Lq7UysLjRd3p2rPJZHzIuernWccvlWouM0U9meHsVAQOijx4GzQ2IaMBW/Osq8E/1mzvQdYZbBN2Lt0GcBbGdP1EjL0DXBx6JRgdINRi6m7sSR05K9sAiBnw+McwHcG+slbhmlGNFWdGq3GN/KYurOA410X9lY/g95cyKMaYnsgDl+L68fypagZ7HcXYTp+M1pD+YQIZl8hEtZ0CmVddShWNbZIZO7E024FiMRdVZ1qeMaGD/gGE4uv6d74OoIXnOx+KJ0h/+kCRe/okuMOawsVZjdtcqt7mkFex6KxWjxjHpj+KLCJa/JD3NXjG0AOUcg4fnMLdtkCklMNVNu0n4ljMGtsgQtaXVd3015hxwxCUeVH1lBION+Qus",
        "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 0B9C1A0526;\n\tTue, 21 Jul 2020 16:41:29 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 561E71C00F;\n\tTue, 21 Jul 2020 16:41:19 +0200 (CEST)",
            "from EUR04-HE1-obe.outbound.protection.outlook.com\n (mail-eopbgr70048.outbound.protection.outlook.com [40.107.7.48])\n by dpdk.org (Postfix) with ESMTP id 2D8561BFE4\n for <dev@dpdk.org>; Tue, 21 Jul 2020 16:41:16 +0200 (CEST)",
            "from AM6PR05MB4216.eurprd05.prod.outlook.com (2603:10a6:209:41::13)\n by AM6PR05MB6055.eurprd05.prod.outlook.com (2603:10a6:20b:af::30)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Tue, 21 Jul\n 2020 14:41:14 +0000",
            "from AM6PR05MB4216.eurprd05.prod.outlook.com\n ([fe80::b40f:4c0e:77de:a785]) by AM6PR05MB4216.eurprd05.prod.outlook.com\n ([fe80::b40f:4c0e:77de:a785%4]) with mapi id 15.20.3195.026; Tue, 21 Jul 2020\n 14:41:14 +0000",
            "from mellanox.com (37.142.13.130) by\n AM4PR07CA0012.eurprd07.prod.outlook.com (2603:10a6:205:1::25) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.3216.14 via Frontend Transport; Tue, 21 Jul 2020 14:41:13 +0000"
        ],
        "Subject": "[dpdk-dev] [PATCH v3] net/mlx5: return EAGAIN on premature disable\n\tinterrupt calls",
        "X-MS-PublicTrafficType": "Email",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Message-Id": "<20200721144107.25550-2-ophirmu@mellanox.com>",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=hRM9oJXVt8VbBBc5hj5GzHXRKoSwnQl9Hhi5CpfuUZg=;\n b=TeV+zwl4ykw4HxGFJcD5VwHaOVjn5MXlSIYfUCzK4pyEqyIQFbW/ouguWKvYWNcgMZDdrFRio9XgktQCeeWgjA+fbeh/lqj6egcHTqRwdCCg3sbvIXNfY1QE5J/ZtdAMAX6wkiE6+Pp9eF0gLviH3Ylkr4fYlTmQzYB+Y0jhWQo=",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-MS-Office365-Filtering-HT": "Tenant",
        "To": "dev@dpdk.org",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "From": "Ophir Munk <ophirmu@mellanox.com>",
        "X-Microsoft-Antispam-Message-Info": "\n 8mJ307MJduts7GQrkDJ5VwyW0+JU6iHKXh+pnd+JiEja1bv4JAscxHYtyAJiHCEz9/9MX8CIaXwWtqEiBmkN9Dt3hBKU0QdzdYvYTqLe11ioVSUxzxWV2HhcUU0BbBdXsAOxJXD9M1H04KkbIl/Qhedt83kMZTanw4jbYWAIo3cHBBJR8/bWqLQtmpQ9Ihgxl1xYE5rp+Xf+/ztqpCzc/aceL4UL78INZj2S2ZS1ViU5WPXPwDAndzVTTknCwpK1pNeibgQXV5D5LAxS7psZOdRS7p/5f52wKRJsT/xaK5HBifiBN9Ny7Yw3EiKgOkui1m6B6hm8Pvmd2vvnwrZPYg==",
        "Cc": "Raslan Darawsheh <rasland@mellanox.com>,\n Ophir Munk <ophirmu@mellanox.com>,\n Matan Azrad <matan@mellanox.com>",
        "X-MS-Exchange-CrossTenant-AuthSource": "AM6PR05MB4216.eurprd05.prod.outlook.com",
        "X-MS-TrafficTypeDiagnostic": "AM6PR05MB6055:",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com;\n dkim=pass header.d=mellanox.com; arc=none",
        "Authentication-Results": "dpdk.org; dkim=none (message not signed)\n header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com;",
        "X-OriginatorOrg": "Mellanox.com",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "X-Microsoft-Antispam-PRVS": "\n <AM6PR05MB6055A3150875691C0C73E572D1780@AM6PR05MB6055.eurprd05.prod.outlook.com>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "MIME-Version": "1.0",
        "In-Reply-To": "<20200721144107.25550-1-ophirmu@mellanox.com>",
        "X-MS-Exchange-MessageSentRepresentingType": "1",
        "References": "<20200721142449.24767-2-ophirmu@mellanox.com>\n <20200721144107.25550-1-ophirmu@mellanox.com>",
        "Content-Type": "text/plain",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:923;",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-Originating-IP": "[37.142.13.130]",
        "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:AM6PR05MB4216.eurprd05.prod.outlook.com; PTR:; CAT:NONE;\n SFTY:;\n SFS:(4636009)(366004)(107886003)(8936002)(498600001)(956004)(8676002)(2616005)(4326008)(7696005)(52116002)(2906002)(186003)(54906003)(26005)(16526019)(6916009)(86362001)(1076003)(36756003)(5660300002)(83380400001)(6666004)(66946007)(66476007)(66556008)(55016002)(8886007);\n DIR:OUT; SFP:1101;",
        "X-Mailer": [
            "git-send-email 2.8.4",
            "git-send-email 2.8.4"
        ],
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=hRM9oJXVt8VbBBc5hj5GzHXRKoSwnQl9Hhi5CpfuUZg=;\n b=eE6wZUnHTyFBnmdrk77lm6C+j1Nf7bGAaxRglAowI74HEDpTf0iGO4ZF4AX48wFDi5HuZpVfpelMBk6nCguf7e73wTCraPzblCyjIJQVOjTJW3AW0ZCbfuoUkLhwzw9BGJcR42aOkMEVJ3ktxWLhNvD19HfDwbxrmgbWpAfjZdiGmxBumwVPDjl0CryO0Kn01WtwAJGdxpq1uukfRCdWiwwrpo9Ib0Dkj/Pl9MGP38wuz2uaW2GBex0NJRcB4npSIb8PO/OBHiWWuDiDHhcvJoP8ZZBdWQdn8ypQnDo394A51KytHRvjCEz7z49Xrvhma8M7blfuYrk46TISdtTf5g==",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n f082c43a-b61b-4c2e-3ee2-08d82d841e66",
        "Date": "Tue, 21 Jul 2020 14:41:07 +0000",
        "X-MS-Office365-Filtering-Correlation-Id": "f082c43a-b61b-4c2e-3ee2-08d82d841e66",
        "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-CrossTenant-Id": "a652971c-7d2e-4d9b-a6a4-d149256f461b",
        "X-Microsoft-Antispam": "BCL:0;",
        "Errors-To": "dev-bounces@dpdk.org",
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=bDEMoraki/ae3ySXbFke4wtwFTImRt+paNYANt4EIP/M99F5cnP3z71BtMl9wo1kraIAXjKi2hOqOzM/q+xG6hdDSxY3n/wXd33DSfgXI6Nl8AgCx5RgVSUMolcUagJZCfHnK0EN+NVPKvxc4tjvNz60BKt+5ggFpm07d3l0u72UWajXWMozxqUJ5eugEJ57I+Eck/e+cb3Uw2pokW03tYX1nG6oOmXPyPEOPokQQvomzKOWFTQq6gZtN45OxBAW9OJqdE8qLdHx5JnvMfJOrf2dDSNBlu/n5BQPboqY29MtKwN04QyFiTQnPb1zvonVwvNWfCLYVg61GTq+CUjxWw==",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "21 Jul 2020 14:41:14.3494 (UTC)"
    },
    "content": "RXQ interrupts under Linux are based on the epoll mechanism. An\nexpected order of operations is as follows:\n1. Call rte_eth_dev_rx_intr_enable(), to arm the CQ for receiving events\non data input.\n2. Block on rte_epoll_wait() with an array of file descriptors\nrepresenting the CQ events. Upon data arrival the kernel will signal an\ninput event on the corresponding CQ fd.\n3. Call rte_eth_dev_rx_intr_disable() after the event was received and\ncontinue in polling mode. The mlx5 implementation of\nrte_eth_dev_rx_intr_disable() is to get the CQ event and ack it.\n\nIn practice applications may wake up from rte_epoll_wait() due to\ntimeout with no event to ack but still call\nrte_eth_dev_rx_intr_disable() unconditionally.  In such cases the call\nshould return EAGAIN (since the file descriptors are non-blocked), as\nopposed to EINVAL which indicates a real failure.  In case of EAGAIN the\nPMD should not warn on \"Unable to disable interrupt on Rx queue\".\n\nThis commit fixes a earlier commit where the returned value 0 from\nfunction devx_get_event() - was considered an error.\n\nFixes: 19e429e5c7c2 (\"net/mlx5: implement CQ for RxQ using DevX API\")\n\nSigned-off-by: Ophir Munk <ophirmu@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\nAcked-by: Raslan Darawsheh <rasland@mellanox.com>\n---\n drivers/net/mlx5/mlx5_rxq.c | 23 ++++++++++++++---------\n 1 file changed, 14 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c\nindex e6dc5ac..c78e522 100644\n--- a/drivers/net/mlx5/mlx5_rxq.c\n+++ b/drivers/net/mlx5/mlx5_rxq.c\n@@ -1188,10 +1188,8 @@ mlx5_rx_intr_disable(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \tif (rxq_obj->type == MLX5_RXQ_OBJ_TYPE_IBV) {\n \t\tret = mlx5_glue->get_cq_event(rxq_obj->ibv_channel, &ev_cq,\n \t\t\t\t\t      &ev_ctx);\n-\t\tif (ret || ev_cq != rxq_obj->ibv_cq) {\n-\t\t\trte_errno = EINVAL;\n+\t\tif (ret < 0 || ev_cq != rxq_obj->ibv_cq)\n \t\t\tgoto exit;\n-\t\t}\n \t\tmlx5_glue->ack_cq_events(rxq_obj->ibv_cq, 1);\n \t} else if (rxq_obj->type == MLX5_RXQ_OBJ_TYPE_DEVX_RQ) {\n #ifdef HAVE_IBV_DEVX_EVENT\n@@ -1200,22 +1198,29 @@ mlx5_rx_intr_disable(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \t\tret = mlx5_glue->devx_get_event\n \t\t\t\t(rxq_obj->devx_channel, event_data,\n \t\t\t\t sizeof(struct mlx5dv_devx_async_event_hdr));\n-\t\tif (ret <= 0 || event_data->cookie !=\n-\t\t\t\t(uint64_t)(uintptr_t)rxq_obj->devx_cq) {\n-\t\t\trte_errno = EINVAL;\n+\t\tif (ret < 0 || event_data->cookie !=\n+\t\t\t\t(uint64_t)(uintptr_t)rxq_obj->devx_cq)\n \t\t\tgoto exit;\n-\t\t}\n #endif /* HAVE_IBV_DEVX_EVENT */\n \t}\n \trxq_data->cq_arm_sn++;\n \tmlx5_rxq_obj_release(rxq_obj);\n \treturn 0;\n exit:\n+\t/**\n+\t * For ret < 0 save the errno (may be EAGAIN which means the get_event\n+\t * function was called before receiving one).\n+\t */\n+\tif (ret < 0)\n+\t\trte_errno = errno;\n+\telse\n+\t\trte_errno = EINVAL;\n \tret = rte_errno; /* Save rte_errno before cleanup. */\n \tif (rxq_obj)\n \t\tmlx5_rxq_obj_release(rxq_obj);\n-\tDRV_LOG(WARNING, \"port %u unable to disable interrupt on Rx queue %d\",\n-\t\tdev->data->port_id, rx_queue_id);\n+\tif (ret != EAGAIN)\n+\t\tDRV_LOG(WARNING, \"port %u unable to disable interrupt on Rx queue %d\",\n+\t\t\tdev->data->port_id, rx_queue_id);\n \trte_errno = ret; /* Restore rte_errno. */\n \treturn -rte_errno;\n }\n",
    "prefixes": [
        "v3"
    ]
}