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 0D2BD42EC5; Thu, 20 Jul 2023 12:19:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F23E040E2D; Thu, 20 Jul 2023 12:19:06 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 142F340DF5 for ; Thu, 20 Jul 2023 12:19:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689848345; x=1721384345; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=iUve/l/FyNoPQ7y+Ac/1r6UpLN2bzMucUllhOIh6LD4=; b=Ap6DbCRN1yyBFAPtLErCMDYQsKyVfzX2+oF4SG+vXxAgiSnzm/SKzlEf FXFzh3ZKtyrOFjayjZ7C0Nt6l7a9i1vB5lSEk4HUX2c3a0FMeLxAE//f6 ZsGXUkC1RqmBvu6YwSAt5l4YpOzaDmjztAp+AC6Jh9wG6tLc/g7D7JEj3 n+XK3RcDaIBwKRhm3WOk82OklsT7bwTbffFDegruOEhuVrMZVbGHoNvbe i3SQS57S7BBr/HQCQhFM/qFxjiEA9DEa3AK/CmgmddAjeZ7gf4clx+Din 2/1do9izlcrG10TBeGuGZO5SB3RSDiRPNfbQtvknyhfH0IZcwCOkeYFJQ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="430461024" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="430461024" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 03:19:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="759523958" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="759523958" Received: from unknown (HELO localhost.localdomain) ([10.239.252.253]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 03:19:02 -0700 From: Mingjin Ye To: dev@dpdk.org Cc: qiming.yang@intel.com, yidingx.zhou@intel.com, Mingjin Ye , Cheng Jiang Subject: [PATCH] app/dma-perf: fix dma mapping access overruns Date: Thu, 20 Jul 2023 10:09:36 +0000 Message-Id: <20230720100937.440849-1-mingjinx.ye@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The dma map supports a maximum of `MAX_WORKER_NB=128`. Initializing the dma map allows a maximum support of `MAX_WORKER_NB=256`. This results in memory access out-of-bounds when the actual dma entries exceed MAX_WORKER_NB. This patch talks about MAX_WORKER_NB and MAX_WORKER_NB size set to 256 to fix this. Signed-off-by: Mingjin Ye --- app/test-dma-perf/main.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test-dma-perf/main.h b/app/test-dma-perf/main.h index f65e264378..602ecac858 100644 --- a/app/test-dma-perf/main.h +++ b/app/test-dma-perf/main.h @@ -10,11 +10,12 @@ #include #include -#define MAX_WORKER_NB 128 +#define MAX_WORKER_NB 256 #define MAX_OUTPUT_STR_LEN 512 #define MAX_DMA_NB 128 -#define MAX_LCORE_NB 256 +/* Note that MAX_LCORE_NB <= MAX_WORKER_NB */ +#define MAX_LCORE_NB MAX_WORKER_NB extern char output_str[MAX_WORKER_NB + 1][MAX_OUTPUT_STR_LEN]; -- 2.25.1