From patchwork Wed Jan 31 18:32:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liming Sun X-Patchwork-Id: 1893630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TQ9dx3ZNhz23g7 for ; Thu, 1 Feb 2024 05:33:25 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rVFOf-0008U2-RR; Wed, 31 Jan 2024 18:33:17 +0000 Received: from mail-dm6nam10on2057.outbound.protection.outlook.com ([40.107.93.57] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rVFOY-0008QV-Pu for kernel-team@lists.ubuntu.com; Wed, 31 Jan 2024 18:33:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=evnQy3ts420dtSnGDDlpZNo3e9R3gThKQSYUhEHXeZ04zVTSFGToGhkqhEAWs7AEyjHN6HvYHiAcQ7gFlJUnfHuLm8QG/P2ovIbw8EwJNBoNRxW2dnZuDXTOQIdL5CoB6PWPytW9SOGKru0cTETIWvgXc6u4Ovne1VWCx03smBzV5DINgSn/P095KEdQfrb3x6LZKLYJvdlzqiZytVHrjBmWGUFTUkQbehfehmWeXjcCBKJTqyn0TK34nfGFEN/u9SOoqPjOcGAl96QYP/FBnHtBC5ChOgOX0Flu1wZ4r+zjt7mJJQUabCJgpTKUcoGkNOGMi4WhOMJGhLaODmsFig== 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=8FuLMaU52A2U9LR/BV7H+r315ELOyDn9HeHkjk/9VIw=; b=Qu7pYXAlvA2M6Q71Ut1i/7XT2+vgrCo7YU423BYL1DasOfbiKdZSBgmxwdyKTuTWwLDH1PyrHTQo+ZsTiGk1M2/LweyO7txHo2wPUBh0nydPrWqrdE7IV56k9umjYmfKxWC1wEYmKol9uxUkYW+gbn27F20MjHINAwmPIP4cjYP5askNkKxSW7xn2ViYPS3j6lyLX9aXbWSaFA2OxC8zSmmg7k28U1yd5WSkWm0FrQ0m4nxfeXmJsVdB84qr7XaNOAQwcHu/3swdRbr10eBuOrfirckdXsenYT4bDTiXSDucGHoWhb0pyIFOFsiFEZ43mV8gb/YhN4xB122g7C16Jw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=lists.ubuntu.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) Received: from SJ0PR03CA0378.namprd03.prod.outlook.com (2603:10b6:a03:3a1::23) by BY5PR12MB5509.namprd12.prod.outlook.com (2603:10b6:a03:1d7::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Wed, 31 Jan 2024 18:33:04 +0000 Received: from SJ5PEPF000001D7.namprd05.prod.outlook.com (2603:10b6:a03:3a1:cafe::b8) by SJ0PR03CA0378.outlook.office365.com (2603:10b6:a03:3a1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23 via Frontend Transport; Wed, 31 Jan 2024 18:33:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ5PEPF000001D7.mail.protection.outlook.com (10.167.242.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.16 via Frontend Transport; Wed, 31 Jan 2024 18:33:04 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 31 Jan 2024 10:32:51 -0800 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 31 Jan 2024 10:32:51 -0800 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Wed, 31 Jan 2024 10:32:51 -0800 From: Liming Sun To: Subject: [PATCH v1 0/1] [SRU][J:linux-bluefield] platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full Date: Wed, 31 Jan 2024 13:32:47 -0500 Message-ID: X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001D7:EE_|BY5PR12MB5509:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b055b84-ff61-4c7a-4fe0-08dc228b0fef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a9cIjdP3xeJ3wVU2aOzfHXrvJvrNYNaHmuhRonTB6eDiNrbJHByKaAfiNSB3YcV9wC2vK0Z2irJPoqyzP8/mN1G/D9M0Z4b0bYSFP22exJ0L+14bmh6RVL0hoWZRZYynRepztJJU2bP4yvc3UR+PdoflJdW1nHx+VTAio9ACSkeLsnFIqHPrTx7lr1ITk+7BlbHm/uZgY7h4tERwuHZzCa4LDDhnOd8n/utCchjUkYuwdECB/y5JaFdDQrQKZ0/SbODVEzzRBcx9fvgHp2aywJrJp3EbXrIH7/0GnKnw+1nCK/SGasCeA2gCROM25ThjEITBpaTShhtp6k1/QSiDdcAC7tkGzn7xAYL7N2iGIqHXqUXt+L0wEk+JkPPygCxfujFfIJVM87YxkZQCvdv/GFsj39vyMw4Fjr3o0ueIEgIVYraPma+AQHmqYqhztN8nhBe6rQxgN08bMBNswFALBX62Mrf2QhZZhA7W3hLMBJQEbui4/jSPdaTTWy33dg++k6YKpFzzE5coSt6sVhWgDCNe/n+FXmJnkyGVnTMhHIX2s3szqQuy4qqsNbkVKcJtgjxdWFY5NuGYNlVDAWt0fZZEwYs5AaV/R1xgrmAzBSMykhmV1lSpurLXk4yVC2mF9mcjDRcB9c87aFNsnst8Kw6Lfd+HN2uIrYRHuVXDxPn9CKgB4wftKETwl51BlOK9OP+eguhbXmuWCHBig0so00+z7gYfAnPRZG9IQa7riKpIbd9uzHK+1DHGFdPCc/qK14/n9vLcqUTnChpzUqPitCQvXsI4BzY2R869FXB+pe5P8lXQzLxzBTXQ3yUi9CRN56dDe0rVv18yyNwrYYXZdw== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(136003)(376002)(396003)(346002)(230922051799003)(230273577357003)(230173577357003)(64100799003)(186009)(451199024)(1800799012)(82310400011)(40470700004)(46966006)(36840700001)(2906002)(36756003)(41300700001)(6916009)(70206006)(70586007)(316002)(54906003)(86362001)(47076005)(6666004)(336012)(426003)(2616005)(7696005)(26005)(107886003)(478600001)(40460700003)(40480700001)(966005)(83380400001)(5660300002)(82740400003)(36860700001)(356005)(7636003)(8936002)(4326008)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 18:33:04.2283 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b055b84-ff61-4c7a-4fe0-08dc228b0fef X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001D7.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB5509 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 , David Thompson Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2051871 SRU Justification: [Impact] This is a cherry-pick fix from upstream to drop Tx network packet when Tx TmFIFO is full. [Fix] Starting from Linux 5.16 kernel, Tx timeout mechanism was added in the virtio_net driver which prints the "Tx timeout" warning message when a packet stays in Tx queue for too long. Below is an example of the reported message: "[494105.316739] virtio_net virtio1 tmfifo_net0: TX timeout on queue: 0, sq: output.0, vq: 0×1, name: output.0, usecs since last trans: 3079892256". This issue could happen when external host driver which drains the FIFO is restared, stopped or upgraded. To avoid such confusing "Tx timeout" messages, this commit adds logic to drop the outstanding Tx packet if it's not able to transmit in two seconds due to Tx FIFO full, which can be considered as congestion or out-of-resource drop. This commit also handles the special case that the packet is half- transmitted into the Tx FIFO. In such case, the packet is discarded with remaining length stored in vring->rem_padding. So paddings with zeros can be sent out when Tx space is available to maintain the integrity of the packet format. The padded packet will be dropped on the receiving side. [Test Case] Same functionality and testing as on BlueField-1/2/3. No functionality change. [Regression Potential] Same behavior from user perspective. [Other] n/a Liming Sun (1): [SRU][J:linux-bluefield] platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full drivers/platform/mellanox/mlxbf-tmfifo.c | 67 ++++++++++++++++++++++++ 1 file changed, 67 insertions(+) Acked-by: Thibault Ferrante Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Andrei Gherzan