From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 25B6F5A8C for ; Wed, 1 Jun 2016 12:53:01 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 01 Jun 2016 03:53:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,400,1459839600"; d="scan'208";a="114045121" Received: from sivswdev03.ir.intel.com (HELO localhost.localdomain) ([10.237.217.157]) by fmsmga004.fm.intel.com with ESMTP; 01 Jun 2016 03:53:00 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: fiona.trahe@intel.com, john.griffin@intel.com, deepak.k.jain@intel.com, olivier.matz@6wind.com, thomas.monjalon@6wind.com, Arkadiusz Kusztal Date: Wed, 1 Jun 2016 11:52:00 +0100 Message-Id: <1464778320-29746-1-git-send-email-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1464611916-17061-1-git-send-email-arkadiuszx.kusztal@intel.com> References: <1464611916-17061-1-git-send-email-arkadiuszx.kusztal@intel.com> Subject: [dpdk-dev] [PATCH v2] qat: fix phys address of content descriptor X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2016 10:53:02 -0000 From: Arkadiusz Kusztal Fix an error with computation of physical address of content descriptor in the symmetric operations session Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices") Signed-off-by: Arkadiusz Kusztal --- v2: Added fixes line to commit message drivers/crypto/qat/qat_crypto.c | 9 ++++++--- lib/librte_cryptodev/rte_cryptodev.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index 495ea1c..abe0511 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -807,12 +807,15 @@ static inline uint32_t adf_modulo(uint32_t data, uint32_t shift) return data - mult; } -void qat_crypto_sym_session_init(struct rte_mempool *mp, void *priv_sess) +void qat_crypto_sym_session_init(struct rte_mempool *mp, void *sym_sess) { - struct qat_session *s = priv_sess; + struct rte_cryptodev_sym_session *sess = sym_sess; + struct qat_session *s = (void *)sess->_private; PMD_INIT_FUNC_TRACE(); - s->cd_paddr = rte_mempool_virt2phy(mp, &s->cd); + s->cd_paddr = rte_mempool_virt2phy(mp, sess) + + offsetof(struct qat_session, cd) + + offsetof(struct rte_cryptodev_sym_session, _private); } int qat_dev_config(__rte_unused struct rte_cryptodev *dev) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index aa4ea42..960e2d5 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -956,7 +956,7 @@ rte_cryptodev_sym_session_init(struct rte_mempool *mp, sess->mp = mp; if (dev->dev_ops->session_initialize) - (*dev->dev_ops->session_initialize)(mp, sess->_private); + (*dev->dev_ops->session_initialize)(mp, sess); } static int -- 2.1.0