From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E7559A00C5; Thu, 14 Jul 2022 10:45:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F4944282B; Thu, 14 Jul 2022 10:45:09 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2045.outbound.protection.outlook.com [40.107.212.45]) by mails.dpdk.org (Postfix) with ESMTP id 1DEE041156; Thu, 14 Jul 2022 10:45:08 +0200 (CEST) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=C31nT3msQkMiVgq55R9fe/4Yb1/w2AG6mc/USLqXX1WfniYCP0txq4d6BX+Yn+9Q9z/0F49ZTx1IJ5CGD7VFaisK/6VoIn5cNIQR+ctiuVtDpAfebroYCQ636ZVWZnomEnnzoY69NI/njYPmWyDE++m5uk4Leq5ncRFICCZuh3niiEPvRBif/bfZp0Ugk62BmfAt9xGXPRCeAS4ajS+F2K2NhVQ29p3KeBuzcH1D0kmpK2d7QuFQiVehgP5n2V6lU6hx7j5jpj8Q71EXLi8IexOKfZBH1z6DrakOa+dXRkp5dfoSA8gt+ctj+aZP5L0C8SAdkCMA88lyqzUeFDjItQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=D4xhRdy8kYe2YUWlJn5HXNLLzoJtRznOY8areoNJNfc=; b=keIdAOvM3qpgZDU9qA6jW7DkGqtzoAOQQ3dxx1PMMpc5U/gdVREwqQUK5XfumXIk406Sf6TPFB6VzPvZun9xYeK528SMIKDufIqY3054Y+EL4LiaDvBL8qhO0DsPZ4uFpT1FrcCBSCmEiCJukwzi8uwYSvuLBKxmrePVVWGrzFqLwzsKA7dX0k+XH5O+ZsRR+1llTWfRmslCYP/1723szBFVawuUmDT0DXGjfcDTFi1/2KSrS176ZrrtNnjATAkpdHCnGA2f6dGPh3PLtLJz1CPwG5SlutEIoH6vFh2bRkElkTWEPmhUmtflGafTVWmWCX1jDRHu+auFexQ25Zp/vg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 20.83.241.18) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=xilinx.com] dmarc=[1,1,header.from=xilinx.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D4xhRdy8kYe2YUWlJn5HXNLLzoJtRznOY8areoNJNfc=; b=XdrH4SgvMI5vVO21ivXMj+UWFRZjtUZB8TZfe05NEE84YLra4YPkc0fd1GdBdnlMGs2txflukQkCo92PAKUyeHFAPt0iwmw8MZOtKW5gL7dkX8OyugUNvSTFd1SGigeodCdO3lIJ3hakN2BUBGQMO6K239SfqiOS2JJHRXVfQyWvspS8svYUhFRvFX7KwVYaFeHSbw0SzOCXATEBu0GBS30oaTzPDiiSabenojFcUlqWGuSGa4vF8geb4OZy3I5hZd4V8ffbuUfEXWPoRYJsyJQVpV9Zr64GF1DETkp7YcYtOibGXySu4kMg1Nlcb0/9946z/+NRK5dOXsr1fl8/UQ== Received: from MW4P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::34) by DM6PR12MB3404.namprd12.prod.outlook.com (2603:10b6:5:3a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.25; Thu, 14 Jul 2022 08:45:06 +0000 Received: from CO1NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:303:115:cafe::f1) by MW4P220CA0029.outlook.office365.com (2603:10b6:303:115::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12 via Frontend Transport; Thu, 14 Jul 2022 08:45:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 20.83.241.18) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 20.83.241.18 as permitted sender) receiver=protection.outlook.com; client-ip=20.83.241.18; helo=mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net; pr=C Received: from mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net (20.83.241.18) by CO1NAM11FT050.mail.protection.outlook.com (10.13.174.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12 via Frontend Transport; Thu, 14 Jul 2022 08:45:05 +0000 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2044.outbound.protection.outlook.com [104.47.56.44]) by mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net (Postfix) with ESMTPS id 259343F250; Thu, 14 Jul 2022 08:45:05 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bHES1Wlo6joOlD0AwnrTcnAmU6sdXhKjOK9LKcSgs2eJUdG6rdQ3Ixw11klvRJyoWQMAVxjPVjkj1hURxXYFObC9OSNH2+WaGe/SS5yuFiOO5RCJcXxe1Tr/Gum/hBJSo+X/cSPxcdXoc6T5mMPIWIaW71eIbxKO58e2Pya/C8xRW9DjISAifRV9eeF6M/NxNRZQEUYHgizv/wKA7zW4/D2JftY336M89n36LORO1sT8H9GtPv6tQgB+GgXI1j67Z+4C3DFfsofiJFkdOzfz9+/6VMJS0aBvq95lFgGIR34ft7YfZxEs9fg1dNH0kLN8+0XkRjK3PQAAUSk0q/gpfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=D4xhRdy8kYe2YUWlJn5HXNLLzoJtRznOY8areoNJNfc=; b=dtkrzc03MIHT7zcQ0cfZogMQ3OZ7d9vY1oUkWY+EQ1nSwq6QWu+wuU+A7wivE19vuklppWx5SoWPQqgNyJeMGFbXxt5ibDU/W6h5GhwiUwG329SfpQXreuADuezrDKzj2iYry5ul7xPLSvNt88lIOvw8pt9hx8BOOhwwwbcUIskcxmBlv5V7iLqsG3XcYMAEoytdnnWApX1qqXWByZJ7UYg2Ud5iQ2YJ7FLf15E81CoJzYU9YuU/TjR6rcqGRzaDzD/lHcGOABmCnIS30J/+knB5VYA6ewHRUTa1jW5t6qNhyvXQ85ZKWz6bJPEIURt31ccQeOwi9rLdicZMYN5FRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=dpdk.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none Received: from DS7PR05CA0062.namprd05.prod.outlook.com (2603:10b6:8:57::8) by BYAPR02MB5173.namprd02.prod.outlook.com (2603:10b6:a03:6d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.25; Thu, 14 Jul 2022 08:45:02 +0000 Received: from DM3NAM02FT015.eop-nam02.prod.protection.outlook.com (2603:10b6:8:57:cafe::42) by DS7PR05CA0062.outlook.office365.com (2603:10b6:8:57::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.8 via Frontend Transport; Thu, 14 Jul 2022 08:45:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT015.mail.protection.outlook.com (10.13.5.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Thu, 14 Jul 2022 08:45:01 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 14 Jul 2022 01:45:00 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 14 Jul 2022 01:45:00 -0700 Envelope-to: dev@dpdk.org, chenbo.xia@intel.com, maxime.coquelin@redhat.com, andrew.rybchenko@oktetlabs.ru, absaini@amd.com, stable@dpdk.org Received: from [10.170.66.118] (port=50766 helo=xndengvm004118.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oBuSx-0005xh-TD; Thu, 14 Jul 2022 01:45:00 -0700 From: To: CC: , , , Abhimanyu Saini , Subject: [PATCH v2 1/5] common/sfc_efx/base: remove VQ index check during VQ start Date: Thu, 14 Jul 2022 14:14:47 +0530 Message-ID: <20220714084451.38375-2-asaini@xilinx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220714084451.38375-1-asaini@xilinx.com> References: <20220714084451.38375-1-asaini@xilinx.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: defbe601-ac65-48ab-3582-08da65752641 X-MS-TrafficTypeDiagnostic: BYAPR02MB5173:EE_|CO1NAM11FT050:EE_|DM6PR12MB3404:EE_ X-MS-Exchange-SenderADCheck: 0 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: vAQRAVhHj0VGb8rj/rTcAO+Hcs7zgEs8ywsDpYTVrXUcfSiDcU/ABz2/CKhFAy6RfiuQTZaFNxJSmTn90DaLM8SCjLhvPO87eTQF0W0taDX3GlrBUpwc3rBX6jzkVAvJNBhmvnZ60muHFDzK+JAQ9tqg8e5eA0PxkxRPks8Q3ME1LVEjja53chf5HAIaErPpG8kccYrIOv/C7RxH4siHos5eZX8DIm1s4DlLPcDAh0BwS2Bq0qEdVulwhbCgWsbGwFDU82DkAPBvIQJmw3VhzQ+TvWbqCA1BABtYImPC8Ig845KVazAKnQnYhuQJL/y1L+jT+21c8Yge/ea1gmrVJmjvyhKfcdNoq3P8O+NiyAUW8CeqWVSeDcqswpWH7yliY1wf917xTKfsrOOY4o0kooSz8zPjxewzwiI5XfwfOBXFNw//05BcOk5Um6fX75GdHTC2DNWWUxxkCZiFUI/+CgvmkJ6Qz04gwqObMaKvJmt1748/uLZvMqd4XCszy8Jf8KHdwhxWCFHY7gEr4ZMC5LnkdlQ54v2dCkb3rseDyLbtufSnsXyGH+cX50XPhu66/fJEW/cd5VDdl4Utiw5F9ato/yEUOthZw+IRg+cJJxzm5etIadjfKkH9zoWVXM2uCS4M2Qv4YO5Sf/QxsIfy7WvfbAF4yUZtFoD+ez0wnhncuA7lTqApQWoYehH7hKkLhCop44KXQLXcCwIqgeVk+W1OjaMbhPLb1lytlifdpGWFbxw6yEswuXkWHaARYjJevZ1MXy8nLcsObc3YbiaP5pH4UlzYe/ucevhNZPGNsaXllUimjVIK0CDUp0P+Ovs7LYzK26ZQLuSEWdm9wIc8L7o9HpSz4t/EyCrJG//8p1I= X-Forefront-Antispam-Report-Untrusted: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(376002)(346002)(136003)(396003)(39860400002)(46966006)(36840700001)(40470700004)(4326008)(8676002)(6666004)(356005)(7636003)(82740400003)(7696005)(40480700001)(9786002)(36860700001)(36756003)(40460700003)(8936002)(82310400005)(5660300002)(54906003)(83380400001)(1076003)(426003)(2616005)(186003)(316002)(2876002)(41300700001)(47076005)(26005)(336012)(6916009)(478600001)(70586007)(70206006)(2906002)(102446001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB5173 X-MS-Exchange-Transport-CrossTenantHeadersStripped: CO1NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 1eda843d-0dde-487c-d69d-08da6575241c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zwl8J4Igwl49bD088W9C/LPbQ5ZlQkPUPEBmEIinUe7yzSki48qN++Tkx5WbjBdZPKpAhdPs8JjLY/Lm6C4DDIj9TP7e764UGnD6fDhoVNveW7lGvUbjQ5F2VN+nfWiEpQoZ4mDb4VVahc3Y/lHS4E3I+3uPDswoDgUb/5v9z/WSqUGifuIFDaIdV+t0gk3BcHFps3ahghMKWmgnZMLsbGDiIX1i01QPjmiH7OGvBilr09veHq5kIvEy9Dsv3V9HtxrQ3pqnZ6pEK05TdY7utXyXlH9yQriswDpdpX0/m8HZ7tivdOgeWMblvswP012w2ReE3ETJvcl7axtUhrncvl9fQqwKri4KUnVcO4Z6rSFjsj7Ezcb7ayS6oy4fIf9qsrWNffwNGBrcRAlV6JBIllcE7DhUSlb9a7ud8RVXbJUHSD0Qvj+1f7WnOto4bRPBY/sqWtuR7ZQlyJumOVXPhdDhfz3qUXufUcVeL1/mv1j5eEKjufnS3SMap7YXWgxBLDoGIthCEeWX0Ty2Zc5SCFaPeLZuNNAziGDPK9oq3v+97Xfxd140iF5d2Rv9MLp0gyG2cQIGHZqbLZQVe6qhl+rK23JPRfFSop93naUx23StP45XIGrnRan3J4o8uYght55hra21+h6is+ANbpg76ACclMtWuofsH1GOB9JOeCCfMBScySnhSryLo/eHkpaSlqOSjSVKGXVlOtNP53psOvwzsY6pD+naIywIlfWLo8IS78thOGDv9Rdpe0FpSi/OeNj10oPOTPW9f5JM/htbVKgvlGh+unR3EQxWDFTrn/Gnfbb3S56KQt+WqTG0EZM8rIkIKklQdSU+AeuH6tBD+BbRufGZZ4XsxjCK9MNJWFQ= X-Forefront-Antispam-Report: CIP:20.83.241.18; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(346002)(396003)(39860400002)(136003)(376002)(36840700001)(46966006)(9786002)(5660300002)(478600001)(8936002)(41300700001)(8676002)(7696005)(2876002)(6666004)(26005)(36860700001)(2906002)(70206006)(82740400003)(81166007)(54906003)(82310400005)(36756003)(426003)(336012)(47076005)(2616005)(4326008)(186003)(1076003)(83170400001)(40480700001)(6916009)(83380400001)(42882007)(316002)(102446001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 08:45:05.3264 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: defbe601-ac65-48ab-3582-08da65752641 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[20.83.241.18]; Helo=[mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-CO1NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3404 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Abhimanyu Saini The used/avail queue indexes are not bound by queue size, because HW calculates descriptor entry index by performing a simple modulo between queue index and queue_size. So, do not check initial used and avail queue indexes against queue size because it is possible for these indexes to be greater than queue size in the following cases: 1) The queue is created to be migrated into, or 2) The client issues a qstop/qstart after running datapath Fixes: 4dda72dbdeab3 ("common/sfc_efx/base: add base virtio support for vDPA") Cc: stable@dpdk.org Signed-off-by: Abhimanyu Saini --- v2: * Fix checkpatch warnings * Add a cover letter drivers/common/sfc_efx/base/rhead_virtio.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/common/sfc_efx/base/rhead_virtio.c b/drivers/common/sfc_efx/base/rhead_virtio.c index 335cb747d1..7f087170fe 100644 --- a/drivers/common/sfc_efx/base/rhead_virtio.c +++ b/drivers/common/sfc_efx/base/rhead_virtio.c @@ -47,14 +47,6 @@ rhead_virtio_qstart( goto fail2; } - if (evvdp != NULL) { - if ((evvdp->evvd_vq_cidx > evvcp->evvc_vq_size) || - (evvdp->evvd_vq_pidx > evvcp->evvc_vq_size)) { - rc = EINVAL; - goto fail3; - } - } - req.emr_cmd = MC_CMD_VIRTIO_INIT_QUEUE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_VIRTIO_INIT_QUEUE_REQ_LEN; @@ -116,15 +108,13 @@ rhead_virtio_qstart( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail4; + goto fail3; } evvp->evv_vi_index = vi_index; return (0); -fail4: - EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: -- 2.18.2