1
linux/net/sctp
Neil Horman ed10627725 sctp: refactor sctp_packet_append_chunk and clenup some memory leaks
While doing some recent work on sctp sack bundling I noted that
sctp_packet_append_chunk was pretty inefficient.  Specifially, it was called
recursively while trying to bundle auth and sack chunks.  Because of that we
call sctp_packet_bundle_sack and sctp_packet_bundle_auth a total of 4 times for
every call to sctp_packet_append_chunk, knowing that at least 3 of those calls
will do nothing.

So lets refactor sctp_packet_bundle_auth to have an outer part that does the
attempted bundling, and an inner part that just does the chunk appends.  This
saves us several calls per iteration that we just don't need.

Also, noticed that the auth and sack bundling fail to free the chunks they
allocate if the append fails, so make sure we add that in

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Vlad Yasevich <vyasevich@gmail.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: linux-sctp@vger.kernel.org
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-08 23:56:16 -07:00
..
associola.c sctp: be more restrictive in transport selection on bundled sacks 2012-06-30 22:44:35 -07:00
auth.c sctp: better integer overflow check in sctp_auth_create_key() 2011-11-29 15:51:03 -05:00
bind_addr.c net: Remove casts of void * 2011-06-16 23:19:27 -04:00
chunk.c
command.c
debug.c sctp: remove completely unsed EMPTY state 2011-04-20 01:51:03 -07:00
endpointola.c treewide: Fix typos in various parts of the kernel, and fix some comments. 2011-12-02 14:57:31 +01:00
input.c net: add a limit parameter to sk_add_backlog() 2012-04-23 22:28:28 -04:00
inqueue.c
ipv6.c net: remove ipv6_addr_copy() 2011-11-22 16:43:32 -05:00
Kconfig
Makefile
objcnt.c
output.c sctp: refactor sctp_packet_append_chunk and clenup some memory leaks 2012-07-08 23:56:16 -07:00
outqueue.c net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
primitive.c
probe.c
proc.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
protocol.c sctp: fix warning when compiling without IPv6 2012-06-19 00:26:26 -07:00
sm_make_chunk.c sctp: be more restrictive in transport selection on bundled sacks 2012-06-30 22:44:35 -07:00
sm_sideeffect.c sctp: be more restrictive in transport selection on bundled sacks 2012-06-30 22:44:35 -07:00
sm_statefuns.c net: Convert net_ratelimit uses to net_<level>_ratelimited 2012-05-15 13:45:03 -04:00
sm_statetable.c sctp: Enforce retransmission limit during shutdown 2011-07-07 14:08:44 -07:00
socket.c net: Convert net_ratelimit uses to net_<level>_ratelimited 2012-05-15 13:45:03 -04:00
ssnmap.c
sysctl.c net: Convert all sysctl registrations to register_net_sysctl 2012-04-20 21:22:30 -04:00
transport.c sctp: be more restrictive in transport selection on bundled sacks 2012-06-30 22:44:35 -07:00
tsnmap.c sctp: be more restrictive in transport selection on bundled sacks 2012-06-30 22:44:35 -07:00
ulpevent.c sctp: be more restrictive in transport selection on bundled sacks 2012-06-30 22:44:35 -07:00
ulpqueue.c sctp: be more restrictive in transport selection on bundled sacks 2012-06-30 22:44:35 -07:00