* [PATCH net-next] sctp: Simplify the allocation of slab caches
@ 2024-01-31 8:45 Kunwu Chan
2024-01-31 9:28 ` Jiri Pirko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Kunwu Chan @ 2024-01-31 8:45 UTC (permalink / raw)
To: marcelo.leitner, lucien.xin, davem, edumazet, kuba, pabeni
Cc: linux-sctp, netdev, linux-kernel, Kunwu Chan
commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation")
introduces a new macro.
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
net/sctp/protocol.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 94c6dd53cd62..e849f368ed91 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1495,17 +1495,11 @@ static __init int sctp_init(void)
/* Allocate bind_bucket and chunk caches. */
status = -ENOBUFS;
- sctp_bucket_cachep = kmem_cache_create("sctp_bind_bucket",
- sizeof(struct sctp_bind_bucket),
- 0, SLAB_HWCACHE_ALIGN,
- NULL);
+ sctp_bucket_cachep = KMEM_CACHE(sctp_bind_bucket, SLAB_HWCACHE_ALIGN);
if (!sctp_bucket_cachep)
goto out;
- sctp_chunk_cachep = kmem_cache_create("sctp_chunk",
- sizeof(struct sctp_chunk),
- 0, SLAB_HWCACHE_ALIGN,
- NULL);
+ sctp_chunk_cachep = KMEM_CACHE(sctp_chunk, SLAB_HWCACHE_ALIGN);
if (!sctp_chunk_cachep)
goto err_chunk_cachep;
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] sctp: Simplify the allocation of slab caches
2024-01-31 8:45 [PATCH net-next] sctp: Simplify the allocation of slab caches Kunwu Chan
@ 2024-01-31 9:28 ` Jiri Pirko
2024-02-01 1:12 ` Xin Long
2024-02-02 12:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2024-01-31 9:28 UTC (permalink / raw)
To: Kunwu Chan
Cc: marcelo.leitner, lucien.xin, davem, edumazet, kuba, pabeni,
linux-sctp, netdev, linux-kernel
Wed, Jan 31, 2024 at 09:45:49AM CET, chentao@kylinos.cn wrote:
>commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation")
>introduces a new macro.
>Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
>to simplify the creation of SLAB caches.
>
>Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] sctp: Simplify the allocation of slab caches
2024-01-31 8:45 [PATCH net-next] sctp: Simplify the allocation of slab caches Kunwu Chan
2024-01-31 9:28 ` Jiri Pirko
@ 2024-02-01 1:12 ` Xin Long
2024-02-02 12:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Xin Long @ 2024-02-01 1:12 UTC (permalink / raw)
To: Kunwu Chan
Cc: marcelo.leitner, davem, edumazet, kuba, pabeni, linux-sctp,
netdev, linux-kernel
On Wed, Jan 31, 2024 at 3:46 AM Kunwu Chan <chentao@kylinos.cn> wrote:
>
> commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation")
> introduces a new macro.
> Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
> to simplify the creation of SLAB caches.
>
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Acked-by: Xin Long <lucien.xin@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] sctp: Simplify the allocation of slab caches
2024-01-31 8:45 [PATCH net-next] sctp: Simplify the allocation of slab caches Kunwu Chan
2024-01-31 9:28 ` Jiri Pirko
2024-02-01 1:12 ` Xin Long
@ 2024-02-02 12:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-02 12:20 UTC (permalink / raw)
To: Kunwu Chan
Cc: marcelo.leitner, lucien.xin, davem, edumazet, kuba, pabeni,
linux-sctp, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Wed, 31 Jan 2024 16:45:49 +0800 you wrote:
> commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation")
> introduces a new macro.
> Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
> to simplify the creation of SLAB caches.
>
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
>
> [...]
Here is the summary with links:
- [net-next] sctp: Simplify the allocation of slab caches
https://git.kernel.org/netdev/net-next/c/fa33b35f86b8
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] 4+ messages in thread
end of thread, other threads:[~2024-02-02 12:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31 8:45 [PATCH net-next] sctp: Simplify the allocation of slab caches Kunwu Chan
2024-01-31 9:28 ` Jiri Pirko
2024-02-01 1:12 ` Xin Long
2024-02-02 12:20 ` 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