@@ -33,8 +33,6 @@ static unsigned int nr_cpus_per_node;
33
33
/* Number of physical cpus sharing each iaa instance */
34
34
static unsigned int cpus_per_iaa ;
35
35
36
- static struct crypto_comp * deflate_generic_tfm ;
37
-
38
36
/* Per-cpu lookup table for balanced wqs */
39
37
static struct wq_table_entry __percpu * wq_table ;
40
38
@@ -1001,17 +999,14 @@ static inline int check_completion(struct device *dev,
1001
999
1002
1000
static int deflate_generic_decompress (struct acomp_req * req )
1003
1001
{
1004
- void * src , * dst ;
1002
+ ACOMP_REQUEST_ON_STACK ( fbreq , crypto_acomp_reqtfm ( req )) ;
1005
1003
int ret ;
1006
1004
1007
- src = kmap_local_page (sg_page (req -> src )) + req -> src -> offset ;
1008
- dst = kmap_local_page (sg_page (req -> dst )) + req -> dst -> offset ;
1009
-
1010
- ret = crypto_comp_decompress (deflate_generic_tfm ,
1011
- src , req -> slen , dst , & req -> dlen );
1012
-
1013
- kunmap_local (src );
1014
- kunmap_local (dst );
1005
+ acomp_request_set_callback (fbreq , 0 , NULL , NULL );
1006
+ acomp_request_set_params (fbreq , req -> src , req -> dst , req -> slen ,
1007
+ req -> dlen );
1008
+ ret = crypto_acomp_decompress (fbreq );
1009
+ req -> dlen = fbreq -> dlen ;
1015
1010
1016
1011
update_total_sw_decomp_calls ();
1017
1012
@@ -1898,15 +1893,6 @@ static int __init iaa_crypto_init_module(void)
1898
1893
}
1899
1894
nr_cpus_per_node = nr_cpus / nr_nodes ;
1900
1895
1901
- if (crypto_has_comp ("deflate-generic" , 0 , 0 ))
1902
- deflate_generic_tfm = crypto_alloc_comp ("deflate-generic" , 0 , 0 );
1903
-
1904
- if (IS_ERR_OR_NULL (deflate_generic_tfm )) {
1905
- pr_err ("IAA could not alloc %s tfm: errcode = %ld\n" ,
1906
- "deflate-generic" , PTR_ERR (deflate_generic_tfm ));
1907
- return - ENOMEM ;
1908
- }
1909
-
1910
1896
ret = iaa_aecs_init_fixed ();
1911
1897
if (ret < 0 ) {
1912
1898
pr_debug ("IAA fixed compression mode init failed\n" );
@@ -1948,7 +1934,6 @@ static int __init iaa_crypto_init_module(void)
1948
1934
err_driver_reg :
1949
1935
iaa_aecs_cleanup_fixed ();
1950
1936
err_aecs_init :
1951
- crypto_free_comp (deflate_generic_tfm );
1952
1937
1953
1938
goto out ;
1954
1939
}
@@ -1965,7 +1950,6 @@ static void __exit iaa_crypto_cleanup_module(void)
1965
1950
& driver_attr_verify_compress );
1966
1951
idxd_driver_unregister (& iaa_crypto_driver );
1967
1952
iaa_aecs_cleanup_fixed ();
1968
- crypto_free_comp (deflate_generic_tfm );
1969
1953
1970
1954
pr_debug ("cleaned up\n" );
1971
1955
}
0 commit comments