Skip to content

xfrm: remove xfrm replay indirections

Florian Westphal netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/25 patches 1 replyIn review
  2. v2 posting 1/26 patches 2 repliesSuperseded
  3. v16 patches 0 repliesSuperseded

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5xfrm: replay: avoid xfrm replay notify indirectioninclude/net/xfrm.h net/xfrm/xfrm_replay.c net/xfrm/xfrm_state.c+39 -190 replies
2/5xfrm: replay: remove advance indirectioninclude/net/xfrm.h net/xfrm/xfrm_input.c net/xfrm/xfrm_replay.c+17 -110 replies
3/5xfrm: replay: remove recheck indirectioninclude/net/xfrm.h net/xfrm/xfrm_input.c net/xfrm/xfrm_replay.c+18 -100 replies
4/5xfrm: replay: avoid replay indirectioninclude/net/xfrm.h net/xfrm/xfrm_input.c net/xfrm/xfrm_replay.c+20 -130 replies
5/5xfrm: replay: remove last replay indirectioninclude/net/xfrm.h net/xfrm/xfrm_output.c net/xfrm/xfrm_replay.c+28 -330 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH ipsec-next v2 0/5] xfrm: remove xfrm replay indirections

This is v2 of an older patchset that got stuck in backlog hell. Changes:

- drop bogus "get rid of duplicated notification code" patch. As noted by Sabrina it does change behavior.
- fix a compiler warning in patch 2.

ipsec.c selftest passes.

The xfrm replay logic is implemented via indirect calls.

xfrm_state struct holds a pointer to a
'struct xfrm_replay', which is one of several replay protection backends.

XFRM then invokes the backend via state->repl->callback(). Due to retpoline all indirect calls have become a lot more expensive. Fortunately, there are no 'replay modules', all are available for direct calls.

This series removes the 'struct xfrm_replay' and adds replay functions that can be called instead of the redirection.

Example:
- err = x->repl->overflow(x, skb);
+ err = xfrm_replay_overflow(x, skb);

Instead of a pointer to a struct with function pointers, xfrm_state now holds an enum that tells the replay core what kind of replay test is to be done.

Florian Westphal (5):
xfrm: replay: avoid xfrm replay notify indirection
xfrm: replay: remove advance indirection
xfrm: replay: remove recheck indirection
xfrm: replay: avoid replay indirection
xfrm: replay: remove last replay indirection

 include/net/xfrm.h     |  29 ++++---
 net/xfrm/xfrm_input.c  |   6 +-
 net/xfrm/xfrm_output.c |   2 +-
 net/xfrm/xfrm_replay.c | 171 +++++++++++++++++++++++++----------------
 net/xfrm/xfrm_state.c  |   2 +-
 5 files changed, 123 insertions(+), 87 deletions(-)
Signature · 1 line
2.31.1