Commit 7ccd4519 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

net/tls: unref frags in order

It's generally more cache friendly to walk arrays in order,
especially those which are likely not in cache.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarDirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fcd8c627
......@@ -122,13 +122,10 @@ static struct net_device *get_netdev_for_sock(struct sock *sk)
static void destroy_record(struct tls_record_info *record)
{
int nr_frags = record->num_frags;
skb_frag_t *frag;
int i;
while (nr_frags-- > 0) {
frag = &record->frags[nr_frags];
__skb_frag_unref(frag);
}
for (i = 0; i < record->num_frags; i++)
__skb_frag_unref(&record->frags[i]);
kfree(record);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment