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 2E69AA0032; Thu, 14 Jul 2022 15:48:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87C5242BB2; Thu, 14 Jul 2022 15:48:29 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2050.outbound.protection.outlook.com [40.107.94.50]) by mails.dpdk.org (Postfix) with ESMTP id E8D2242B6D for ; Thu, 14 Jul 2022 15:48:25 +0200 (CEST) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=RovToPg17wTW7cm7ftaorqt25Sk/8SRQf30bmSrzSFXZL5LQKUSxUBT8ilnA3C+TLFrZxTHhkiD4aRNF3GU4ZjyQI+MZt/YLFVLNX+eih+keCME4h4iBAZUu38Ai98LPYCY+/8HUJXgS0ow5BXROFqU8cKgsMv34cS7zaQdr5ZuBRG/wXyvfRfU3Avod6g3D3oXoGvWy8XI4tIJcbjcvmL25vj+0w+MByANCGuLeGYrIS9FA5WOq9oOTD+Of7mcMai9KixTugxlmT/HciP8k+eQSrjAdkLKv+q71sm2wTZApvhMQHDRvv9hGyZ/fo98und+YRDzd37RyLyTTHuPK6A== 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=m0novxHFNmL1C6Dkb7W65HUTio3Syfn2snulUMxO4B0=; b=kml7+kWhWtEQqUJ9SreKCScAfQhIWPVvW+ZZfBdpDB+803runRfoWlity0Bvydt41MZ95uEpd3rIc8RbE8M/EAMqahZePtGqpAoc6gQptK2ZNPmnghydDMIPaXo3iCFa5Y1FB5eQlzc8Qo24N1G6yyn/6EnHwStZPXqd92gtfeqsMdvBnwKIzwef8OzgPT0LU8nbAitlmMRKPY+iE6XhlTnG+QCSmWUJRaYwhUo4Z1nrRFitxtRAINTg3P/MeuYevjLRRz82BKNiG0FuBCTfk45KB0V3whmyUzaavxUp5DA/AhfGKEDMGq2ODjV95DdChVVINT4svxBpjGpGK/Z5Ow== 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=m0novxHFNmL1C6Dkb7W65HUTio3Syfn2snulUMxO4B0=; b=sa17z4HU1r5QjCjO6lHBUjutcY/atXYjYHrvOVwxd5Lgv2yJjlyt43YVa61Y+pGkO8y85FYheZZNgmb8xMS3L4AgewruJHusVCHbjt4euvcf/FvlQp+mSv0nZ4tQqZFsUz6ehgKKawpiW6ZGqgJ42Y5b2LEc/Rx6NNYvFOYiOG5f4oMrIz+XOcFTu+q8Wv7RxecFhT1gCdHH8200f9MoI+KaubElfi2Cju7RJry3725zX31X3hxsglx1UG85rKVEnVnv5yEq+r3j0rF6FifVgBIQASVL6xmEvzQYOT3UVmFfp1SlourhKIchjCiU7/2pBZZk6c1yTF/7/7ZSJtiEog== Received: from BN9PR03CA0156.namprd03.prod.outlook.com (2603:10b6:408:f4::11) by BN6PR1201MB0228.namprd12.prod.outlook.com (2603:10b6:405:57::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Thu, 14 Jul 2022 13:48:23 +0000 Received: from BN8NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f4:cafe::ec) by BN9PR03CA0156.outlook.office365.com (2603:10b6:408:f4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Thu, 14 Jul 2022 13:48:23 +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=mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net; pr=C Received: from mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net (20.83.241.18) by BN8NAM11FT007.mail.protection.outlook.com (10.13.177.109) 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 13:48:22 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net (Postfix) with ESMTPS id 0E2A141F85; Thu, 14 Jul 2022 13:48:22 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FupqUC2czbEh+lOzrRDwyRfLb/9ICzLGPkqWZ+2xuIvKfHx76KAhzQhN2wXHTIIBkx7TKxjg7xSANTaTO/pvyYguXicUQgJsoUy5UeXOvCh3BhmiU2hnY3wMf48r6t3rPSxaFgs/trWr9mgnrrxD6CLuhGkA5Xybm66v0gRFYZMhV+mLKEiKqR+lf7HVOCDcWNuRWSTVmvnIEg+Ospr237mcJONONblJwYRBLtanMOHDWPBU5RLpfaOWvUthZyAdKjzLG4uDUbp4mNJWq5QTX1nhOZWr4mOCOliW0CJVXI+ChDmirkSzJbdKndYaB1OGpqCmLd6jtELHvU+MyNOUHA== 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=m0novxHFNmL1C6Dkb7W65HUTio3Syfn2snulUMxO4B0=; b=FwYYnZByX2kXPmrLmcHpCGPA85fvhSK4S8wdL+AZoQdz4maNq7Gobj0MbSXXWRdbnzfxZfqPmPnQSzNORp2GNZYYkstXs68qCkfAJ4MyUUYtwpiAd6Ih46qzC2kMI4uadSGx22AbIMF/UkyY/fwGPVIBPLGoTI9sm/oNWX53Z2s/whgJ6u6qEoF8htUv+HynZ+Y0lvm/fCeGgGLnzlaUw9jHo8eEwRGCwtqHke4nCqURDZxZ6d831uAjbArOZIZdAGc1Aj48wCWCj3CY3R/yFkNFJ1U3gIhCeFBu6ImRZozlqJNYBi20teSzNRlHeE4/qZJamWBrKbaWA4llDHHjuw== 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 BN9PR03CA0134.namprd03.prod.outlook.com (2603:10b6:408:fe::19) by CH2PR02MB6197.namprd02.prod.outlook.com (2603:10b6:610:4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Thu, 14 Jul 2022 13:48:19 +0000 Received: from BN1NAM02FT006.eop-nam02.prod.protection.outlook.com (2603:10b6:408:fe:cafe::b9) by BN9PR03CA0134.outlook.office365.com (2603:10b6:408:fe::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17 via Frontend Transport; Thu, 14 Jul 2022 13:48:19 +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 BN1NAM02FT006.mail.protection.outlook.com (10.13.2.125) 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 13:48:19 +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 06:48:10 -0700 Received: from smtp.xilinx.com (172.19.127.96) 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 06:48:10 -0700 Envelope-to: dev@dpdk.org, chenbo.xia@intel.com, maxime.coquelin@redhat.com, andrew.rybchenko@oktetlabs.ru, absaini@amd.com Received: from [10.170.66.118] (port=50892 helo=xndengvm004118.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oBzCM-0003Fq-6C; Thu, 14 Jul 2022 06:48:10 -0700 From: To: CC: , , , Abhimanyu Saini Subject: [PATCH v3 1/5] common/sfc_efx/base: remove VQ index check during VQ start Date: Thu, 14 Jul 2022 19:18:00 +0530 Message-ID: <20220714134804.60495-2-asaini@xilinx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220714134804.60495-1-asaini@xilinx.com> References: <20220714084451.38375-1-asaini@xilinx.com> <20220714134804.60495-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: dad3d0b2-d22a-4b5a-8d48-08da659f84f6 X-MS-TrafficTypeDiagnostic: CH2PR02MB6197:EE_|BN8NAM11FT007:EE_|BN6PR1201MB0228:EE_ X-MS-Exchange-SenderADCheck: 0 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: vhWwvGyOBW3TGSsxGswcEKXDz3Q+ar1TXG/9n2HhqMJoERZPnz19XQktcAUdrc9a2Po0jCpbqCGcTQKN/dxS1U4nHD0HlEuxV63qYKN2STUXfd5l6ZqV+DF8VsTJ1qiww/nhko0uIl9GpcTwvfcqPHq9gRMS+4re0GrbtyZ37tyj4sZEL79PUAhKZfpquIRpkWBNim0xb9rjBV28dFFjUCwNAQU+lX/XJI8lBA3KI7AOywGnMVMOAUB3d/8i8fpX6mZCSKfjDooeVcIr3kABTddfyhJU0IhBFMgIW1K2T9GWB4muTb6qtr/07CoTwhD5/jTASxtOf6nWX39KeYFkVA1b2Rv0V5SKBILlIPADEOn6u57pA2j4ZNjqKHbFnI183cXU9EdgCUuv6YeTls9g3HwJmRqRgax+aaYteugquBmw3iDAGzHO4sOMWoyz8MThd4ur/nMohho6RcDGfPFIRXOR1pu3XzU6PeWveplWjr3cBoEV2Hu9ORbqU2dSDjEuLS+kDyrxnurxqfXVmJg7GauqnvPucS7nwVVpG4Qvg82RYQjWy1TQcuhk6Q/mPqCQdrDJgpvplykY/wI2Of6iPwOh63maf3K6TwX1aUyiHSJB2yRkl34SouvxYzf+0UqSf+O9CKBUt4DsTfH22GDNYIOtnuQcG2RvWye2+hKwCfpOz+k3mpRZQ29a2/EMPKOPG0TnnrpzIXeCLrMgXF5gHjHIgVDM3lZ2XlPw8/xhTMTEOpbJ6wdAW5b+d4fP327U/CsxnLc/yQW92MblbDrb1e3yIS3tRIxHdT8ZX86tFwKsBC4JDFTMcTn6wbbHturUgVarPNEac5J/1SobkTYI4C7zJghrVHKy4v5ueF0Bs2s= 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)(346002)(376002)(136003)(396003)(39860400002)(40470700004)(36840700001)(46966006)(336012)(47076005)(2876002)(7636003)(2906002)(426003)(36756003)(82310400005)(356005)(83380400001)(40460700003)(36860700001)(40480700001)(186003)(70206006)(70586007)(41300700001)(8936002)(1076003)(26005)(478600001)(6666004)(82740400003)(9786002)(2616005)(6916009)(7696005)(5660300002)(8676002)(316002)(54906003)(4326008)(102446001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6197 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BN8NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5ff5f031-25c2-44b7-3c2e-08da659f82cd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7wLEONcd6QYpgR2f3AcbUy6z6Sb6ez/7fCQTuOOPuZeEcYq/wHLhaTMWzCxAGe7vX+ezNgbr3q4RgS8o+qC8Nkohai+93Lno6rKyttXPnxfJ2QbzTB7y+Ov68sJmA+A0yPPKfVcC6FUOHNHZJAJ05mDA+SKe/0uLmZRiBIR8iuZI9HLgeoB1qe9k7duDsh4KsCCoyGTTVo56RY6l3Dop9djkLvZS4S1ySCjUSXELUKlTiT4tLf57ogvqfBkBEdKvKpPyavOcu3P2zkckm7fkH49hgfAwDM3jqBU4aEXDEj7ueiMj3KTcTny65tqhMzevsXB+Xkq7d5yxrqKoME955ZJAM+3pUbSlTyo9Ug2QDV3ICVj9+pXRkdDHmqFQ1zruvMrqJhHn4GFsJF2Wb8GNPOuxB5vBVPhzlcKhZPLxh3Ip9Z4ye1HDjeXe4aNP8GCYsB5VtKgv5ijwrl4OWSxmlq+d9+sQ+cbDCyKjGvjUFjgvE6x7+23pg6VBPt4Zgsils4z1eXlR+llHu+o1IOw8mqtrMCAoe0px/mVCywZ6CJsLLCRnySHfKoh0Haek4DujtdKC/haperYoeMS1/QJXnnDE26KuEtJGmW9GGSagGQi2n5o2642j3kXKisoitY5E8eqRE8ppfMBMj82jAA1PQjwEoDzkFM0skes349UbABJLsnW/YTCk0f8TEMreX4rA8Jyb0W+XiBT5a73JI5u9MjyL8geZEZ/0UdqJsU0y29BOs6mQN9tVgyvYfC8Zu1KZYmKZGmsWsXJpFDpjYaX4StTZdAmzurDw/1aNctw3Cc0afFWJBIgeZ+0BkRgGguAA6+wnBZUUozJRxIG+DFp1AIDiKn97Lx4BCZeTRT0/P7c= X-Forefront-Antispam-Report: CIP:20.83.241.18; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(396003)(39860400002)(346002)(36840700001)(46966006)(336012)(426003)(2906002)(83380400001)(47076005)(42882007)(82310400005)(7696005)(36756003)(40480700001)(41300700001)(70206006)(316002)(4326008)(478600001)(5660300002)(36860700001)(186003)(81166007)(54906003)(6916009)(9786002)(82740400003)(83170400001)(2616005)(2876002)(8676002)(6666004)(8936002)(26005)(1076003)(102446001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 13:48:22.8333 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dad3d0b2-d22a-4b5a-8d48-08da659f84f6 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=[mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-BN8NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0228 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") Signed-off-by: Abhimanyu Saini --- v2: * Fix checkpatch warnings * Add a cover letter v3: * Restructure patchset 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 335cb74..7f08717 100644 --- a/drivers/common/sfc_efx/base/rhead_virtio.c +++ b/drivers/common/sfc_efx/base/rhead_virtio.c @@ -47,14 +47,6 @@ 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 @@ 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: -- 1.8.3.1