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 23A1AA0548 for ; Sun, 28 Nov 2021 16:01:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1EDDE40E5A; Sun, 28 Nov 2021 16:01:24 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2053.outbound.protection.outlook.com [40.107.220.53]) by mails.dpdk.org (Postfix) with ESMTP id 6BD194111B for ; Sun, 28 Nov 2021 16:01:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mwM//XSWc09sMDF89hOzUboJwOmGPMNwO9PRQNGqD4Jjv67lqPArxTViPjlhLwueXltpl3ljSzc147s0nba/pHQiO8QrkGoYEFzplh8/WUO1AeZ3CqXeJmLmPV2M1lTi+tfX/0rq2IXpSskd4dQioCGZvOioNbVtfUENha+EskMtUa0bld23c1qagFR6xdcQ1/97+9MaVP5lO8o03hF+KfiHkQHx6M0FC1BOdCDCy0fq/z3dYNMWL7Hw7oBLdX0m2Wforv+fIsnGAfNVIWfzOpyPC335nvPzw2hb9oT9FR2351zxz24R3Tw4Itfvcny8ELaJgEH4NtADpWg7C7vJZA== 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=djPlJ3bcg1PxKTForkcgQx4oRxSEYor6XGhiSRNrQQs=; b=VE3Jx+pETzPl4k/x5hopRxoJSWvrX16z2lob+SjSS7oxrUicpcaPOoTniopEfc9aMtucwP1j5Sejx5+VuT3maGjIvlsjmwykdd0jXFCpr/DOXhS7CeBPVh5K01MHCcCgB8uEltJgTZ8XlNpExNX3eSp7jv0TioLMNOYriI/USE0Xp/z1OLcSIz2lOETplo04vjsQB+hTPBTk4NxtjsKQasvLIt8z1SxS9HMyRrMl3YHY2fxmxMXVq85qm0djeeF5AITUtE/A480rnc0lqo0bg4sCM+ieUmdyCrDUSIxJp5UI1t7sDEaP512PlpbB8DRC1JAXHZuFE7YlaE1fhnoyTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=djPlJ3bcg1PxKTForkcgQx4oRxSEYor6XGhiSRNrQQs=; b=II9Dm0ECPVqEFOsfpMQtmaTlNqsJhg9r0DdAPZyc22ePPS4cCkZK1Wf1Pyd2d1/91sqXksOX3mMPsSl9Zw2OuNdC678xQe+JFRWMXyplyXvsilv/l4jwtj8z/HqOiilk9EwIImw8jUPFgQfA5kXrTK0WocVuoBsZ2a4WKS4Cv6C1f8nekoM05Ef4FOSaF53AV3XxLfMjvNJo+nsseEl61gncWhqgebVX3fWz0sjgvr7FJ88Eel+U1iX+UlHd1hA/OiH40f3nSjtIo/z0WBpd80UnvS7UkxdcVSl6ipz/wjMbsmNdVwUHy+fclJOj5UANAfD7kbIT1HaNgKlEK0ifKA== Received: from BN6PR13CA0062.namprd13.prod.outlook.com (2603:10b6:404:11::24) by DM5PR1201MB0042.namprd12.prod.outlook.com (2603:10b6:4:50::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Sun, 28 Nov 2021 15:01:18 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:404:11:cafe::61) by BN6PR13CA0062.outlook.office365.com (2603:10b6:404:11::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.7 via Frontend Transport; Sun, 28 Nov 2021 15:01:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT064.mail.protection.outlook.com (10.13.176.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4734.22 via Frontend Transport; Sun, 28 Nov 2021 15:01:17 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 28 Nov 2021 15:00:36 +0000 From: Xueming Li To: Dariusz Sosnowski CC: Luca Boccassi , Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix partial inline of fine grain packets' has been queued to stable release 20.11.4 Date: Sun, 28 Nov 2021 22:53:58 +0800 Message-ID: <20211128145423.3974892-55-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211128145423.3974892-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> <20211128145423.3974892-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca3d8738-06e0-46d2-dd3c-08d9b27fee6e X-MS-TrafficTypeDiagnostic: DM5PR1201MB0042: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vFDq6450teouMGlLrNkaN7gmldlZAAEgDF8cx3vHUZdD4RNaZTuHEyTftHWg8eZ9Vjoz+VzfMGNhWKAb32InNIi7QRV4OMIj+8f2aHTyzWTReyEbOw22/KNNBuFTwWHpgTOs/58KBwkL66M+MPAGkffjU3js7wlXRbFgkNKH2owWDmI30ZZSl0VkP8iGv03ehSrzJQbrm4F0vAcpHpEMsZYKH9LFs9y0BFL1AxIwHUg+dKmG5nYhliZShIdXlYTdJOgORBM1hsO1QQQh/lKYEYChOaijGN3AGtKmOfUIL72PwY1hzazAmEKjdif/dE/5Ib6HHiCFah5xum6RGsQgaEQc9Drd2zvWfRelk4imbZP0dRjAq7gMkZfmdHK+uzX6AApRiTq4vsCVMAceAb74OGjLpne80FzNsGzrWwNTDTImYKdZ+hUXYxXs2Cn0GsvNA/UzfHwYBYzyD0a09wcw0bx+xOEMlz8GlHjq2TeXKcuyMigi6nlIn9jiIMsXILb88gzbVUI0wh3vrNCdmpR7ebPFhAKOo2NedcJvJvaxXHLXnC8LEbx+H0+cFY0b1hrJ29CRZYkoXV9+xgdVNSvhTsuz1L5fyIXpFR5+XExF+FxGdY8Q7gXMN4vELnoCdC9hEGnO8xKNVMxMOc7r3fUh/3oMm/2ApjEePLEN1nH85SF25nDIRgR+syhbsPPlEqhlGRsRZr68fOrymdL0WjGcPpcqJDTJnQMCql9gC3fhhUxyfCbmEYMjMHMA6Fn2N9RihyWeZHjCBVpszlD4lu1ShZmGKjecUwNnR+PnWmLlJzgUnhbXM7oxsXRyynD2WkVetbpwIP5J8TKxRiEmaBxmJw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(2906002)(36860700001)(54906003)(6286002)(37006003)(316002)(70586007)(70206006)(7696005)(6862004)(6666004)(8936002)(1076003)(426003)(2616005)(4001150100001)(55016003)(5660300002)(47076005)(356005)(82310400004)(7636003)(966005)(86362001)(186003)(16526019)(26005)(53546011)(6636002)(36756003)(336012)(508600001)(8676002)(83380400001)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 15:01:17.8810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca3d8738-06e0-46d2-dd3c-08d9b27fee6e 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.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0042 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 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/30/21. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/630a42f437228b5b7aaab5ceee5ebeaea23e1d9c Thanks. Xueming Li --- >From 630a42f437228b5b7aaab5ceee5ebeaea23e1d9c Mon Sep 17 00:00:00 2001 From: Dariusz Sosnowski Date: Wed, 17 Nov 2021 11:50:50 +0200 Subject: [PATCH] net/mlx5: fix partial inline of fine grain packets Cc: Xueming Li [ upstream commit 7775172c045f3387cee47d3f32633255d37ba785 ] Assuming a user tried to send multi-segment packets, with RTE_PMD_MLX5_FINE_GRANULARITY_INLINE flag set, using a device with minimum inlining requirements (such as ConnectX-4 Lx or when user specified them explicitly), sending such packets caused segfault. Segfault was caused by failed invariants in mlx5_tx_packet_multi_inline function. This patch introduces a logic for multi-segment packets, with RTE_PMD_MLX5_FINE_GRANULARITY_INLINE flag set, to omit mbuf scanning for filling inline buffer and inline only minimal amount of data required. Fixes: ec837ad0fc7c ("net/mlx5: fix multi-segment inline for the first segments") Signed-off-by: Dariusz Sosnowski Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxtx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 5ec823b024..97e0995c66 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -3468,7 +3468,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, MLX5_ASSERT(txq->inlen_mode >= MLX5_ESEG_MIN_INLINE_SIZE); MLX5_ASSERT(txq->inlen_mode <= txq->inlen_send); - inlen = txq->inlen_mode; + inlen = RTE_MIN(txq->inlen_mode, inlen); } else if (vlan && !txq->vlan_en) { /* * VLAN insertion is requested and hardware does not @@ -3481,6 +3481,8 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, } else { goto do_first; } + if (mbuf->ol_flags & PKT_TX_DYNF_NOINLINE) + goto do_build; /* * Now we know the minimal amount of data is requested * to inline. Check whether we should inline the buffers @@ -3513,6 +3515,8 @@ do_first: mbuf = NEXT(mbuf); /* There should be not end of packet. */ MLX5_ASSERT(mbuf); + if (mbuf->ol_flags & PKT_TX_DYNF_NOINLINE) + break; nxlen = inlen + rte_pktmbuf_data_len(mbuf); } while (unlikely(nxlen < txq->inlen_send)); } @@ -3540,6 +3544,7 @@ do_align: * Estimate the number of Data Segments conservatively, * supposing no any mbufs is being freed during inlining. */ +do_build: MLX5_ASSERT(inlen <= txq->inlen_send); ds = NB_SEGS(loc->mbuf) + 2 + (inlen - MLX5_ESEG_MIN_INLINE_SIZE + -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-28 22:41:06.078722329 +0800 +++ 0054-net-mlx5-fix-partial-inline-of-fine-grain-packets.patch 2021-11-28 22:41:03.380206560 +0800 @@ -1 +1 @@ -From 7775172c045f3387cee47d3f32633255d37ba785 Mon Sep 17 00:00:00 2001 +From 630a42f437228b5b7aaab5ceee5ebeaea23e1d9c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 7775172c045f3387cee47d3f32633255d37ba785 ] @@ -18 +20,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ - drivers/net/mlx5/mlx5_tx.h | 7 ++++++- + drivers/net/mlx5/mlx5_rxtx.c | 7 ++++++- @@ -26,5 +28,5 @@ -diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h -index ad13b5e608..bc629983fa 100644 ---- a/drivers/net/mlx5/mlx5_tx.h -+++ b/drivers/net/mlx5/mlx5_tx.h -@@ -1933,7 +1933,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, +diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c +index 5ec823b024..97e0995c66 100644 +--- a/drivers/net/mlx5/mlx5_rxtx.c ++++ b/drivers/net/mlx5/mlx5_rxtx.c +@@ -3468,7 +3468,7 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, @@ -39 +41 @@ -@@ -1946,6 +1946,8 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, +@@ -3481,6 +3481,8 @@ mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq, @@ -43 +45 @@ -+ if (mbuf->ol_flags & RTE_MBUF_F_TX_DYNF_NOINLINE) ++ if (mbuf->ol_flags & PKT_TX_DYNF_NOINLINE) @@ -48 +50 @@ -@@ -1978,6 +1980,8 @@ do_first: +@@ -3513,6 +3515,8 @@ do_first: @@ -52 +54 @@ -+ if (mbuf->ol_flags & RTE_MBUF_F_TX_DYNF_NOINLINE) ++ if (mbuf->ol_flags & PKT_TX_DYNF_NOINLINE) @@ -57 +59 @@ -@@ -2005,6 +2009,7 @@ do_align: +@@ -3540,6 +3544,7 @@ do_align: