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 0B1AEA0545 for ; Tue, 28 Jun 2022 07:29:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0145E410EC; Tue, 28 Jun 2022 07:29:53 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2043.outbound.protection.outlook.com [40.107.223.43]) by mails.dpdk.org (Postfix) with ESMTP id 47DD2400D6; Tue, 28 Jun 2022 07:29:50 +0200 (CEST) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=fYwf9IMcV8X72S14gLTW/RGDR1BcT5CcQDmSXvqZoobVvi/ZMbUNASVRp9tr697nP8RF43JVUPjlJARclvknQ7Y3oXYL5MpB4bR/sMIO1QPRf2WmxKgelGobQsL/XWmkx/Fy5HisbiYNMdf6yp1Ot3Q1e6fMZGdCcJGOflQKwk3HJdS9jVHdHKoGb4OaXr1L9YAXpwesax7kICPUjpT46pCz7L199smrbrdUQ31t2Qik7L0Q+lCRH5yQwv+7ddDjvWzAbvTi78wOQXmvmD02qNIXruPM07hfhJV4uyltZnMpLJVRh87+jawPEac7TBiOC355zsOnz4gEQFofc4hYGw== 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=Kav1wJP3mqEFP6oVFq7yimnhWb1tG/pTgduSBnHxtCs=; b=EMT3d3gL7UYZP8Q8869QGydzZX2+QKmyP6TmGk5hVvc1ONkLLcs9ahkFwcdY15kqvIJQUfdsNKb7Gm2/2HElIeA4fDfjDjwTQWHYXdz3v62vTot1p8/DN55bEvrHayn6RHZnRCcT7OoWbeaG6yIuRiBUXYwm8rfichPmNowJxqtx2F9bL4gtWXgCY6BzvFFRFpcciHGOghYYWFLaPDw1LRY9nmY+wSaA3r70husOBGq06s2ZUEENoDMqNq2elH0wDlez8apujogOwB697SKJbwr0p5A5AxcKyADvuGnEyDYVDFpxrP6evh15aCF5uRZDYCYGVD930BP8XbtBdD80yg== 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=Kav1wJP3mqEFP6oVFq7yimnhWb1tG/pTgduSBnHxtCs=; b=vQxXsGTWMrEwS3PUvpdkcTnscu7E6Q5g/kgrYH2HmT49vlDg8c4M2PXChunw1HgYedmKquM2yoqDXy8b0PKS6joBizf3TVKjkiAiVxE1KGA43WsCvOsq2DABozEfgRfZgj38oa3g7pP4FUA2kiFTcDJHnZ/LDzEz6R5lwtko+A6gVWyJP7wK9Lh64IPf/sHFtatzoBGyOekFnwg4wxWkeUCI7guexvHiwowpnRPjmchAfU1n2FYOzdBkhz24mkr1k4e0w1bZx/J6SR2kyz2MllvTJ1HabRoHwSUyEV7QBCP8vf2VAc3gV3tR1MgG9FWNRjYd111DbXC5XqBVoJpQ7w== Received: from DM6PR21CA0029.namprd21.prod.outlook.com (2603:10b6:5:174::39) by CO6PR12MB5492.namprd12.prod.outlook.com (2603:10b6:5:35d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.16; Tue, 28 Jun 2022 05:29:47 +0000 Received: from DM6NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:5:174:cafe::aa) by DM6PR21CA0029.outlook.office365.com (2603:10b6:5:174::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.7 via Frontend Transport; Tue, 28 Jun 2022 05:29:47 +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 DM6NAM11FT059.mail.protection.outlook.com (10.13.172.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15 via Frontend Transport; Tue, 28 Jun 2022 05:29:47 +0000 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2043.outbound.protection.outlook.com [104.47.51.43]) by mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net (Postfix) with ESMTPS id E8CA242D22; Tue, 28 Jun 2022 05:29:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oVCk9UqPg1VtTju0zfCwIhtZE9MpZfKHra3pPi/jKWU+nachl1j9oPN1VeVVRvFyhVg5dc3hPhfUXevFOWeVvJdPjED1CWSDflr7VU2txmTYgKf+uwLHYIZm8zd497agZ4B9rPTnSANXAtjGSlpMXbkPkw7tqioApR5gKIrlDeq9dZVOZduVi1HYnhIoraHlt6+UFfdEMWfGngGgmTGjn1bjOHMRCvwd3vCudsIHUj5UyzcP1Wtsk89FBpkntnIbv9C+ID2/Ehvc2kabY1DPt+V4MzOyaNNHsijORiwX5LyuzpNxofpbfeod/RPZKD8igXxuuUrTuHhJKFCHhwkaaQ== 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=Kav1wJP3mqEFP6oVFq7yimnhWb1tG/pTgduSBnHxtCs=; b=F3939TL9UMCcFciCzHNWe1G2+Sbhxf+xSRdzu9yvLRHZBJvZq4CK+tv48gtnhbfnCsRrFgKM1SC60GwuXq55AZWwv+nvQMrr4cZcdc2/8r9xrmSkK2zJbzbuAEgp6OMc5XCEug2jjVU0sr/Iv68BD38hRGijz8g8A8WvrTV4cqWIh66i5c4lT2eeG6LSh9FgP9PXxXA4go+8ZAC+bXCWH41GXmVDqQn5U4DeSYIj7Xa7MkeI3p8X3S2U7bBIYhP6Y5rhVTK6Bfd2GiSyI8MKryNWZzq3t9b8LJvJtUDeivSKbYO1IPPrL03pi7kw2nDYWezKMV1X5Hnc45ej7nFGOg== 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 DS7PR03CA0342.namprd03.prod.outlook.com (2603:10b6:8:55::14) by DM6PR02MB4092.namprd02.prod.outlook.com (2603:10b6:5:99::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Tue, 28 Jun 2022 05:29:43 +0000 Received: from DM3NAM02FT063.eop-nam02.prod.protection.outlook.com (2603:10b6:8:55:cafe::fb) by DS7PR03CA0342.outlook.office365.com (2603:10b6:8:55::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15 via Frontend Transport; Tue, 28 Jun 2022 05:29:43 +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 DM3NAM02FT063.mail.protection.outlook.com (10.13.5.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5373.15 via Frontend Transport; Tue, 28 Jun 2022 05:29:43 +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; Mon, 27 Jun 2022 22:29:42 -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; Mon, 27 Jun 2022 22:29:42 -0700 Envelope-to: dev@dpdk.org, chenbo.xia@intel.com, maxime.coquelin@redhat.com, andrew.rybchenko@oktetlabs.ru, stable@dpdk.org, absaini@amd.com Received: from [10.170.66.118] (port=42390 helo=xndengvm004118.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1o63nC-0001vn-2n; Mon, 27 Jun 2022 22:29:42 -0700 From: To: CC: , , , , Abhimanyu Saini , Vijay Kumar Srivastava Subject: [PATCH v2] vdpa/sfc: handle sync issue between qemu and vhost-user Date: Tue, 28 Jun 2022 10:59:26 +0530 Message-ID: <20220628052926.21319-1-asaini@xilinx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220627084917.2295-1-asaini@xilinx.com> References: <20220627084917.2295-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: b31ae547-030d-4585-e21d-08da58c7373f X-MS-TrafficTypeDiagnostic: DM6PR02MB4092:EE_|DM6NAM11FT059:EE_|CO6PR12MB5492:EE_ X-MS-Exchange-SenderADCheck: 0 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 9al8z7s/+IX46dw0mI5xQxCOFPxho43QjjvGVMDugZf77glwGqt+gQXTohTdbtuBTPjRsh7THs1AscyOiv1kQqfuYNjIhtnYQTmqzQpp7cz33SM0cpUMZ9t7qQvUpXOemLicPRUf/MV0puzFrxKujjgIheUcgnfcK4BFq7KQMWGl6K+PiAgr0svn6SUGEGauUuCl9+gAYs/MBk0ISN7QgXEm1qUqFu0A4UpY0ycl3xfZLmo0DxqlGkA2xJPtE0FTvo6QZrvqRePFK7CvT7dT6k0gibAjcGbIcdwAF5pUSQRHd1FMHqg9xw3mHix1ON2eLwc5MIrG6L2jhY6zbvCZkVwq0iOSAkEQKqN8jU/odIf4nJCMmtBpHBBNoolbp6SrY5hWlArQKwiq79gX5/jFWkP/leYioBM6n2d4d4KMrRAPM1DoZX+vyRLWXgTekHZ5QhC/0wn4WUIGJjz2fcdbkB53PliWLV1H9dYRxTnTb7eiOMLckXtmAqExtdW3oRb565nvsn8rFzwsWJiNo677Ino8sXnRFzsEbPu0Kol+JyQseGTgiQfwMZG+JzOdSQrI4HEo0IhDpoKfqZ81ydyRiKHh8I8WJYnfBkYqffddpGlTuz6cl1nSaVbT7I1MrMPb1Vxd/kb/7pWNC4IYPVgzJkioYLHuqshwpQAqpsturB0UISKAaFNaB7nZrOkLTwGi0JnGfyhLDlMzZ2hS5MPIOxiowctrTzu926ObJ69nO7Ku78e6FzwPUHnFS7eYngWijmnlfIEfyApjvGvDeDUwijpRDIkhIsPCX3eKtZ29Tk0iBfohZEGOWATZFxA1PZlBCUZyYBtce+TfhWwZhPNl0w== 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)(39860400002)(396003)(346002)(136003)(376002)(40470700004)(46966006)(36840700001)(47076005)(426003)(8936002)(5660300002)(336012)(9786002)(40460700003)(356005)(83380400001)(107886003)(4326008)(6666004)(8676002)(70586007)(26005)(70206006)(41300700001)(2906002)(186003)(6916009)(1076003)(2616005)(7696005)(54906003)(40480700001)(36756003)(2876002)(7636003)(82310400005)(316002)(36860700001)(478600001)(82740400003)(102446001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4092 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DM6NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c059f5f9-2d12-4aa5-4fc4-08da58c734bf X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eKkM9KVk/coWRooF58rZK9XI+q9+CafTzNeqn3wrCnGJiGAUQHR7lw1s8+SY5Q9iZHMbZRSBFV6QdrB+ezlLwQ5TjQBotA0gWc9400Kog8dM1HhQ0oXLM4xt6edznjIwTiKhEVsilwUco9ISgTaI+GOPJ2GT36b5QnNkCSOdnbJ3261R/f8EM7Q90dS8We2fgHzfB+mURFN/hC0/IhoJe0G6SMSlORaE208cgZTX5z55FDw6YADr0FYWyyKq7R2bp6T56CEQAs7DEpUTE3US0q4Jwk319JrTnfLHHOE/Rb1SzZVX/7gUqz/tsKl9aXqcI3+OfUXEylNZRIr82N7mxX2LUBN2HxmwlGVsbRjylT2eqh9UOJpgfIYMRlPDBFCQQLfw4iQfWctyAk6feYtE8tkqLdA+eaxZNOKrauVVUbmj7y918Lya4ZdWEwE3nx89YWUVlcIJda92lsnDiLIYD32D0ZUM/7wgdvpB5rIsP5Ugb48k+PNnZJ79VRxzgYrVZk8zGi937NjVgV4hmHvaHBMOBamgNW+qSK4MyE11gyVl4YyejcvVOXMkbjBgU6+/GydrIE/vQHs7q+GhTJdOurzyTFdkp9MRj5/+SZZ10SuXgnBi1nO+ovXqsv+Q+ULgqI+9Wtd0P71I/JIAxzUIg74eF7gTRuFK0vJxPwyCGm2pNwiRDH/sR2KMRQ2jBZw1nTHijk3BMajsBZIyps0WKdLx0+7xgFA9DxTVVJWumE3nPnlnhZwWp9e7qC4sG3H/78jeKjEH+fljHxQji370h/TPDrU7Jf4iiugiOaZtdP6oAuffKGmQx5o4ywy6Kzcoy/ckIjV5XV0AGalPTKSZPIcDWNPkXC1lVhZf72VmAY0= 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)(136003)(376002)(346002)(396003)(39860400002)(36840700001)(46966006)(40470700004)(2906002)(83170400001)(81166007)(9786002)(316002)(2616005)(186003)(6916009)(54906003)(82310400005)(336012)(82740400003)(5660300002)(8936002)(47076005)(7696005)(83380400001)(478600001)(70206006)(2876002)(107886003)(4326008)(8676002)(1076003)(26005)(42882007)(36756003)(40460700003)(426003)(41300700001)(6666004)(40480700001)(36860700001)(102446001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2022 05:29:47.3766 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b31ae547-030d-4585-e21d-08da58c7373f 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-DM6NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5492 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Abhimanyu Saini When DPDK app is running in the VF, it sometimes rings the doorbell before dev_config has had a chance to complete and hence it misses the event. As workaround, ring the doorbell when vDPA reports the notify_area to QEMU. Fixes: 630be406dcbf ("vdpa/sfc: get queue notify area info") Cc: stable@dpdk.org Signed-off-by: Vijay Kumar Srivastava Signed-off-by: Abhimanyu Saini --- v1: * Update the commit id that this patch fixes drivers/vdpa/sfc/sfc_vdpa_ops.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/vdpa/sfc/sfc_vdpa_ops.c b/drivers/vdpa/sfc/sfc_vdpa_ops.c index b3d9b6c..63aa52d 100644 --- a/drivers/vdpa/sfc/sfc_vdpa_ops.c +++ b/drivers/vdpa/sfc/sfc_vdpa_ops.c @@ -794,6 +794,8 @@ int vfio_dev_fd; efx_rc_t rc; unsigned int bar_offset; + volatile void *doorbell; + struct rte_pci_device *pci_dev; struct rte_vdpa_device *vdpa_dev; struct sfc_vdpa_ops_data *ops_data; struct vfio_region_info reg = { .argsz = sizeof(reg) }; @@ -856,6 +858,18 @@ sfc_vdpa_info(dev, "vDPA ops get_notify_area :: offset : 0x%" PRIx64, *offset); + pci_dev = sfc_vdpa_adapter_by_dev_handle(dev)->pdev; + doorbell = (uint8_t *)pci_dev->mem_resource[reg.index].addr + *offset; + + /* + * virtio-net driver in VM sends queue notifications before + * vDPA has a chance to setup the queues and notification area, + * and hence the HW misses these doorbell notifications. + * Since, it is safe to send duplicate doorbell, send another + * doorbell from vDPA driver as workaround for this timing issue. + */ + rte_write16(qid, doorbell); + return 0; } -- 1.8.3.1