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 7EDDB41D8D for ; Mon, 27 Feb 2023 08:03:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BCA3410EE; Mon, 27 Feb 2023 08:03:58 +0100 (CET) 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 859C3410EE for ; Mon, 27 Feb 2023 08:03:57 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JOmZewXEaQ88SpPzIIUFrZFueNkojAzQm80Ram/RWxToiMwx7qaLZaEThEkGedC05ATZPkBoAEiZrZezdIgUq1a5iBXtV/LSGFHTqd1tgkliTYp6AyuaPHxnyG8hTjUdSRbSeLhHRTF9mkf6/9XFIfaH/RP9kTD43g8Gege2vzpfMrwD55LwnQzwuDIT3nNkHn1tiEI1BpWvR/cU1Kigzc41D4lzCMx+bBfVTJbTwT6KawcljDCEwkHpDOQIxCOp8LQE4rBczUwcVZPSgM3+YkX3ZfskAD0wbTuU/lA7kx+tyUVG40t36W2c27kO1hLSGRM9Y5tLAF+Lkq03HZKixQ== 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=L5jDKB+bBkYo2ViN2C2BaxTuP6070go5ceF31nhYTNs=; b=GOPv2nseh8rrLgp2cOMWPGuZdJ1oEn7XLfeKXgv2n/Q0wmpzcP6oOP1Vx+DfKb+/VgedLnSjJSqhQjb7cZUAIMc+1l7uOYzqbWQ7ajjqJUHf7Op7wTzg3hLBgevD0kPc863hJJTFVRZfMbVOLobPIe4si0nCNgxIkF5E/D2q5ny5YhoYzLaBynrfNnjdoDIeml5rBscsuz4nt9DjGPAl102kXRGCi4SIazQGiwFigmXsFa6uToeMxA/SyvqGeqpfFy6U/s3qQv9136kVmIBqp0XiDXOvA61KAadOrNlX+WjPtDkhvN+gaBHhq0OyUapaLRs1xOfzOIpZFBpETibN4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=corigine.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 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=L5jDKB+bBkYo2ViN2C2BaxTuP6070go5ceF31nhYTNs=; b=GYbzvX7QGl4qakMbKL7+xaw44b1ykB107muaAmVxUbiKiYzAYtOVqApSAh5dP6H9iyN+ARdGw+B98SpRb5bLX3RPFAYnzRXmWKTxTAbSh1ySb6IbHwgGFpEEzHObC8mMZk5XaBvBfosElQpozjpQh2cPxY/i4gjOzZVMa0Wp4Pa+mp7Ys0+iLK6ul221tatKcv4LIxlvrJEOGCYW6wz6oSJuvGo0WAQQ/te4OE25ZR6yNIMuhFguoZYd2o3SFPQmveY5YaT5PvyQkSrwAKer7wMRzRurk27famG7yFVbi4YuosH3mMLh/sLEX8UhFHNKJRl2+sP+ZBUuX2dIbFMQ6w== Received: from DM6PR08CA0002.namprd08.prod.outlook.com (2603:10b6:5:80::15) by DM6PR12MB4433.namprd12.prod.outlook.com (2603:10b6:5:2a1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.25; Mon, 27 Feb 2023 07:03:55 +0000 Received: from DS1PEPF0000E64C.namprd02.prod.outlook.com (2603:10b6:5:80:cafe::5a) by DM6PR08CA0002.outlook.office365.com (2603:10b6:5:80::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:03:55 +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 DS1PEPF0000E64C.mail.protection.outlook.com (10.167.18.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Mon, 27 Feb 2023 07:03:53 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.36; Sun, 26 Feb 2023 23:03:45 -0800 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 26 Feb 2023 23:03:42 -0800 From: Xueming Li To: Long Wu CC: =?UTF-8?q?Niklas=20S=C3=B6derlund?= , "dpdk stable" Subject: patch 'net/nfp: fix Tx packet drop for large data length' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 14:58:53 +0800 Message-ID: <20230227070107.15664-25-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E64C:EE_|DM6PR12MB4433:EE_ X-MS-Office365-Filtering-Correlation-Id: f4de392a-da13-40e7-4176-08db1890c98d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zt6UxLfkSIOa08Skuha9NYUGq35DUJLyseOE0jmka9kGcBMXYxZtHrIXM/Ewx91rrHkC3g6s5Ce/FPHTFv3moIN3lSTWnOr0HjKU6KM2nphzEjFHOYqL2OCjM4h5Vhu1hPVCEsnPqHK1W+4tuR1CVM+VUlta3AtS76g1pcCacLEcu826dKN4zhp3rBY2vFI74nVXw45ezDRphLgEnQ5wIwHTFx+Ylfb37Cg7VCt8BlWeCU80eayWhB1vFIgzOWoGZpgcAwyBF/X+CG8dsypCC01GTtqSt6Ii81atbBWjjsYGfyRLgzpo/Ilh6R8wyImMPxRp5m5ksK7dtMyBc5MWfDYWVhlZFfvBz3/niaTYS+qkybtuqsWxOEOwipTFxkrUDYAJbgV+j+sNFPGWioep3yA+sUzesm+93x2AD5qE4Ils17jcXGnmLwyxDRV2ibtYu5s/Nmd8s8xlVduYdWCSlpqlcMW0AGzZ6FF1pNeJpAAUdkJ9Z2lCmReTIrSJXASEfYLlOUlC3RKeBybVp8o7vTDb9hZ1LRqmW2Vfuzqq2rSDCXCN6coeFKi0cMj0+m/SRELo7bZpZzN9SSi3OLrmJySphtLgbrmyPLByRJ7lFvkeILVmlnZ9oL6vindqF41McU+BWp/caBMouzjRL8n3/pA50Lme5xBz+sYYi9tIgTH2jWE0I1nLs1sbO71GSzjgYPElhh3ShWB+5P7nP0IdMsINy/pH4Z5R17arFb954DhfceowDotnCyws5kjTsNQ6TiCXQouXzvbub7HV3hebbw== 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:(13230025)(4636009)(136003)(346002)(396003)(376002)(39860400002)(451199018)(46966006)(40470700004)(36840700001)(2906002)(36756003)(8936002)(5660300002)(41300700001)(40460700003)(70586007)(6916009)(70206006)(40480700001)(86362001)(54906003)(55016003)(966005)(316002)(4326008)(356005)(478600001)(7696005)(8676002)(7636003)(1076003)(6666004)(36860700001)(53546011)(82310400005)(186003)(26005)(6286002)(2616005)(66574015)(82740400003)(336012)(83380400001)(47076005)(426003)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:03:53.7329 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4de392a-da13-40e7-4176-08db1890c98d 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: DS1PEPF0000E64C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4433 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 Hi, FYI, your patch has been queued to stable release 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=a87a84560cf4b5825c85dcdb7d8e1cad0931cce6 Thanks. Xueming Li --- >From a87a84560cf4b5825c85dcdb7d8e1cad0931cce6 Mon Sep 17 00:00:00 2001 From: Long Wu Date: Tue, 29 Nov 2022 09:21:22 +0800 Subject: [PATCH] net/nfp: fix Tx packet drop for large data length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit b108863e40bacf20cdb461b50b88c4ec0bb5e143 ] If dma_len is larger than NFDK_DESC_TX_DMA_LEN_HEAD, the value of "dma_len & NFDK_DESC_TX_DMA_LEN_HEAD" maybe less than packet head length and the packet will be dropped. Fill maximum dma_len in first Tx descriptor to make sure the whole head is included in the first descriptor. In addition, add comments to better explain the code flow. Fixes: c73dced48c8c ("net/nfp: add NFDk Tx") Signed-off-by: Long Wu Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfp_rxtx.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 01cffdfde0..e2cdb9e27e 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -1063,6 +1063,7 @@ nfp_net_nfdk_tx_maybe_close_block(struct nfp_net_txq *txq, struct rte_mbuf *pkt) if (unlikely(n_descs > NFDK_TX_DESC_GATHER_MAX)) return -EINVAL; + /* Under count by 1 (don't count meta) for the round down to work out */ n_descs += !!(pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG); if (round_down(txq->wr_p, NFDK_TX_DESC_BLOCK_CNT) != @@ -1219,8 +1220,19 @@ nfp_net_nfdk_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pk } else { type = NFDK_DESC_TX_TYPE_GATHER; } + + /* Implicitly truncates to chunk in below logic */ dma_len -= 1; - dlen_type = (NFDK_DESC_TX_DMA_LEN_HEAD & dma_len) | + + /* + * We will do our best to pass as much data as we can in descriptor + * and we need to make sure the first descriptor includes whole + * head since there is limitation in firmware side. Sometimes the + * value of 'dma_len & NFDK_DESC_TX_DMA_LEN_HEAD' will be less + * than packet head len. + */ + dlen_type = (dma_len > NFDK_DESC_TX_DMA_LEN_HEAD ? + NFDK_DESC_TX_DMA_LEN_HEAD : dma_len) | (NFDK_DESC_TX_TYPE_HEAD & (type << 12)); ktxds->dma_len_type = rte_cpu_to_le_16(dlen_type); dma_addr = rte_mbuf_data_iova(pkt); @@ -1230,10 +1242,18 @@ nfp_net_nfdk_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pk ktxds->dma_addr_lo = rte_cpu_to_le_32(dma_addr & 0xffffffff); ktxds++; + /* + * Preserve the original dlen_type, this way below the EOP logic + * can use dlen_type. + */ tmp_dlen = dlen_type & NFDK_DESC_TX_DMA_LEN_HEAD; dma_len -= tmp_dlen; dma_addr += tmp_dlen + 1; + /* + * The rest of the data (if any) will be in larger DMA descriptors + * and is handled with the dma_len loop. + */ while (pkt) { if (*lmbuf) rte_pktmbuf_free_seg(*lmbuf); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:41.782981000 +0800 +++ 0026-net-nfp-fix-Tx-packet-drop-for-large-data-length.patch 2023-02-27 14:08:40.739237000 +0800 @@ -1 +1 @@ -From b108863e40bacf20cdb461b50b88c4ec0bb5e143 Mon Sep 17 00:00:00 2001 +From a87a84560cf4b5825c85dcdb7d8e1cad0931cce6 Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit b108863e40bacf20cdb461b50b88c4ec0bb5e143 ] @@ -19 +21,0 @@ -Cc: stable@dpdk.org