aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_bpf.c
diff options
context:
space:
mode:
authorDavid Howells <[email protected]>2023-06-23 22:54:58 +0000
committerJakub Kicinski <[email protected]>2023-06-24 22:50:12 +0000
commitf8dd95b29d7ef08c19ec9720564acf72243ddcf6 (patch)
tree5abb4a2d6b7e8dd36665f83e90e043b0907f833e /net/ipv4/tcp_bpf.c
parentMerge tag 'mlx5-updates-2023-06-21' of git://git.kernel.org/pub/scm/linux/ker... (diff)
downloadkernel-f8dd95b29d7ef08c19ec9720564acf72243ddcf6.tar.gz
kernel-f8dd95b29d7ef08c19ec9720564acf72243ddcf6.zip
tcp_bpf, smc, tls, espintcp, siw: Reduce MSG_SENDPAGE_NOTLAST usage
As MSG_SENDPAGE_NOTLAST is being phased out along with sendpage(), don't use it further in than the sendpage methods, but rather translate it to MSG_MORE and use that instead. Signed-off-by: David Howells <[email protected]> cc: Willem de Bruijn <[email protected]> cc: Bernard Metzler <[email protected]> cc: Jason Gunthorpe <[email protected]> cc: Leon Romanovsky <[email protected]> cc: John Fastabend <[email protected]> cc: Jakub Sitnicki <[email protected]> cc: David Ahern <[email protected]> cc: Karsten Graul <[email protected]> cc: Wenjia Zhang <[email protected]> cc: Jan Karcher <[email protected]> cc: "D. Wythe" <[email protected]> cc: Tony Lu <[email protected]> cc: Wen Gu <[email protected]> cc: Boris Pismenny <[email protected]> cc: Steffen Klassert <[email protected]> cc: Herbert Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_bpf.c')
-rw-r--r--net/ipv4/tcp_bpf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c
index 5a84053ac62b..31d6005cea9b 100644
--- a/net/ipv4/tcp_bpf.c
+++ b/net/ipv4/tcp_bpf.c
@@ -88,9 +88,9 @@ static int bpf_tcp_ingress(struct sock *sk, struct sk_psock *psock,
static int tcp_bpf_push(struct sock *sk, struct sk_msg *msg, u32 apply_bytes,
int flags, bool uncharge)
{
+ struct msghdr msghdr = {};
bool apply = apply_bytes;
struct scatterlist *sge;
- struct msghdr msghdr = { .msg_flags = flags | MSG_SPLICE_PAGES, };
struct page *page;
int size, ret = 0;
u32 off;
@@ -107,11 +107,12 @@ static int tcp_bpf_push(struct sock *sk, struct sk_msg *msg, u32 apply_bytes,
tcp_rate_check_app_limited(sk);
retry:
+ msghdr.msg_flags = flags | MSG_SPLICE_PAGES;
has_tx_ulp = tls_sw_has_ctx_tx(sk);
if (has_tx_ulp)
msghdr.msg_flags |= MSG_SENDPAGE_NOPOLICY;
- if (flags & MSG_SENDPAGE_NOTLAST)
+ if (size < sge->length && msg->sg.start != msg->sg.end)
msghdr.msg_flags |= MSG_MORE;
bvec_set_page(&bvec, page, size, off);