kcm: Send multiple frags in one sendmsg()
authorDavid Howells <dhowells@redhat.com>
Fri, 9 Jun 2023 10:02:21 +0000 (11:02 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 13 Jun 2023 04:13:23 +0000 (21:13 -0700)
commitc31a25e1db486f36a0ffe3c849b0a82cda3db7db
treea250249ce571e7b36fb10842b2a098faf2d9cabd
parent264ba53fac79b03ff754bce62da5027ee3c57b8f
kcm: Send multiple frags in one sendmsg()

Rewrite the AF_KCM transmission loop to send all the fragments in a single
skb or frag_list-skb in one sendmsg() with MSG_SPLICE_PAGES set.  The list
of fragments in each skb is conveniently a bio_vec[] that can just be
attached to a BVEC iter.

Note: I'm working out the size of each fragment-skb by adding up bv_len for
all the bio_vecs in skb->frags[] - but surely this information is recorded
somewhere?  For the skbs in head->frag_list, this is equal to
skb->data_len, but not for the head.  head->data_len includes all the tail
frags too.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Tom Herbert <tom@herbertland.com>
cc: Tom Herbert <tom@quantonium.net>
cc: Jens Axboe <axboe@kernel.dk>
cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/kcm.h
net/kcm/kcmsock.c