crypto/qat: fix null authentication request
authorAdam Dybkowski <adamx.dybkowski@intel.com>
Mon, 10 May 2021 10:20:11 +0000 (11:20 +0100)
committerAkhil Goyal <gakhil@marvell.com>
Wed, 12 May 2021 16:11:21 +0000 (18:11 +0200)
This patch fixes the NULL auth generation case where the request
shouldn't contain the authentication result address. Allows to run
ipsec_autotest with a QAT device.

Fixes: 65beb9abca6d ("crypto/qat: fix null auth when using VFIO")
Cc: stable@dpdk.org
Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
drivers/crypto/qat/qat_sym.c

index a1f5676..9415ec7 100644 (file)
@@ -399,8 +399,10 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
                }
                min_ofs = auth_ofs;
 
-               auth_param->auth_res_addr =
-                       op->sym->auth.digest.phys_addr;
+               if (ctx->qat_hash_alg != ICP_QAT_HW_AUTH_ALGO_NULL ||
+                               ctx->auth_op == ICP_QAT_HW_AUTH_VERIFY)
+                       auth_param->auth_res_addr =
+                                       op->sym->auth.digest.phys_addr;
 
        }