android_kernel_motorola_sm6225/net/sctp
Xin Long 9a84bb1381 sctp: implement memory accounting on tx path
[ Upstream commit 1033990ac5b2ab6cee93734cb6d301aa3a35bcaa ]

Now when sending packets, sk_mem_charge() and sk_mem_uncharge() have been
used to set sk_forward_alloc. We just need to call sk_wmem_schedule() to
check if the allocated should be raised, and call sk_mem_reclaim() to
check if the allocated should be reduced when it's under memory pressure.

If sk_wmem_schedule() returns false, which means no memory is allowed to
allocate, it will block and wait for memory to become available.

Note different from tcp, sctp wait_for_buf happens before allocating any
skb, so memory accounting check is done with the whole msg_len before it
too.

Reported-by: Matteo Croce <mcroce@redhat.com>
Tested-by: Matteo Croce <mcroce@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-05 10:06:00 +02:00
..
associola.c sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket 2020-06-30 23:17:05 -04:00
auth.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
bind_addr.c sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket 2020-06-30 23:17:05 -04:00
chunk.c sctp: frag_point sanity check 2019-12-13 08:52:29 +01:00
debug.c
diag.c inet_diag: return classid for all socket types 2020-03-18 07:14:11 +01:00
endpointola.c sctp: cache netns in sctp_ep_common 2019-12-05 09:21:32 +01:00
input.c sctp: add chunks to sk_backlog when the newsk sk_socket is not set 2020-01-27 14:51:17 +01:00
inqueue.c sctp: fix the issue that the cookie-ack with auth can't get processed 2018-05-02 11:15:33 -04:00
ipv6.c net: ipv6: add net argument to ip6_dst_lookup_flow 2020-04-29 16:31:16 +02:00
Kconfig sctp: whitespace fixes 2018-07-24 14:10:42 -07:00
Makefile
objcnt.c proc: introduce proc_create_seq{,_data} 2018-05-16 07:23:35 +02:00
offload.c sctp: call gso_reset_checksum when computing checksum in sctp_gso_segment 2019-02-27 10:08:58 +01:00
output.c sctp: increase sk_wmem_alloc when head->truesize is increased 2019-12-13 08:52:00 +01:00
outqueue.c sctp: define SCTP_SS_DEFAULT for Stream schedulers 2018-11-23 08:17:06 +01:00
primitive.c
proc.c sctp: remove useless start_fail from sctp_ht_iter in proc 2018-08-27 15:13:17 -07:00
protocol.c sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket 2020-06-30 23:17:05 -04:00
sm_make_chunk.c sctp: Fix SHUTDOWN CTSN Ack in the peer restart case 2020-05-10 10:30:10 +02:00
sm_sideeffect.c sctp: Don't add the shutdown timer if its already been added 2020-06-03 08:19:21 +02:00
sm_statefuns.c sctp: Start shutdown on association restart if in SHUTDOWN-SENT state and socket is closed 2020-06-03 08:19:23 +02:00
sm_statetable.c
socket.c sctp: implement memory accounting on tx path 2020-08-05 10:06:00 +02:00
stream.c sctp: shrink stream outq when fails to do addstream reconf 2020-07-31 18:37:48 +02:00
stream_interleave.c net/sctp: Make wrappers for accessing in/out streams 2018-08-11 12:25:15 -07:00
stream_sched.c net/sctp: Make wrappers for accessing in/out streams 2018-08-11 12:25:15 -07:00
stream_sched_prio.c net/sctp: Make wrappers for accessing in/out streams 2018-08-11 12:25:15 -07:00
stream_sched_rr.c net/sctp: Make wrappers for accessing in/out streams 2018-08-11 12:25:15 -07:00
sysctl.c
transport.c net: add bool confirm_neigh parameter for dst_ops.update_pmtu 2020-01-04 19:13:37 +01:00
tsnmap.c
ulpevent.c sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg 2018-05-10 17:48:36 -04:00
ulpqueue.c