Skip to content

Commit

Permalink
net: Kill MSG_SENDPAGE_NOTLAST
Browse files Browse the repository at this point in the history
Now that ->sendpage() has been removed, MSG_SENDPAGE_NOTLAST can be cleaned
up.  Things were converted to use MSG_MORE instead, but the protocol
sendpage stubs still convert MSG_SENDPAGE_NOTLAST to MSG_MORE, which is now
unnecessary.

Signed-off-by: David Howells <[email protected]>
cc: Jens Axboe <[email protected]>
cc: Matthew Wilcox <[email protected]>
cc: [email protected]
cc: [email protected]
cc: [email protected]
cc: [email protected]
cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
dhowells authored and kuba-moo committed Jun 24, 2023
1 parent dc97391 commit b848b26
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 12 deletions.
4 changes: 1 addition & 3 deletions include/linux/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ struct ucred {
#define MSG_MORE 0x8000 /* Sender will send more */
#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */
#define MSG_SENDPAGE_NOPOLICY 0x10000 /* sendpage() internal : do no apply policy */
#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
#define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */
#define MSG_EOF MSG_FIN
#define MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal : page frags are not shared */
Expand All @@ -341,8 +340,7 @@ struct ucred {

/* Flags to be cleared on entry by sendmsg and sendmmsg syscalls */
#define MSG_INTERNAL_SENDMSG_FLAGS \
(MSG_SPLICE_PAGES | MSG_SENDPAGE_NOPOLICY | MSG_SENDPAGE_NOTLAST | \
MSG_SENDPAGE_DECRYPTED)
(MSG_SPLICE_PAGES | MSG_SENDPAGE_NOPOLICY | MSG_SENDPAGE_DECRYPTED)

/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
#define SOL_IP 0
Expand Down
3 changes: 1 addition & 2 deletions net/tls/tls_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,7 @@ static int tls_push_data(struct sock *sk,
long timeo;

if (flags &
~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SENDPAGE_NOTLAST |
MSG_SPLICE_PAGES))
~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SPLICE_PAGES))
return -EOPNOTSUPP;

if (unlikely(sk->sk_err))
Expand Down
2 changes: 1 addition & 1 deletion net/tls/tls_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int tls_push_sg(struct sock *sk,
{
struct bio_vec bvec;
struct msghdr msg = {
.msg_flags = MSG_SENDPAGE_NOTLAST | MSG_SPLICE_PAGES | flags,
.msg_flags = MSG_SPLICE_PAGES | flags,
};
int ret = 0;
struct page *p;
Expand Down
2 changes: 1 addition & 1 deletion net/tls/tls_sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)

if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
MSG_CMSG_COMPAT | MSG_SPLICE_PAGES |
MSG_SENDPAGE_NOTLAST | MSG_SENDPAGE_NOPOLICY))
MSG_SENDPAGE_NOPOLICY))
return -EOPNOTSUPP;

ret = mutex_lock_interruptible(&tls_ctx->tx_lock);
Expand Down
1 change: 0 additions & 1 deletion tools/perf/trace/beauty/include/linux/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ struct ucred {
#define MSG_MORE 0x8000 /* Sender will send more */
#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */
#define MSG_SENDPAGE_NOPOLICY 0x10000 /* sendpage() internal : do no apply policy */
#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
#define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */
#define MSG_EOF MSG_FIN
#define MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal : page frags are not shared */
Expand Down
5 changes: 1 addition & 4 deletions tools/perf/trace/beauty/msg_flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
#ifndef MSG_WAITFORONE
#define MSG_WAITFORONE 0x10000
#endif
#ifndef MSG_SENDPAGE_NOTLAST
#define MSG_SENDPAGE_NOTLAST 0x20000
#endif
#ifndef MSG_FASTOPEN
#define MSG_FASTOPEN 0x20000000
#endif
Expand Down Expand Up @@ -50,7 +47,7 @@ static size_t syscall_arg__scnprintf_msg_flags(char *bf, size_t size,
P_MSG_FLAG(NOSIGNAL);
P_MSG_FLAG(MORE);
P_MSG_FLAG(WAITFORONE);
P_MSG_FLAG(SENDPAGE_NOTLAST);
P_MSG_FLAG(SPLICE_PAGES);
P_MSG_FLAG(FASTOPEN);
P_MSG_FLAG(CMSG_CLOEXEC);
#undef P_MSG_FLAG
Expand Down

0 comments on commit b848b26

Please sign in to comment.