Skip to content

Commit eb2953d

Browse files
committed
xfrm: ipcomp: Use crypto_acomp interface
Replace the legacy comperssion interface with the new acomp interface. This is the first user to make full user of the asynchronous nature of acomp by plugging into the existing xfrm resume interface. As a result of SG support by acomp, the linear scratch buffer in ipcomp can be removed. Signed-off-by: Herbert Xu <[email protected]>
1 parent 8a6771c commit eb2953d

File tree

3 files changed

+216
-240
lines changed

3 files changed

+216
-240
lines changed

include/net/ipcomp.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@
33
#define _NET_IPCOMP_H
44

55
#include <linux/skbuff.h>
6-
#include <linux/types.h>
7-
8-
#define IPCOMP_SCRATCH_SIZE 65400
9-
10-
struct crypto_comp;
11-
struct ip_comp_hdr;
12-
13-
struct ipcomp_data {
14-
u16 threshold;
15-
struct crypto_comp * __percpu *tfms;
16-
};
176

187
struct ip_comp_hdr;
19-
struct sk_buff;
8+
struct netlink_ext_ack;
209
struct xfrm_state;
2110

2211
int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb);

net/xfrm/xfrm_algo.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* Copyright (c) 2002 James Morris <[email protected]>
66
*/
77

8+
#include <crypto/acompress.h>
89
#include <crypto/aead.h>
910
#include <crypto/hash.h>
1011
#include <crypto/skcipher.h>
1112
#include <linux/module.h>
1213
#include <linux/kernel.h>
1314
#include <linux/pfkeyv2.h>
14-
#include <linux/crypto.h>
1515
#include <linux/scatterlist.h>
1616
#include <net/xfrm.h>
1717
#if IS_ENABLED(CONFIG_INET_ESP) || IS_ENABLED(CONFIG_INET6_ESP)
@@ -669,7 +669,7 @@ static const struct xfrm_algo_list xfrm_ealg_list = {
669669
};
670670

671671
static const struct xfrm_algo_list xfrm_calg_list = {
672-
.find = crypto_has_comp,
672+
.find = crypto_has_acomp,
673673
.algs = calg_list,
674674
.entries = ARRAY_SIZE(calg_list),
675675
};
@@ -828,8 +828,7 @@ void xfrm_probe_algs(void)
828828
}
829829

830830
for (i = 0; i < calg_entries(); i++) {
831-
status = crypto_has_comp(calg_list[i].name, 0,
832-
CRYPTO_ALG_ASYNC);
831+
status = crypto_has_acomp(calg_list[i].name, 0, 0);
833832
if (calg_list[i].available != status)
834833
calg_list[i].available = status;
835834
}

0 commit comments

Comments
 (0)