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 AB9C84307F for ; Wed, 16 Aug 2023 12:13:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6AD343260; Wed, 16 Aug 2023 12:13:22 +0200 (CEST) Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) by mails.dpdk.org (Postfix) with ESMTP id CA499410D0; Wed, 16 Aug 2023 12:13:20 +0200 (CEST) Received: by mail-ua1-f48.google.com with SMTP id a1e0cc1a2514c-7a006828e99so348420241.0; Wed, 16 Aug 2023 03:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692180800; x=1692785600; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=15i0sfLMjPVcYd8SRHO4kwkUn2GLQy2+NOZE3RgyjBs=; b=OBkI6ebq+1tXyu1Y2G+9tKTnqOgaXZ7cibwsy8KL+2EoJF74ea1xmh02/VpjoFnu9e 21YJ2r4ody61P7f8+aDckNrItz52XlcsajQMzMuKy0Sl7iuJZcK3Xp+Da7wpBZyVW87U /tCIyDXf2JBEFNOj5T4UwsjQ/3hGJS+0u7WSC3DBhrcX2OsLDR79XJSrcRL+YJkWui7b KcoJapKm3eo+O5UABKSfle4AjxS7SavrM73jozvR8WLTGfq5j7ds6WxCaiUxBjCVr7sV v5cvjWyYkNWA/ZIK3+DldTdsK0RGCoQumSKGatp6iB8iXUgKnaZ9Ox0Q8H/F06udwtVZ S8nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692180800; x=1692785600; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=15i0sfLMjPVcYd8SRHO4kwkUn2GLQy2+NOZE3RgyjBs=; b=ZsQxAiGWYHUJjr5H+GGFxY1SQFsGSUGu7R55cbr/3zf13tVZm3X5v0HgNzHzyXNI9H sRXLQdr7FULeSuBppclCrSojCGUfTCX2l6G3rHGlgddgHjMzl7yhdnT5nn7s3u5pjpK6 79Y5Pm4jXaqJg0/CEJ9S5isKYvhqI2h9NRyG/Lqq5wMLyH7hQIdHWDGnjqaWg9nxrDwp cJkKC0Uo+ymC9zBR3WIYPoH52aNkPwXM1WWBHgemTwgk2Wg/gSZAhDDsSzhf8FVNIpFh 5DjrKiGkAP4Ad3NadDuy81bqI1xDwGb+oK0v916ntwRrSawNnDRKjJ3U7SkaWiou48mW qY7A== X-Gm-Message-State: AOJu0YxEsJTgwg5PfSRgyJYTQblIQ0t+IVq+T1uyl/Ndai1mKxnkImgy AQKk33DOSxTO6PmV08EX0M/HgkBJxT2Yvu9VG+k= X-Google-Smtp-Source: AGHT+IFwIsGLaARe2CLttgE6sSRrHJ0nMoRlwu5EgDpvRpg9VR5eWjhr5aDIFgH8WhAqYOhnw3KxRNxwr9BPuthSMQA= X-Received: by 2002:a05:6102:396:b0:447:6853:5d3c with SMTP id m22-20020a056102039600b0044768535d3cmr1049849vsq.20.1692180800057; Wed, 16 Aug 2023 03:13:20 -0700 (PDT) MIME-Version: 1.0 References: <20230816071810.1796-1-vipin.varghese@amd.com> <20230816094216.1847-1-vipin.varghese@amd.com> In-Reply-To: <20230816094216.1847-1-vipin.varghese@amd.com> From: Jerin Jacob Date: Wed, 16 Aug 2023 15:42:54 +0530 Message-ID: Subject: Re: [PATCH v2] app/dma-perf: fix physical address seg-fault To: Vipin Varghese Cc: thomas@monjalon.net, dev@dpdk.org, anoobj@marvell.com, Ferruh.Yigit@amd.com, cheng1.jiang@intel.com, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Wed, Aug 16, 2023 at 3:21=E2=80=AFPM Vipin Varghese wrote: > > do_cpu_mem_copy uses DPDK API rte_mbuf_data_iova to return > the start of the virtual address for both src and dst. > But in case of iova mode set as PA, this results in seg-fault. > This is because rte_memcpy uses VA address and not PA. > > This fix invokes `rte_pktmbuf_mtod` for both src and dst. > > Bugzilla ID: 1269 > Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test") > Cc: cheng1.jiang@intel.com > > Cc: stable@dpdk.org > > Signed-off-by: Vipin Varghese > Suggested-by: Anoob Joseph > --- > > v2: > - suggest use of pktmbuf_mtod for both va and pa. > > tested for both va and pa > > CMD: > PA: dpdk-test-dma-perf --iova-mode=3Dpa -- --config test.ini > VA: dpdk-test-dma-perf --iova-mode=3Dva -- --config test.ini > DC: dpdk-test-dma-perf --iova-mode=3Ddc -- --config test.ini > > Log: fails for dc mode `EAL: invalid parameters for --iova-mode` > > test.ini: > ``` > [case1] > type=3DCPU_MEM_COPY > mem_size=3D10 > buf_size=3D64,8192,2,MUL > src_numa_node=3D0 > dst_numa_node=3D0 > cache_flush=3D0 > test_seconds=3D2 > lcore =3D 7 > eal_args=3D--in-memory --no-pci > ``` > --- > app/test-dma-perf/benchmark.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.= c > index 0601e0d171..1d1c9bde99 100644 > --- a/app/test-dma-perf/benchmark.c > +++ b/app/test-dma-perf/benchmark.c > @@ -288,10 +288,11 @@ do_cpu_mem_copy(void *p) > > while (1) { > for (i =3D 0; i < nr_buf; i++) { > + void *src =3D rte_pktmbuf_mtod(dsts[i], void *); > + void *dst =3D rte_pktmbuf_mtod(srcs[i], void *); Use _const_ in fast path if src and dst in not changing as better optimization hint to compiler.