1
0

616-net_optimize_xfrm_calls.patch 553 B

1234567891011121314151617181920
  1. From: Felix Fietkau <nbd@nbd.name>
  2. Subject: kernel: add a small xfrm related performance optimization
  3. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  4. ---
  5. net/netfilter/nf_nat_core.c | 3 +++
  6. 1 file changed, 3 insertions(+)
  7. --- a/net/netfilter/nf_nat_core.c
  8. +++ b/net/netfilter/nf_nat_core.c
  9. @@ -93,6 +93,9 @@ int nf_xfrm_me_harder(struct net *net, s
  10. struct dst_entry *dst;
  11. int err;
  12. + if (skb->dev && !dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT])
  13. + return 0;
  14. +
  15. err = xfrm_decode_session(skb, &fl, family);
  16. if (err < 0)
  17. return err;