From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id BAA2543B86
	for <public@inbox.dpdk.org>; Tue,  5 Mar 2024 10:55:41 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B53BA4026B;
	Tue,  5 Mar 2024 10:55:41 +0100 (CET)
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on2067.outbound.protection.outlook.com [40.107.93.67])
 by mails.dpdk.org (Postfix) with ESMTP id BB39C4014F
 for <stable@dpdk.org>; Tue,  5 Mar 2024 10:55:39 +0100 (CET)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HaIx7HcM6wEcygQHji450U5dz3eOdB1ZB0d8vOkRhNUgtovc7gKrR54XHkvccsPK5JzeRxmmIszRYylXyDNQewhJo05/IgRLgXXnehSMDsUTuAUbYs/8xK3qXCM9wJjvxouX11sziJYrvxpl+XJmeIAWWv9mLcL0IrqlAFwpneIyd0i5kItlln339GJMk04szKPleGrHCDuzgrVd7S0nV8rdvRGTrJ32Om1mVIufbGz6Fb75pB5fAmwG1nxTbsy5Kz87wr/6nTlmclCDrmxUL5DTLgFzNRx1mtpV07hfmDKVfeVmyy+hnDcBKg6gO2S3P4/8E4DP+ODEs4WMfE/XnA==
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=pu3EbxF1fQE/6w/Yc1yakdVI1RqHoNzAUAJvm1/jMvk=;
 b=js46/JvCbF+4SO43YHLBh11kB6yBjCvYEDQCOnvywEgDbp4RHjnUO/Y9DlWEfmgJI2gge+OxOOuf0jxeVTNqz6pFEcYfH/QZRrk+pQWtM8i8uINiWmShKsXehajSmVOblKLjK7uo8cgqpyKniajLDceBczI0wTPa2vuz+vsoOyn4mKVh20l1p8MfJQWTFNUtqapzvD/wKWXhEn9Gwzf6wgkqypT7V0stIHUf98Q3PsBK645yB3LDsMRAfX6xykvWQtwQNOLkna9pNpLQGGwDfLxhwFqbDYupF2i5bD1Z8wybfp/XqdSFJhHzXNeA3ag5M0SWQ+B8iSjLFbATAdc1QA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 216.228.117.161) smtp.rcpttodomain=arm.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)
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=pu3EbxF1fQE/6w/Yc1yakdVI1RqHoNzAUAJvm1/jMvk=;
 b=em8AD4sg+E313v5sU8kyfsY4BsOOCpv0TGOJt4MhFkV7bwSCDOK/QJ0uXd+QQIg8N8mhlOyafC0DeUhbR80cH1qJKv10c3ypDej2N11t22aB2cM+jfeYProB76cC0ygP77XpHwkjC/A8NyDapOdfjOjnQv3cQBu/Wk19GHL1qFBaCXYpVy8SWzVBR86GeB9+3SYNNRA+Mfek/DnrXIIw8HOzs0L8X2e8g/At3m2L7IxyBjG6tsWtXVQJLErocpQEN62iVD19zGN/D/gkM3foFFEPcQ9PWiGetk1VY3VjSqLr5lNhCpzm38UqTHApCJdpb0i/+l43r0f/61JPpXpONw==
