DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ankur Dwivedi <adwivedi@marvell.com>
To: <dev@dpdk.org>
Cc: <akhil.goyal@nxp.com>, <jerinj@marvell.com>,
	<ndabilpuram@marvell.com>, <anoobj@marvell.com>,
	<ktejasree@marvell.com>, Ankur Dwivedi <adwivedi@marvell.com>
Subject: [dpdk-dev] [PATCH 2/2] crypto/octeontx2: add cpt kernel driver version check
Date: Fri, 31 Jul 2020 19:21:53 +0530	[thread overview]
Message-ID: <1596203513-21124-2-git-send-email-adwivedi@marvell.com> (raw)
In-Reply-To: <1596203513-21124-1-git-send-email-adwivedi@marvell.com>

From: Tejasree Kondoj <ktejasree@marvell.com>

This patch checks if cpt pmd is compatible with kernel
cpt driver.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 drivers/crypto/octeontx2/otx2_cryptodev.h      | 1 +
 drivers/crypto/octeontx2/otx2_cryptodev_mbox.c | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.h b/drivers/crypto/octeontx2/otx2_cryptodev.h
index a00f3d6..fba7222 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev.h
+++ b/drivers/crypto/octeontx2/otx2_cryptodev.h
@@ -15,6 +15,7 @@
 
 #define OTX2_CPT_MAX_LFS		64
 #define OTX2_CPT_MAX_QUEUES_PER_VF	64
+#define OTX2_CPT_PMD_VERSION		3
 
 /**
  * Device private data
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c b/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c
index 6028439..75e610d 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_mbox.c
@@ -29,6 +29,13 @@
 	if (ret)
 		return -EIO;
 
+	if (rsp->cpt_pf_drv_version != OTX2_CPT_PMD_VERSION) {
+		otx2_err("Incompatible CPT PMD version"
+			 "(Kernel: 0x%04x DPDK: 0x%04x)",
+			  rsp->cpt_pf_drv_version, OTX2_CPT_PMD_VERSION);
+		return -EPIPE;
+	}
+
 	memcpy(hw_caps, rsp->eng_caps,
 		sizeof(union cpt_eng_caps) * CPT_MAX_ENG_TYPES);
 
-- 
1.9.3


  reply	other threads:[~2020-07-31 13:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31 13:51 [dpdk-dev] [PATCH 1/2] common/octeontx2: sync cpt mailbox Ankur Dwivedi
2020-07-31 13:51 ` Ankur Dwivedi [this message]
2020-10-07  6:44 ` Anoob Joseph
2020-10-08 21:16 ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1596203513-21124-2-git-send-email-adwivedi@marvell.com \
    --to=adwivedi@marvell.com \
    --cc=akhil.goyal@nxp.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=ktejasree@marvell.com \
    --cc=ndabilpuram@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).