From patchwork Wed Nov 6 07:18:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178626 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp241821ilf; Tue, 5 Nov 2019 23:34:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzPQsicQl46cubvDyeZFvK7hPiR++aHMpizv4/VyqzTVTQeqf902r1Erf4egtRdQ391PqbV X-Received: by 2002:a50:9930:: with SMTP id k45mr1104542edb.134.1573025693019; Tue, 05 Nov 2019 23:34:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573025693; cv=none; d=google.com; s=arc-20160816; b=QsrpX0cRWtSxfYwPc78wrD/Cl3mm2JfzD5KFZM1YUi8xbUS1+2J7MtfhbRJrpin/7L 85kXxuCpKWWdqfSP3r5d9YCOAo3WZY1D7AFNJRi0VDE+4ms/mu1mNKDRTXPk9n30gzWQ 5bRMXwIw5KWuwV+g86Y1HThXQH2eRLVd8vjmP1no7nNQV2n4FX8MedFwPsAhbqXNibej m5P88VM3F00jf0hKsf4frcMbMsZVUApIBOE2mR5cuPoEBCTbLt9BGUCNzBPC+txh1nrr 522JlnXNZex1+a4c40HA9rx2KYvu++wsmnjeyrBLVBRlh2rMaXkBzG9zUDFm7c3AKNLx 1Yqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=6hNG7FhpaqSs0UtbM42FAaECrk7EORaWLACjKVmGURI=; b=IDnBkvnHni9mk+PhXldEuaAjweUCldMLwXA7RaNlxvnLk4HcB0qcig+6AfqtcPaL9r zO9F7oc9H1SNClIaHq9IoBniAu7WPYxTzX/s13qs+6jw7hQxnx453pO+AH/m3zWT2xBY jCCJGiHHflMcmAgKI6V3T4WDNH8jObYled6aLDa4/D0RX4MXu5eATCYv7JeA2z/fj2Ts Jssi2PCRyLpwK3780Op9+pmy2RJvZFIbrElD7zsBj1ASxOUPULAt9xLW6UZnvbn1FGwY rESnInysWjbIHJsTbTiTogeXQYUvBY1Wlvm6ozCf1V5jNG0YddhloMnblOdQ8vKY7ih0 6YIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id qu7si12337981ejb.79.2019.11.05.23.34.52; Tue, 05 Nov 2019 23:34:53 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9CBE61BFD9; Wed, 6 Nov 2019 08:34:51 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 440031BFC6 for ; Wed, 6 Nov 2019 08:34:50 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E57002001C8; Wed, 6 Nov 2019 08:34:49 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B80C520013E; Wed, 6 Nov 2019 08:34:47 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 988A940285; Wed, 6 Nov 2019 15:34:44 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: akhil.goyal@nxp.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Wed, 6 Nov 2019 12:48:27 +0530 Message-Id: <20191106071827.17113-1-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH] crypto/dpaa2_sec: add retry timeout in packet enqueue API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 patch adds retry in the DPAA2 SEC packet enqueue API Signed-off-by: Nipun Gupta --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 27 +++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) -- 2.17.1 Acked-by: Akhil Goyal diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index add3b9ea6..cb22631ed 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1430,7 +1430,7 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, uint32_t loop; int32_t ret; struct qbman_fd fd_arr[MAX_TX_RING_SLOTS]; - uint32_t frames_to_send; + uint32_t frames_to_send, retry_count; struct qbman_eq_desc eqdesc; struct dpaa2_sec_qp *dpaa2_qp = (struct dpaa2_sec_qp *)qp; struct qbman_swp *swp; @@ -1488,16 +1488,29 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, } ops++; } + loop = 0; + retry_count = 0; while (loop < frames_to_send) { - loop += qbman_swp_enqueue_multiple(swp, &eqdesc, - &fd_arr[loop], - &flags[loop], - frames_to_send - loop); + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, + &fd_arr[loop], + &flags[loop], + frames_to_send - loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) { + num_tx += loop; + nb_ops -= loop; + goto skip_tx; + } + } else { + loop += ret; + retry_count = 0; + } } - num_tx += frames_to_send; - nb_ops -= frames_to_send; + num_tx += loop; + nb_ops -= loop; } skip_tx: dpaa2_qp->tx_vq.tx_pkts += num_tx;