public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Name the RQF flags enum
@ 2025-03-06 16:27 Breno Leitao
  2025-03-07  0:51 ` Jens Axboe
  2025-03-13 22:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Breno Leitao @ 2025-03-06 16:27 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, linux-kernel, bpf, kernel-team, Yonghong Song,
	Breno Leitao

Commit 5f89154e8e9e3445f9b59 ("block: Use enum to define RQF_x bit
indexes") converted the RQF flags to an anonymous enum, which was
a beneficial change. This patch goes one step further by naming the enum
as "rqf_flags".

This naming enables exporting these flags to BPF clients, eliminating
the need to duplicate these flags in BPF code. Instead, BPF clients can
now access the same kernel-side values through CO:RE (Compile Once, Run
Everywhere), as shown in this example:

    rqf_stats = bpf_core_enum_value(enum rqf_flags, __RQF_STATS)

Suggested-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 include/linux/blk-mq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index fa2a76cc2f73d..71f4f0cc3dac6 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -28,7 +28,7 @@ typedef enum rq_end_io_ret (rq_end_io_fn)(struct request *, blk_status_t);
 typedef __u32 __bitwise req_flags_t;
 
 /* Keep rqf_name[] in sync with the definitions below */
-enum {
+enum rqf_flags {
 	/* drive already may have started this one */
 	__RQF_STARTED,
 	/* request for flush sequence */

---
base-commit: c42048cee22435a6ea0de68cc02231cf359ca8b2
change-id: 20250306-rqf_flags-9adba1d2be2f

Best regards,
-- 
Breno Leitao <leitao@debian.org>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: Name the RQF flags enum
  2025-03-06 16:27 [PATCH] block: Name the RQF flags enum Breno Leitao
@ 2025-03-07  0:51 ` Jens Axboe
  2025-03-13 22:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2025-03-07  0:51 UTC (permalink / raw)
  To: Breno Leitao; +Cc: linux-block, linux-kernel, bpf, kernel-team, Yonghong Song


On Thu, 06 Mar 2025 08:27:51 -0800, Breno Leitao wrote:
> Commit 5f89154e8e9e3445f9b59 ("block: Use enum to define RQF_x bit
> indexes") converted the RQF flags to an anonymous enum, which was
> a beneficial change. This patch goes one step further by naming the enum
> as "rqf_flags".
> 
> This naming enables exporting these flags to BPF clients, eliminating
> the need to duplicate these flags in BPF code. Instead, BPF clients can
> now access the same kernel-side values through CO:RE (Compile Once, Run
> Everywhere), as shown in this example:
> 
> [...]

Applied, thanks!

[1/1] block: Name the RQF flags enum
      commit: e7112524e5e885181cc5ae4d258f33b9dbe0b907

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: Name the RQF flags enum
  2025-03-06 16:27 [PATCH] block: Name the RQF flags enum Breno Leitao
  2025-03-07  0:51 ` Jens Axboe
@ 2025-03-13 22:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-03-13 22:00 UTC (permalink / raw)
  To: Breno Leitao
  Cc: axboe, linux-block, linux-kernel, bpf, kernel-team, yonghong.song

Hello:

This patch was applied to netdev/net.git (main)
by Jens Axboe <axboe@kernel.dk>:

On Thu, 06 Mar 2025 08:27:51 -0800 you wrote:
> Commit 5f89154e8e9e3445f9b59 ("block: Use enum to define RQF_x bit
> indexes") converted the RQF flags to an anonymous enum, which was
> a beneficial change. This patch goes one step further by naming the enum
> as "rqf_flags".
> 
> This naming enables exporting these flags to BPF clients, eliminating
> the need to duplicate these flags in BPF code. Instead, BPF clients can
> now access the same kernel-side values through CO:RE (Compile Once, Run
> Everywhere), as shown in this example:
> 
> [...]

Here is the summary with links:
  - block: Name the RQF flags enum
    https://git.kernel.org/netdev/net/c/e7112524e5e8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-13 22:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-06 16:27 [PATCH] block: Name the RQF flags enum Breno Leitao
2025-03-07  0:51 ` Jens Axboe
2025-03-13 22:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox