From patchwork Wed May 5 16:58:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liming Sun X-Patchwork-Id: 1474456 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=L/SyIhgo; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fb2wt2G24z9sVb; Thu, 6 May 2021 02:58:53 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1leKrF-00045v-HJ; Wed, 05 May 2021 16:58:45 +0000 Received: from mail-dm6nam10on2085.outbound.protection.outlook.com ([40.107.93.85] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1leKrD-00045o-Bw for kernel-team@lists.ubuntu.com; Wed, 05 May 2021 16:58:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UvdTKMUIcCp0fH88Nl6fyhebR3w0ZK1cG2OCRvkc8+oxMLJLvi53g1AUWZqnFG/1ONY1W/3Qxy8Fq2pvIxY37FLL05ExJDGcKhDXTrNvJWgySFrDD7QNxKnvWPeW7UfYBTh65/S921Sg7KKdn1cE7wi1pSflWriREUPULMn5mGPdvwEvykpOFUwy1skF+jX+uAGxPNaHq7fq+0hJjk/fdhOPvOOgNKj1ZTG1OOZ6HPc6IJCp7iFZ4L7oL8Z7fYfUTZNY6ojlWGp1Nprz3YwCEKiguwTLbQENaxFqGDYmQXBUNAToQ8+PPy5Iv2q78zUo5iwzFyIVtKkeoHOKq2EhAw== 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-SenderADCheck; bh=pYpRAGfoxA78Gl3ppmhQHENWMQ/6kMWVorLIvXobuJk=; b=FoJTi38zhcOMK9dPjrxsxaRx7IjcmVEtyvmS1jnlgC70noJ14atZ9Eb8UNLhQyU2EVSgBrbH26JSi8ci7Tz0gSHtZlTrgHYO9EKLUkh46t/JSJ4P9un5eob0vuVmH3GoSM6iH72gQVYQZKfnLW8FQbm+JKEMJYCfh/x3qXJBnrtsvLlIzQtzC8c0ZTAM1DwUQXS6jLsmF0SfNTxq3l+qNCLNZSrEDGM8l1DxLPoNjCfEuogNU4Nytjvi9/41E0Rcz9KsgB/batKZS4K+OqKPmPgysgmkukPVVphOR0i51grx2jiuW5uYpqei/CldsDkpkcI+Sp1t+1qX3euaeWL1kQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=lists.ubuntu.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pYpRAGfoxA78Gl3ppmhQHENWMQ/6kMWVorLIvXobuJk=; b=L/SyIhgox5T5zKy2NecFUyKuasaY6RPYJ1ffv8JhQFu14mOtVWNaP/yCN7O4sNZCNeG8SXra8JBXxD4qcjj06OmW15qLxmmjM5Mw2Ixrq1RqApHdHtBbFa94JryuoPtbnnExAiJy5vmve4DB2Vk1GbmEP9CPQv7I9QWf0qvMnxZZvG+QOnNJGJ6ZN9ZhSii0rq/D8pQj1gCg98Mi5ZHQ3KYhdfVUraevRHj79GrnhEuGaDtOHnUNCX8rxYedoe585inJ8OgRkPIoAWwlFadmavqz9yz+0qEEQtTtlKGivsqoIzZSNa9+rq0HHgTV26naR9eY13+7BMD7rRV/0TkzFA== Received: from MW2PR2101CA0012.namprd21.prod.outlook.com (2603:10b6:302:1::25) by BN9PR12MB5129.namprd12.prod.outlook.com (2603:10b6:408:136::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.39; Wed, 5 May 2021 16:58:41 +0000 Received: from CO1NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:302:1:cafe::72) by MW2PR2101CA0012.outlook.office365.com (2603:10b6:302:1::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.1 via Frontend Transport; Wed, 5 May 2021 16:58:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; lists.ubuntu.com; dkim=none (message not signed) header.d=none;lists.ubuntu.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by CO1NAM11FT028.mail.protection.outlook.com (10.13.175.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Wed, 5 May 2021 16:58:40 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 5 May 2021 16:58:39 +0000 Received: from vdi.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.10) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 5 May 2021 16:58:39 +0000 From: Liming Sun To: Subject: [SRU][F:linux-bluefield][PATCH v1 0/1] UBUNTU: SAUCE: tmfifo: Fix a memory barrier issue Date: Wed, 5 May 2021 12:58:27 -0400 Message-ID: X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6381c24-6c85-471c-66e2-08d90fe70863 X-MS-TrafficTypeDiagnostic: BN9PR12MB5129: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +iF8VdYzCJGBv2YRP2q4iXcXyQbXBq8KS9ZvUlawnT0uY/1gtPGQ40oHaruaGYayGQWwbzA7RumEx7eBpj0GikJAkCT0drJXc/vzns0OKAeNWFIqPmS0x8LGVuGRMg2f8pNN1H3h4YcXzRnyXTRSAm8MqoLGkw68FcK0GEvkmyUr/F5JU7MhjZm7dN/Wz3fYPK1f0dIyPo/4eVy6ls8Oe6wOS9atGGZep6CWLkWi46IAIlVgS7rBfr0kswrm081QiWrhR7IcZ2pw7uMZphqey9fV3WeEmWWwQlT0kz5MODsR6X8pWu7fWvfEZILvwrxxUm+cCu6Dsq0SgJYMer4lrcYWbUF+AGoUKGaNFkE1HbHC3x+H4YPC/ng4p7YsTgvm1NLCVS0OdvD3cfBAo445lKR58HlUBmA60wwvsydY7bg44hsVHxUxvZ0l0BHqNxJZnxS9eM6PxYZsI7USVmXUyor4JQvH84Gz6I2MK9xSUMVuFFUaaNKk5kcsJWS+Mcf9zifZ0Bq84q9GWpmcdi/5PC3yz6KOx26hwm2wm3dKUi6Hhr1h5IUOzI7b+hOChk0cc7tWqziI7CpXB0rFO3/8g5I1cCLYu4FU/5mCNWqztsjA4/jNU1fmVcdBAey2VuW3QeHtcHK0pw+ffFTnKwWWr3IFA5lrIhKH4+1HGygS/u4VJxUSViESXW09FaWTMCi0T90X2//nxwnQQ4abYbnS1Rb2MqRriVbYwDeuXSZrxIQ= X-Forefront-Antispam-Report: CIP:216.228.112.36; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid05.nvidia.com; CAT:NONE; SFS:(4636009)(376002)(346002)(396003)(39860400002)(136003)(46966006)(36840700001)(336012)(5660300002)(966005)(7636003)(70206006)(8936002)(70586007)(356005)(36906005)(2616005)(478600001)(426003)(6666004)(6916009)(316002)(26005)(83380400001)(186003)(7696005)(107886003)(36756003)(47076005)(4744005)(2906002)(86362001)(82310400003)(4326008)(36860700001)(8676002)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2021 16:58:40.1100 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6381c24-6c85-471c-66e2-08d90fe70863 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.36]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5129 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Sun Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1927262 SRU Justification: [Impact] * The virtio framework uses wmb() when updating avail->idx. It guarantees the write order, but not necessarily loading order for the code accessing the memory. So potentially it could cause traffic stuck which has been observed in the field. [Fix] * This commit adds a load barrier after reading the avail->idx to make sure all the data in the descriptor is visible. It also adds a barrier when returning the packet to virtio framework to make sure read/writes are visible to the virtio code. [Test Case] * Just normal test. This change doesn't affect any functionality. [Regression Potential] * This version of the driver was tested by QA/verification for a while so no known regression at the moment.