patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Varghese, Vipin" <Vipin.Varghese@amd.com>
To: "Jiang, Cheng1" <cheng1.jiang@intel.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"anoobj@marvell.com" <anoobj@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>
Cc: "Yigit, Ferruh" <Ferruh.Yigit@amd.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v2] app/dma-perf: fix physical address seg-fault
Date: Wed, 4 Oct 2023 09:00:50 +0000	[thread overview]
Message-ID: <MN2PR12MB3085D5B8B0DB13CC9AE58AA482CBA@MN2PR12MB3085.namprd12.prod.outlook.com> (raw)
In-Reply-To: <SN7PR11MB701965547C8FFE5EA17E1442DCF8A@SN7PR11MB7019.namprd11.prod.outlook.com>

[AMD Official Use Only - General]

Hi Jerrin,

Apologies for the delay, I missed on the comment

```
>                 for (i = 0; i < nr_buf; i++) {
> +                       void *src = rte_pktmbuf_mtod(dsts[i], void *);
> +                       void *dst = rte_pktmbuf_mtod(srcs[i], void *);

Use _const_ in fast path if src and dst in not changing as better optimization hint to compiler.
```

Thanks for the suggestion, but may I ask this differently `rte_memcpy` is defined with `always_inline` and all places where src used is with `const *`. Hence I have different view there as `setting const * for always_inline definition has the same effect too`.


> -----Original Message-----
> From: Jiang, Cheng1 <cheng1.jiang@intel.com>
> Sent: Thursday, September 21, 2023 7:58 AM
> To: Varghese, Vipin <Vipin.Varghese@amd.com>; thomas@monjalon.net;
> dev@dpdk.org; anoobj@marvell.com
> Cc: Yigit, Ferruh <Ferruh.Yigit@amd.com>; stable@dpdk.org
> Subject: RE: [PATCH v2] app/dma-perf: fix physical address seg-fault
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi,
>
> > -----Original Message-----
> > From: Vipin Varghese <vipin.varghese@amd.com>
> > Sent: Wednesday, August 16, 2023 5:42 PM
> > To: thomas@monjalon.net; dev@dpdk.org; anoobj@marvell.com
> > Cc: Ferruh.Yigit@amd.com; Jiang, Cheng1 <cheng1.jiang@intel.com>;
> > stable@dpdk.org
> > Subject: [PATCH v2] app/dma-perf: fix physical address seg-fault
> >
> > 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 <vipin.varghese@amd.com>
> > Suggested-by: Anoob Joseph <anoobj@marvell.com>
> > ---
> >
> > 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=pa  -- --config test.ini
> > VA: dpdk-test-dma-perf --iova-mode=va  -- --config test.ini
> > DC: dpdk-test-dma-perf --iova-mode=dc  -- --config test.ini
> >
> > Log: fails for dc mode `EAL: invalid parameters for --iova-mode`
> >
> > test.ini:
> > ```
> > [case1]
> > type=CPU_MEM_COPY
> > mem_size=10
> > buf_size=64,8192,2,MUL
> > src_numa_node=0
> > dst_numa_node=0
> > cache_flush=0
> > test_seconds=2
> > lcore = 7
> > eal_args=--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 = 0; i < nr_buf; i++) {
> > +                     void *src = rte_pktmbuf_mtod(dsts[i], void *);
> > +                     void *dst = rte_pktmbuf_mtod(srcs[i], void *);
> > +
>
> Thank you for fixing it.
> Sorry that I missed the discussion earlier.
>
> Reviewed-by: Cheng Jiang <cheng1.jiang@intel.com>
>
> Thanks,
> Cheng

  reply	other threads:[~2023-10-04  9:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16  7:18 [PATCH] " Vipin Varghese
2023-08-16  7:26 ` [EXT] " Anoob Joseph
2023-08-16  7:31   ` Varghese, Vipin
2023-08-16  9:24 ` [PATCH v2] " Vipin Varghese
2023-08-16  9:35 ` Vipin Varghese
2023-08-16  9:42 ` Vipin Varghese
2023-08-16 10:12   ` Jerin Jacob
2023-08-16 10:46   ` [EXT] " Anoob Joseph
2023-09-21  2:28   ` Jiang, Cheng1
2023-10-04  9:00     ` Varghese, Vipin [this message]
2023-10-04 13:00       ` Jerin Jacob
2023-10-19  4:19   ` [PATCH v3] " Vipin Varghese
2023-10-24  2:16     ` lihuisong (C)
2023-11-14 14:27       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR12MB3085D5B8B0DB13CC9AE58AA482CBA@MN2PR12MB3085.namprd12.prod.outlook.com \
    --to=vipin.varghese@amd.com \
    --cc=Ferruh.Yigit@amd.com \
    --cc=anoobj@marvell.com \
    --cc=cheng1.jiang@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).