Add sym algo match functions, in order to
distinguish encrypto, decrypto and hash.

Signed-off-by: Hanxiao Li <li.hanxiao@zte.com.cn>
---
 drivers/common/zsda/meson.build |  2 +-
 drivers/crypto/zsda/zsda_sym.c  | 52 +++++++++++++++++++++++++++++++++
 drivers/crypto/zsda/zsda_sym.h  | 17 +++++++++++
 3 files changed, 70 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/zsda/zsda_sym.c
 create mode 100644 drivers/crypto/zsda/zsda_sym.h

diff --git a/drivers/common/zsda/meson.build b/drivers/common/zsda/meson.build
index 9ce01a96fc..85ca7f18fd 100644
--- a/drivers/common/zsda/meson.build
+++ b/drivers/common/zsda/meson.build
@@ -30,7 +30,7 @@ zsda_crypto_path = 'crypto/zsda'
 zsda_crypto_relpath = '../../' + zsda_crypto_path
 if zsda_crypto
     libcrypto = dependency('libcrypto', required: false, method: 'pkg-config')
-    foreach f: ['zsda_sym_session.c']
+    foreach f: ['zsda_sym_session.c', 'zsda_sym.c']
         sources += files(join_paths(zsda_crypto_relpath, f))
     endforeach
     deps += ['security']
diff --git a/drivers/crypto/zsda/zsda_sym.c b/drivers/crypto/zsda/zsda_sym.c
new file mode 100644
index 0000000000..db67507134
--- /dev/null
+++ b/drivers/crypto/zsda/zsda_sym.c
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2024 ZTE Corporation
+ */
+
+#include "cryptodev_pmd.h"
+
+#include "zsda_logs.h"
+#include "zsda_sym.h"
+
+int
+zsda_encry_match(const void *op_in)
+{
+    const struct rte_crypto_op *op = op_in;
+    struct rte_cryptodev_sym_session *session = op->sym->session;
+    struct zsda_sym_session *sess =
+        (struct zsda_sym_session *)session->driver_priv_data;
+
+    if (sess->chain_order == ZSDA_SYM_CHAIN_ONLY_CIPHER &&
+        sess->cipher.op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)
+        return 1;
+    else
+        return 0;
+}
+
+int
+zsda_decry_match(const void *op_in)
+{
+    const struct rte_crypto_op *op = op_in;
+    struct rte_cryptodev_sym_session *session = op->sym->session;
+    struct zsda_sym_session *sess =
+        (struct zsda_sym_session *)session->driver_priv_data;
+
+    if (sess->chain_order == ZSDA_SYM_CHAIN_ONLY_CIPHER &&
+        sess->cipher.op == RTE_CRYPTO_CIPHER_OP_DECRYPT)
+        return 1;
+    else
+        return 0;
+}
+
+int
+zsda_hash_match(const void *op_in)
+{
+    const struct rte_crypto_op *op = op_in;
+    struct rte_cryptodev_sym_session *session = op->sym->session;
+    struct zsda_sym_session *sess =
+        (struct zsda_sym_session *)session->driver_priv_data;
+
+    if (sess->chain_order == ZSDA_SYM_CHAIN_ONLY_AUTH)
+        return 1;
+    else
+        return 0;
+}
diff --git a/drivers/crypto/zsda/zsda_sym.h b/drivers/crypto/zsda/zsda_sym.h
new file mode 100644
index 0000000000..44ba1380f3
--- /dev/null
+++ b/drivers/crypto/zsda/zsda_sym.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2024 ZTE Corporation
+ */
+
+#ifndef _ZSDA_SYM_H_
+#define _ZSDA_SYM_H_
+
+#include "zsda_common.h"
+#include "zsda_qp.h"
+
+#include "zsda_sym_session.h"
+
+int zsda_encry_match(const void *op_in);
+int zsda_decry_match(const void *op_in);
+int zsda_hash_match(const void *op_in);
+
+#endif /* _ZSDA_SYM_H_ */
-- 
2.27.0