ip xfrm: Add xfrm state crypto offload
Subsystems (2)
PATCH 1/1 ip xfrm: Add xfrm state crypto offload
From: Boris Pismenny <[email protected]>
syntax:
ip xfrm state .... offload dev <if-name> dir <in or out>
Example to add inbound offload:
ip xfrm state .... offload dev mlx0 dir in
Example to add outbound offload:
ip xfrm state .... offload dev mlx0 dir out
Signed-off-by Boris Pismenny <[email protected]>
Signed-off-by Ilan Tayari <[email protected]>
--- ip/ipxfrm.c | 19 +++++++++++++++++++ ip/xfrm_state.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+)
ip/ipxfrm.c +19 -0
@@ -862,6 +862,25 @@ void xfrm_xfrma_print(struct rtattr *tb[], __u16 family, }fprintf (fp,"%s" , _SL_); } +if (tb[XFRMA_OFFLOAD_DEV ]) { +struct xfrm_user_offload *xuo; + +if (prefix) +fputs (prefix, fp); +fprintf (fp,"crypto offload parameters: " ); + +if (RTA_PAYLOAD (tb[XFRMA_OFFLOAD_DEV ]) <sizeof (*xuo)) { +fprintf (fp,"(ERROR truncated)" ); +fprintf (fp,"%s" , _SL_); +return ; + } + + xuo = (struct xfrm_user_offload *) +RTA_DATA (tb[XFRMA_OFFLOAD_DEV ]); +fprintf (fp,"dev %s dir %s" ,ll_index_to_name (xuo->ifindex), + (xuo->flags &XFRM_OFFLOAD_INBOUND ) ?"in" :"out" ); +fprintf (fp,"%s" , _SL_); + } }static int xfrm_selector_iszero (struct xfrm_selector *s)
ip/xfrm_state.c +49 -0
85 lines not on this page · raw message
Signature · 1 line
2.11.0
Stephen Hemminger
AppliedQuoted 5 lines · On Sun, 30 Apr 2017 17:16:02 +0300 <[email protected]> wrote:
From: Boris Pismenny <[email protected]>
syntax:
ip xfrm state .... offload dev <if-name> dir <in or out>
Quoted 7 lines
Example to add inbound offload:
ip xfrm state .... offload dev mlx0 dir in
Example to add outbound offload:
ip xfrm state .... offload dev mlx0 dir outSigned-off-by Boris Pismenny <[email protected]>Signed-off-by Ilan Tayari <[email protected]>
Applied to net-next