From patchwork Tue Nov 5 14:23:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178526 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp847008ilf; Tue, 5 Nov 2019 06:40:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzyDTqjycVxArBi+3z9gqyytoAQ0Whz9kbeBg6fEQz65h8d3Vb7FZmEgk7+GkvZrzfqTtvx X-Received: by 2002:a17:906:66d2:: with SMTP id k18mr29293104ejp.278.1572964850468; Tue, 05 Nov 2019 06:40:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964850; cv=none; d=google.com; s=arc-20160816; b=dZnGqhfb+EZV1yauY1MFkz+VXP83NP+JxJ+Io24+fgWFuXZORtJy6jbmteQQ0mwdC4 ylIkIL3n9iONj2a5LPO8p8e+3Cup7v18tvS8G3XVSFeANA1hWDymmvjokg7MlilakNer 588Bs0D3wnVKXTJK/IUj6HJ3Q90CrdpjMDHC18tDf2dbSPYQY84o5xK3ir6YxawBSyKA HBglWcQc8IwaKWvNbbytdh8k1AksdSAuvh5c9Rk5rnMiAhfdMyEgXJfydxmUC3Iv1YKk 5wE0LUabIBXfpSZTUrjRgK3vnlzLeGYk7suL3QW9kIecD4rrHCdQfr+xQm2AbhUwkwsF G+rg== 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:references:in-reply-to :message-id:date:cc:to:from; bh=kjYd53ukk4K1Apqg5hKr+qkFJtnpA1QHaTVqiuBaQsI=; b=a39ggJbyFLsTcs3yJfZy0X+YzZ9GP1J+QJCmwXvoGxDmOmo8mO1O1ffYY04KdbA99M DB2pquFrJK5llfsDyLEvS9CDiT7eUiOFrYvIFIzwR7xGBoEC1Flv1lk1+OhyLnvEDWZe Oyl0gg9weWDska9Qlwt5VofmTU8D2bUxuVq301FmWfi+d7bM22WC1TWjWZ6dmIeooM3W xjS777ytVWGlG6VvCiGT29MxP6+PGz+3j/LhrhNhWGGwBAnBTgbaF4fYYOx14CILm+Fx rExlL7HG7WHghGvBsVu2uWgci3kcxRk1v9ex6esaCr6WxsAn2UVChujaI7/VmqCJ8FH1 iMRQ== 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 j15si14344953ejc.369.2019.11.05.06.40.50; Tue, 05 Nov 2019 06:40:50 -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 ED0BF1BF4D; Tue, 5 Nov 2019 15:39:55 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 9E82A1BF41; Tue, 5 Nov 2019 15:39:52 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8188E20052D; Tue, 5 Nov 2019 15:39:52 +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 2CD8A200508; Tue, 5 Nov 2019 15:39:49 +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 57CD440309; Tue, 5 Nov 2019 22:39:41 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Tue, 5 Nov 2019 19:53:17 +0530 Message-Id: <20191105142321.7478-6-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 5/9 v4] raw/dpaa2_qdma: add retry and 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 the logic in the DPAA2 QDMA packet enqueue API Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index a391913b0..af678273d 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -541,13 +541,21 @@ dpdmai_dev_enqueue_multi(struct dpaa2_dpdmai_dev *dpdmai_dev, } /* Enqueue the packet to the QBMAN */ - uint32_t enqueue_loop = 0; + uint32_t enqueue_loop = 0, retry_count = 0; while (enqueue_loop < loop) { - enqueue_loop += qbman_swp_enqueue_multiple(swp, + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd[enqueue_loop], NULL, loop - enqueue_loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + return num_tx - (loop - enqueue_loop); + } else { + enqueue_loop += ret; + retry_count = 0; + } } nb_jobs -= loop; }