Received: from BYAPR01CA0033.prod.exchangelabs.com (2603:10b6:a02:80::46) by
 SJ2PR12MB8943.namprd12.prod.outlook.com (2603:10b6:a03:547::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Tue, 5 Mar
 2024 09:55:35 +0000
Received: from SJ5PEPF000001D3.namprd05.prod.outlook.com
 (2603:10b6:a02:80:cafe::41) by BYAPR01CA0033.outlook.office365.com
 (2603:10b6:a02:80::46) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.37 via Frontend
 Transport; Tue, 5 Mar 2024 09:55:35 +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
 SJ5PEPF000001D3.mail.protection.outlook.com (10.167.242.55) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:55:34 +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.41; Tue, 5 Mar 2024
 01:55:23 -0800
Received: from nvidia.com (10.126.231.35) 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.1258.12; Tue, 5 Mar
 2024 01:55:21 -0800
From: Xueming Li <xuemingl@nvidia.com>
To: Joyce Kong <joyce.kong@arm.com>
CC: Liangxing Wang <liangxing.wang@arm.com>, Ruifeng Wang
 <ruifeng.wang@arm.com>, Stephen Hemminger <stephen@networkplumber.org>,
 Ferruh Yigit <ferruh.yigit@amd.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'net/memif: fix crash with Tx burst larger than 255' has been
 queued to stable release 23.11.1
Date: Tue, 5 Mar 2024 17:47:02 +0800
Message-ID: <20240305094757.439387-82-xuemingl@nvidia.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com>
References: <20240305094757.439387-1-xuemingl@nvidia.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.126.231.35]
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: SJ5PEPF000001D3:EE_|SJ2PR12MB8943:EE_
X-MS-Office365-Filtering-Correlation-Id: 89dfa1f5-be55-4a3e-1267-08dc3cfa671b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: tMd/iYn/T8nshfF7TThRF8/i57jr24BaaSyLbC2TVEwm2Y9lMfpIXQZixpKFBpCT96UYcXaajHstw0IsMyD2OuPSGedppjnBhhGExtzzZwRAj5wdgzzNnVVmqcQmQKs8LaxLWCVukbQ39Pq1n67v7I6fKGTwYxoR3wUoJ1zr7hZFVFHVpsngQ7ArNpYFPvsu25+yXwMKdI0Aekm7KUPKQYGjtZSPWtuKYSO8fjxIRufohy1qEVAkq3My5uvR5EZo33bzVFs70Kj789/C16eegbPj+4Tt2F1SZpqhMQceYGxA6kAKcRqmjbe8ZJDIOvTu0arYly/HubaFpsioJl+hoxdU6/vi+l6OUsVFLKZF7LkjGQysOyu6IwfPTvG/lLewz0mCeF8kA77UIuQ0Vvj1J2EKZ+uXKvJi3J6rBUlpbfOMz4k6106W4ze9x8J/vZoQOxDi6KJq89QSAq1ocmN8HHqy6s0i3LjHn4AzQoVv8WQ4L/kUTAuFeuFE3soMYRiaeyJv9PWRtOhyemHmnsMd35UvsZ5QqcwqNanCVaq5cgRQpQ5Ouuj04lNju/w/l2g92tRUyDK9fBiSf9+loXZPCeR0Fspwqew227b60hwxY+OxTrKryI4QtVgkZHgribOsuu9wKicNpfofGpTwl4VpTYfCp2fE5auaXLZiyHVvWRthxepx6/5QeBXwzonYiy9k0Fx2RbKclEk5jEatFRpsuYfJATpfBrw8kFpD2fLttNpIt18hTbu/rfDjYvFft/Wj
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)(36860700004)(82310400014)(376005); DIR:OUT; SFP:1101; 
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:55:34.8929 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 89dfa1f5-be55-4a3e-1267-08dc3cfa671b
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: SJ5PEPF000001D3.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8943
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org

Hi,

FYI, your patch has been queued to stable release 23.11.1

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/31/24. 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=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9cf299a8738c63a463f0a4dbfcda83dd0af67f6b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
>From 9cf299a8738c63a463f0a4dbfcda83dd0af67f6b Mon Sep 17 00:00:00 2001
From: Joyce Kong <joyce.kong@arm.com>
Date: Tue, 5 Dec 2023 04:05:24 +0000
Subject: [PATCH] net/memif: fix crash with Tx burst larger than 255
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d8d91d78fef8a9814f918ea40a487646da83d202 ]

There will be a segfault when Tx burst size is larger than 256.
This is because eth_memif_tx uses an index i which is uint8_t to count
transmitted nb_pkts.
Extend i to uint16_t, the same size as nb_pkts.

Fixes: b5613c8f9d0a ("net/memif: add a Tx fast path")

Reported-by: Liangxing Wang <liangxing.wang@arm.com>
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 .mailmap                          | 1 +
 drivers/net/memif/rte_eth_memif.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index bff68cefd8..540a3caab7 100644
--- a/.mailmap
+++ b/.mailmap
@@ -788,6 +788,7 @@ Lewei Yang <leweix.yang@intel.com>
 Leyi Rong <leyi.rong@intel.com>
 Liang Ma <liangma@bytedance.com> <liangma@liangbit.com> <liang.j.ma@intel.com>
 Liang-Min Larry Wang <liang-min.wang@intel.com>
+Liangxing Wang <liangxing.wang@arm.com>
 Liang Xu <liang.xu@cinfotech.cn>
 Liang Zhang <zhangliang@bigo.sg>
 Li Feng <fengli@smartx.com>
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 7cc8c0da91..6f45a00172 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -684,7 +684,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		n_free = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE) - slot;
 	}

-	uint8_t i;
+	uint16_t i;
 	struct rte_mbuf **buf_tmp = bufs;
 	mbuf_head = *buf_tmp++;
 	struct rte_mempool *mp = mbuf_head->pool;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.446874582 +0800
+++ 0081-net-memif-fix-crash-with-Tx-burst-larger-than-255.patch	2024-03-05 17:39:30.823566495 +0800
@@ -1 +1 @@
-From d8d91d78fef8a9814f918ea40a487646da83d202 Mon Sep 17 00:00:00 2001
+From 9cf299a8738c63a463f0a4dbfcda83dd0af67f6b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d8d91d78fef8a9814f918ea40a487646da83d202 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index dd3a4f7529..297da3b426 100644
+index bff68cefd8..540a3caab7 100644
@@ -28 +30 @@
-@@ -789,6 +789,7 @@ Lewei Yang <leweix.yang@intel.com>
+@@ -788,6 +788,7 @@ Lewei Yang <leweix.yang@intel.com>