From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CED17A0524; Mon, 31 May 2021 16:12:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8897141145; Mon, 31 May 2021 16:11:08 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 611D44113E for ; Mon, 31 May 2021 16:11:07 +0200 (CEST) IronPort-SDR: x6BoN61bvvMvMcu6ZguplxhTkjnp4OUBLHNJ0fjcPQPOxqLgTaFwHMRcixguFjF9QkLpA6411y 8CzHHHUVsbog== X-IronPort-AV: E=McAfee;i="6200,9189,10001"; a="201492251" X-IronPort-AV: E=Sophos;i="5.83,237,1616482800"; d="scan'208";a="201492251" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2021 07:11:06 -0700 IronPort-SDR: 6ICIj86rBHFiS1O1RpIQKKfQrvqXDQ4m4a4gf9gBgghF2rv+78weUwp3trVsdX4BSdvwNZZ87k ujoiG0tn5uVw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,237,1616482800"; d="scan'208";a="548760206" Received: from silpixa00400308.ir.intel.com ([10.237.214.61]) by orsmga004.jf.intel.com with ESMTP; 31 May 2021 07:11:05 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, fiona.trahe@intel.com, roy.fan.zhang@intel.com, Arek Kusztal Date: Mon, 31 May 2021 15:10:24 +0100 Message-Id: <20210531141027.13289-13-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531141027.13289-1-arkadiuszx.kusztal@intel.com> References: <20210531141027.13289-1-arkadiuszx.kusztal@intel.com> Subject: [dpdk-dev] [PATCH 12/15] common/qat: reset ring pairs before setting pmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit resets ring pairs of particular vf before setting PMD on fourth generation devices. Signed-off-by: Arek Kusztal --- drivers/common/qat/qat_device.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c index 5ee441171e..d6bf0f52db 100644 --- a/drivers/common/qat/qat_device.c +++ b/drivers/common/qat/qat_device.c @@ -11,6 +11,7 @@ #include "qat_sym_pmd.h" #include "qat_comp_pmd.h" #include "adf_pf2vf_msg.h" +#include "qat_pf2vf.h" /* pv2vf data Gen 4*/ struct qat_pf2vf_dev qat_pf2vf_gen4 = { @@ -125,6 +126,27 @@ qat_get_qat_dev_from_pci_dev(struct rte_pci_device *pci_dev) return qat_pci_get_named_dev(name); } +static int qat_gen4_reset_ring_pair(struct qat_pci_device *qat_pci_dev) +{ + int ret = 0, i; + uint8_t data[4]; + struct qat_pf2vf_msg pf2vf_msg; + + pf2vf_msg.msg_type = ADF_VF2PF_MSGTYPE_RP_RESET; + pf2vf_msg.block_hdr = -1; + for (i = 0; i < QAT_GEN4_BUNDLE_NUM; i++) { + pf2vf_msg.msg_data = i; + ret = qat_pf2vf_exch_msg(qat_pci_dev, pf2vf_msg, 1, data); + if (ret) { + QAT_LOG(ERR, "QAT error when reset bundle no %d", + i); + return ret; + } + } + + return 0; +} + static void qat_dev_parse_cmd(const char *str, struct qat_dev_cmd_param *qat_dev_cmd_param) { @@ -371,6 +393,11 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, if (qat_pci_dev == NULL) return -ENODEV; + if (qat_pci_dev->qat_dev_gen == QAT_GEN4) { + if (qat_gen4_reset_ring_pair(qat_pci_dev)) + return -ENODEV; + } + sym_ret = qat_sym_dev_create(qat_pci_dev, qat_dev_cmd_param); if (sym_ret == 0) { num_pmds_created++; -- 2.25.1