Re: [PATCH net-next v4 03/15] ceph: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage

From: Jakub Kicinski
Date: Fri Jun 23 2023 - 13:00:48 EST


On Fri, 23 Jun 2023 12:44:13 +0100 David Howells wrote:
> @@ -494,9 +466,12 @@ static int write_partial_message_data(struct ceph_connection *con)
>
> page = ceph_msg_data_next(cursor, &page_offset, &length);
> if (length == cursor->total_resid)
> - more = MSG_MORE;
> - ret = ceph_tcp_sendpage(con->sock, page, page_offset, length,
> - more);
> + msghdr.msg_flags |= MSG_MORE;

Should the condition also be flipped here, like you did below?
(can be a follow up if so)

> @@ -534,9 +512,11 @@ static int write_partial_skip(struct ceph_connection *con)
> size_t size = min(con->v1.out_skip, (int)PAGE_SIZE);
>
> if (size == con->v1.out_skip)
> - more = MSG_MORE;
> - ret = ceph_tcp_sendpage(con->sock, ceph_zero_page, 0, size,
> - more);
> + msghdr.msg_flags &= ~MSG_MORE;
> + bvec_set_page(&bvec, ZERO_PAGE(0), size, 0);
> + iov_iter_bvec(&msghdr.msg_iter, ITER_SOURCE, &bvec, 1, size);