diff options
| author | Tung Nguyen <[email protected]> | 2018-06-28 20:25:04 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2018-06-30 11:48:16 +0000 |
| commit | ef9be755697f1b841c2a219a05df1a72ccd6f471 (patch) | |
| tree | df97059feff846ba6f30769f9096a90b4c2b29b5 /net/tipc/node.c | |
| parent | net: usb: Mark expected switch fall-throughs (diff) | |
| download | kernel-ef9be755697f1b841c2a219a05df1a72ccd6f471.tar.gz kernel-ef9be755697f1b841c2a219a05df1a72ccd6f471.zip | |
tipc: eliminate buffer cloning in function tipc_msg_extract()
The function tipc_msg_extract() is using skb_clone() to clone inner
messages from a message bundle buffer. Although this method is safe,
it has an undesired effect that each buffer clone inherits the
true-size of the bundling buffer. As a result, the buffer clone
almost always ends up with being copied anyway by the message
validation function. This makes the cloning into a sub-optimization.
In this commit we take the consequence of this realization, and copy
each inner message to a separately allocated buffer up front in the
extraction function.
As a bonus we can now eliminate the two cases where we had to copy
re-routed packets that may potentially go out on the wire again.
Signed-off-by: Tung Nguyen <[email protected]>
Signed-off-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/tipc/node.c')
0 files changed, 0 insertions, 0 deletions
