Thread (28 messages) 28 messages, 3 authors, 2023-06-20

Re: [PATCH net-next v2 17/17] net: Kill MSG_SENDPAGE_NOTLAST

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2023-06-20 12:59:28
Also in: bpf, linux-arm-msm, linux-can, linux-crypto, linux-doc, linux-hams, linux-mm, linux-perf-users, linux-rdma, linux-sctp, lkml, mptcp, virtualization

David Howells wrote:
Willem de Bruijn [off-list ref] wrote:
quoted
Is it intentional to add MSG_MORE here in this patch?

I do see that patch 3 removes this branch:
Yeah.  I think I may have tcp_bpf a bit wrong with regard to handling
MSG_MORE.

How about the attached version of tcp_bpf_push()?

I wonder if it's save to move the setting of MSG_SENDPAGE_NOPOLICY out of the
loop as I've done here.  The caller holds the socket lock.

Also, I'm not sure whether to take account of apply/apply_bytes when setting
MSG_MORE mid-message, or whether to just go on whether we've reached
sge->length yet.  (I'm not sure exactly how tcp_bpf works).
I'm not very familiar with it either.

Instead of inferring whether MSG_MORE is safe to set, as below, sufficient to
rely on the caller to pass it when appropriate?

size = min(apply_bytes, sge->length). I doubt that size < apply_bytes is
ever intended.

And instead of this former branch

                if (flags & MSG_SENDPAGE_NOTLAST)
                        msghdr.msg_flags |= MSG_MORE;

update any caller to pass MSG_MORE instead of MSG_SENDPAGE_NOTLAST, if not yet
done so.
		msghdr.msg_flags = flags;

		/* Determine if we need to set MSG_MORE. */
		if (!(msghdr.msg_flags & MSG_MORE)) {
			if (apply && size < apply_bytes)
				msghdr.msg_flags |= MSG_MORE;
			else if (!apply && size < sge->length &&
				 msg->sg.start != msg->sg.end)
				msghdr.msg_flags |= MSG_MORE;
		}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help