From patchwork Tue Dec 6 12:18:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kanchan Joshi X-Patchwork-Id: 13065722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76E74C4708C for ; Tue, 6 Dec 2022 12:30:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232184AbiLFMaQ (ORCPT ); Tue, 6 Dec 2022 07:30:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbiLFMaP (ORCPT ); Tue, 6 Dec 2022 07:30:15 -0500 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD54029806 for ; Tue, 6 Dec 2022 04:30:13 -0800 (PST) Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20221206123012epoutp01224cbb2fbb6a2b3e0cb962b05b28f05c~uNB1P9Tzb0754007540epoutp01u for ; Tue, 6 Dec 2022 12:30:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20221206123012epoutp01224cbb2fbb6a2b3e0cb962b05b28f05c~uNB1P9Tzb0754007540epoutp01u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1670329812; bh=roC5AGYnzf8QVqNY7i2ZmkgrWI89pUYYTw5QCbBfAS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X5kySeOYXeouW6onGE0RAGfG3WTn0uR4H3S3KuYizS0uwgW7z0s05h5uyBW0x7vSH 2reiz5QHioXyy4DwhjXDqiyZa6bCO/EW4Wmbr1E2Vz0FVmiejmquZL2Dhtbdyym6tM gMQ3ISsrkiZoddkNBzVLxwRidbdcrGxohTQPuCSY= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20221206123011epcas5p48c9f8de2fa3db5fe4358e01424a23a76~uNB08Ptpy1128511285epcas5p4E; Tue, 6 Dec 2022 12:30:11 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.183]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4NRKW65zGBz4x9Pt; Tue, 6 Dec 2022 12:30:10 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 1D.B6.56352.1D53F836; Tue, 6 Dec 2022 21:30:09 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20221206123009epcas5p4d65eca3320f9845e190fc425a06799a6~uNBySsFA90906209062epcas5p46; Tue, 6 Dec 2022 12:30:09 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221206123009epsmtrp1049f97e812f573aab7447420a22cdc8a~uNBySFYhM0728207282epsmtrp1F; Tue, 6 Dec 2022 12:30:09 +0000 (GMT) X-AuditID: b6c32a4b-383ff7000001dc20-63-638f35d14c3f Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 55.9E.18644.0D53F836; Tue, 6 Dec 2022 21:30:08 +0900 (KST) Received: from localhost.localdomain (unknown [107.110.206.5]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221206123008epsmtip216a83ea9ae94423a36d346bd6a22284d~uNBxeFT2D3142831428epsmtip2F; Tue, 6 Dec 2022 12:30:08 +0000 (GMT) From: Kanchan Joshi To: axboe@kernel.dk Cc: io-uring@vger.kernel.org, Kanchan Joshi Subject: [PATCH liburing 1/2] test/io_uring_passthrough: fix iopoll test Date: Tue, 6 Dec 2022 17:48:30 +0530 Message-Id: <20221206121831.5528-2-joshi.k@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221206121831.5528-1-joshi.k@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIKsWRmVeSWpSXmKPExsWy7bCmlu5F0/5kg5kzZS1W3+1ns3jXeo7F 4uj/t2wOzB6Xz5Z69G1ZxejxeZNcAHNUtk1GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6h pYW5kkJeYm6qrZKLT4CuW2YO0B4lhbLEnFKgUEBicbGSvp1NUX5pSapCRn5xia1SakFKToFJ gV5xYm5xaV66Xl5qiZWhgYGRKVBhQnbGzUvTGAse8VbM6nzK2MA4ibuLkZNDQsBE4s+ra4xd jFwcQgK7GSUOrG5nhXA+MUq0tt1kB6kSEvjMKDHlUjFMx4X3L1kginYxSnTOOckG4QAVffx8 kqmLkYODTUBT4sLkUpAGEQFhif0drSwgYWYBR4n1x1RBwsICHhKd55cygdgsAqoSl5feZQSx eQXMJf7fW80EsUteYual7+wgrZwCFhJNHy0hSgQlTs58wgJiMwOVNG+dzQxygYTANnaJJdM/ sUH0ukjMfP6CEcIWlnh1fAs7hC0l8bK/DcpOlrg08xzUrhKJx3sOQtn2Eq2n+pkhTtaUWL9L H2IXn0Tv7ydgD0oI8Ep0tAlBVCtK3Jv0lBXCFpd4OGMJlO0h8eB7PzMkcLoZJR4ePs02gVF+ FpIXZiF5YRbCtgWMzKsYJVMLinPTU4tNC4zzUsvhsZqcn7uJEZzWtLx3MD568EHvECMTB+Mh RgkOZiUR3hcbe5OFeFMSK6tSi/Lji0pzUosPMZoCg3gis5Rocj4wseaVxBuaWBqYmJmZmVga mxkqifMundKRLCSQnliSmp2aWpBaBNPHxMEp1cDEl7kxxvZ2do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umPc3PUUj9Mwbhg2TfE8zHjix2Gtj Z63vvzeCT80/WU/w2tjUNWvy/X4fB3Mjp+g7ogUeC69sLN67d7vLnVoTJe5008WB79MVN9+w ffv1f2Qao+zBl6+W3Oh/+MJK0ujJ/kMKtw+c39tQ9/xeRqVzwYX38lNFQv4U3lrec7GmMfOR EktxRqKhFnNRcSIAOzXHKLgCAAA= X-CMS-MailID: 20221206123009epcas5p4d65eca3320f9845e190fc425a06799a6 X-Msg-Generator: CA CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221206123009epcas5p4d65eca3320f9845e190fc425a06799a6 References: <20221206121831.5528-1-joshi.k@samsung.com> Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org iopoll test is broken as it does not initialize the command/sqe properly before submission. Add the necessary initialization to set this right. Signed-off-by: Kanchan Joshi --- test/io_uring_passthrough.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/test/io_uring_passthrough.c b/test/io_uring_passthrough.c index 9c71586..b58feae 100644 --- a/test/io_uring_passthrough.c +++ b/test/io_uring_passthrough.c @@ -350,6 +350,8 @@ static int test_io_uring_submit_enters(const char *file) int fd, i, ret, ring_flags, open_flags; unsigned head; struct io_uring_cqe *cqe; + struct nvme_uring_cmd *cmd; + struct io_uring_sqe *sqe; ring_flags = IORING_SETUP_IOPOLL; ring_flags |= IORING_SETUP_SQE128; @@ -369,12 +371,28 @@ static int test_io_uring_submit_enters(const char *file) } for (i = 0; i < BUFFERS; i++) { - struct io_uring_sqe *sqe; off_t offset = BS * (rand() % BUFFERS); + __u64 slba; + __u32 nlb; sqe = io_uring_get_sqe(&ring); - io_uring_prep_writev(sqe, fd, &vecs[i], 1, offset); - sqe->user_data = 1; + io_uring_prep_readv(sqe, fd, &vecs[i], 1, offset); + sqe->user_data = i; + sqe->opcode = IORING_OP_URING_CMD; + sqe->cmd_op = NVME_URING_CMD_IO; + cmd = (struct nvme_uring_cmd *)sqe->cmd; + memset(cmd, 0, sizeof(struct nvme_uring_cmd)); + + slba = offset >> lba_shift; + nlb = (BS >> lba_shift) - 1; + + cmd->opcode = nvme_cmd_read; + cmd->cdw10 = slba & 0xffffffff; + cmd->cdw11 = slba >> 32; + cmd->cdw12 = nlb; + cmd->addr = (__u64)(uintptr_t)&vecs[i]; + cmd->data_len = 1; + cmd->nsid = nsid; } /* submit manually to avoid adding IORING_ENTER_GETEVENTS */ From patchwork Tue Dec 6 12:18:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kanchan Joshi X-Patchwork-Id: 13065723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF3E6C352A1 for ; Tue, 6 Dec 2022 12:30:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229457AbiLFMaV (ORCPT ); Tue, 6 Dec 2022 07:30:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232490AbiLFMaS (ORCPT ); Tue, 6 Dec 2022 07:30:18 -0500 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 316DB2934F for ; Tue, 6 Dec 2022 04:30:17 -0800 (PST) Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20221206123015epoutp01df22eb1f995cbcee06d1cfeb9a83549d~uNB4dj2v50685806858epoutp01A for ; Tue, 6 Dec 2022 12:30:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20221206123015epoutp01df22eb1f995cbcee06d1cfeb9a83549d~uNB4dj2v50685806858epoutp01A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1670329815; bh=2mwn0Fqg5PmBYIXzudnNDG+eIKTOhTt9uKD8uPipNso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MrFwRCddNSop7DKhGbFl8d17Y4qM/pXAX67iOyQKPenJs6WjLzIkSbGMH1odQFfW/ l76VgNtZ+1EsSTT3d8CC6hd88kRaP4l0fQ5NPBHt8hfzFMiQdbosEI7RgXNUf2nvPe wpGMoQDVJjTleOTN2FKX9gUzAisuiyn2st9cj4S0= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20221206123015epcas5p343f0b0efb06c6243e9848f9936698a97~uNB362XGP1347113471epcas5p3S; Tue, 6 Dec 2022 12:30:15 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.182]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4NRKWB0VnHz4x9Pp; Tue, 6 Dec 2022 12:30:14 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 4F.67.39477.4D53F836; Tue, 6 Dec 2022 21:30:12 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20221206123012epcas5p33de3600bbc6effa8e2a08f748cb0eee4~uNB1XkfnM1401814018epcas5p3G; Tue, 6 Dec 2022 12:30:12 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221206123012epsmtrp2cca541f76ded66a7caac13381cb55709~uNB1W87zz1795117951epsmtrp2X; Tue, 6 Dec 2022 12:30:12 +0000 (GMT) X-AuditID: b6c32a4a-259fb70000019a35-05-638f35d45493 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id F5.9E.18644.4D53F836; Tue, 6 Dec 2022 21:30:12 +0900 (KST) Received: from localhost.localdomain (unknown [107.110.206.5]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221206123011epsmtip20a86e2ef526cbd9b81e522cc5a89ac2b~uNB0rrXc03142431424epsmtip2Y; Tue, 6 Dec 2022 12:30:11 +0000 (GMT) From: Kanchan Joshi To: axboe@kernel.dk Cc: io-uring@vger.kernel.org, Kanchan Joshi Subject: [PATCH liburing 2/2] test/io_uring_passthrough: cleanup invalid submission test Date: Tue, 6 Dec 2022 17:48:31 +0530 Message-Id: <20221206121831.5528-3-joshi.k@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221206121831.5528-1-joshi.k@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPKsWRmVeSWpSXmKPExsWy7bCmpu4V0/5kg6vP9S1W3+1ns3jXeo7F 4uj/t2wOzB6Xz5Z69G1ZxejxeZNcAHNUtk1GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6h pYW5kkJeYm6qrZKLT4CuW2YO0B4lhbLEnFKgUEBicbGSvp1NUX5pSapCRn5xia1SakFKToFJ gV5xYm5xaV66Xl5qiZWhgYGRKVBhQnbGowebWQv62CrmrLzL1MA4gbWLkZNDQsBEor91HVMX IxeHkMBuRolJy06zQTifGCV+bngL5XxmlHh65wBzFyMHWMvCHzkQ8V2MEpf+9rKBjAIr+nmA A6SGTUBT4sLkUpCwiICwxP6OVhaQMLOAo8T6Y6ogYWGBKInLHfPAwiwCqhIP39eAhHkFzCX6 32xkgrhNXmLmpe/sICWcAhYSTR8tIUoEJU7OfMICYjMDlTRvnc0McoyEwDZ2iQNr5jJC9LpI bNq+HcoWlnh1fAs7hC0l8fndXjYIO1ni0sxzULtKJB7vOQhl20u0nupnhrhYU2L9Ln2IXXwS vb+fMEHCgFeio00IolpR4t6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SWFmVWpQfX1Sak1p8iFGag0VJnPdC18l4IYH0xJLU7NTUgtQimCwTB6dUA9Py b42VgeIBy+aWnZGVtHz2Qi9q+yyDZ4uU5PUtWrgVgpo2yXEk8Be/WlBzwdD/1ZPzCy8uNKny djjFfmFrzcGald//nDrDo2IatNKlU//FxJVFpk3/DqYvrm5lubXJUUrn56/fz9sPzl94pvvl l4e7M7vkKlQez/OZe+pxj5ne+l0KvPpMMz/rfa1zeMLrXPW7ZkLF+p1HmyUnPF5f/XF/95Hr /fqPZ7VsuLVuvz7TDKsX2osXbTyzVv1wREnDrbKUXaF//n5MY21XUd0se91hWdA+GTPNhbv+ HrqWd3fe7TcvK2VFXY5uNlgwcZKkoFlk/uYEy+vb9PxvTlx++lL6u+ZTaZ87mSQfMy/hMHB8 rMRSnJFoqMVcVJwIAKWmXB21AgAA X-CMS-MailID: 20221206123012epcas5p33de3600bbc6effa8e2a08f748cb0eee4 X-Msg-Generator: CA CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221206123012epcas5p33de3600bbc6effa8e2a08f748cb0eee4 References: <20221206121831.5528-1-joshi.k@samsung.com> Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Just do away with setting IOPOLL as this is not necessary for the test. Signed-off-by: Kanchan Joshi --- test/io_uring_passthrough.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/io_uring_passthrough.c b/test/io_uring_passthrough.c index b58feae..7efdba1 100644 --- a/test/io_uring_passthrough.c +++ b/test/io_uring_passthrough.c @@ -286,8 +286,7 @@ static int test_invalid_passthru_submit(const char *file) struct io_uring_sqe *sqe; struct nvme_uring_cmd *cmd; - ring_flags = IORING_SETUP_IOPOLL | IORING_SETUP_SQE128; - ring_flags |= IORING_SETUP_CQE32; + ring_flags = IORING_SETUP_CQE32 | IORING_SETUP_SQE128; ret = t_create_ring(1, &ring, ring_flags); if (ret != T_SETUP_OK) {