skmsg: Get rid of unncessary memset()
authorCong Wang <cong.wang@bytedance.com>
Wed, 15 Jun 2022 16:20:14 +0000 (09:20 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 20 Jun 2022 12:05:52 +0000 (14:05 +0200)
commit43312915b5ba20741617dd2119e835205fa8580c
treec3daaabf7cde52b9bae1a1218e37b6af0c5b5d2a
parent57452d767feaeab405de3bff0d240c3ac84bfe0d
skmsg: Get rid of unncessary memset()

We always allocate skmsg with kzalloc(), so there is no need
to call memset(0) on it, the only thing we need from
sk_msg_init() is sg_init_marker(). So introduce a new helper
which is just kzalloc()+sg_init_marker(), this saves an
unncessary memset(0) for skmsg on fast path.

Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20220615162014.89193-5-xiyou.wangcong@gmail.com
net/core/skmsg.c