mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qinxin Xia <xiaqinxin@huawei.com>
To: Barry Song <21cnbao@gmail.com>
Cc: <m.szyprowski@samsung.com>, <robin.murphy@arm.com>,
	<prime.zeng@huawei.com>, <fanghao11@huawei.com>,
	<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
	<wangzhou1@hisilicon.com>
Subject: Re: [PATCH v3] tools/dma: move dma_map_benchmark from selftests to tools/dma
Date: Tue, 21 Oct 2025 13:15:57 +0800	[thread overview]
Message-ID: <47cc4984-a424-410d-a1b8-9947c1a42ccb@huawei.com> (raw)
In-Reply-To: <CAGsJ_4zF4JOPXpkzmR+invqefLstcaB=xaGEfueHEQRSg2oLOg@mail.gmail.com>



On 2025/10/21 10:59:05, Barry Song <21cnbao@gmail.com> wrote:
>> @@ -0,0 +1,2 @@
>> +# SPDX-License-Identifier: GPL-2.0-only
>> +dma_map_benchmark
>> diff --git a/tools/dma/Makefile b/tools/dma/Makefile
>> new file mode 100644
>> index 000000000000..4acbd9e00cfa
>> --- /dev/null
>> +++ b/tools/dma/Makefile
>> @@ -0,0 +1,17 @@
>> +# SPDX-License-Identifier: GPL-2.0
>> +bindir ?= /usr/bin
>> +
>> +CFLAGS += -idirafter../../include/uapi
> 
> I'm a bit confused — it seems you haven’t tried to understand what the issue
> was in v1 [1]. You were using -I for kernel header files (under
> include/linux but not uapi), which caused those kernel headers to take
> precedence over the system headers, leading to build errors. The uapi
> headers, however, are specifically designed to be installed into the system by
> the toolchain.
> So that’s no longer the case — -idirafter is not the correct flag for uapi.
> 
Hello Barry :
If I delete -idirafter, like:

CFLAGS += -I../../include/uapi

It will get warning info:

[xiaqinxin@localhost dma]$ make
cc -I../../include/uapi dma_map_benchmark.c -o dma_map_benchmark
In file included from ../../include/uapi/linux/map_benchmark.h:9,
                  from dma_map_benchmark.c:13:
../../include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use 
kernel headers from user space, see https://kernelnewbies.org/
KernelHeaders" [-Wcpp]
    10 | #warning "Attempt to use kernel headers from user space, see 
https://kernelnewbies.org/KernelHeaders"

So I keep -idirafter there.

There's another way, like:

CFLAGS += -I../../usr/include
(need make headers_install first)

Maybe I haven’t thought it through.
If you have a better way, you can give an example.:)

>> index b12f1f9babf8..5474a450863c 100644
>> --- a/tools/testing/selftests/dma/dma_map_benchmark.c
>> +++ b/tools/dma/dma_map_benchmark.c
>> @@ -10,7 +10,6 @@
>>   #include <unistd.h>
>>   #include <sys/ioctl.h>
>>   #include <sys/mman.h>
>> -#include <linux/types.h>
> 
> What’s the reason for this? Is it to work around a build error?
> If so, no — please keep it.
> 
>>   #include <linux/map_benchmark.h>
> 
> Thanks
> Barry

Moved it to map_benchmark.h, otherwise some x86_64 build errors
would occur.

  reply	other threads:[~2025-10-21  5:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21  1:17 Qinxin Xia
2025-10-21  2:59 ` Barry Song
2025-10-21  5:15   ` Qinxin Xia [this message]
2025-10-21  6:23     ` Barry Song
2025-10-21  9:13       ` Qinxin Xia
2025-10-21  9:21         ` Barry Song
2025-10-21  6:36 ` Barry Song

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=47cc4984-a424-410d-a1b8-9947c1a42ccb@huawei.com \
    --to=xiaqinxin@huawei.com \
    --cc=21cnbao@gmail.com \
    --cc=fanghao11@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=m.szyprowski@samsung.com \
    --cc=prime.zeng@huawei.com \
    --cc=robin.murphy@arm.com \
    --cc=wangzhou1@hisilicon.com \
    /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

all inboxes | Powered by JetHome®