From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A33BBA0096 for ; Sun, 2 Jun 2019 19:44:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 535981B9B3; Sun, 2 Jun 2019 19:43:25 +0200 (CEST) Received: from mail-yw1-f68.google.com (mail-yw1-f68.google.com [209.85.161.68]) by dpdk.org (Postfix) with ESMTP id 892681B959 for ; Sun, 2 Jun 2019 19:43:12 +0200 (CEST) Received: by mail-yw1-f68.google.com with SMTP id s5so6447076ywd.9 for ; Sun, 02 Jun 2019 10:43:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EgKQp/IRAjBaBZYtG6LRhcmuLEyA3R5EG5bpDpLXiLY=; b=HE2p3baJvyNRxk1UVE1NS5yJRkUvdo0/juwirVyubZFHNeJrGEdWZ51mSP4P4DDQfq uzDLVbLK++IHu3IQDvA95W3P/1nq9JcvquzR86i0XF1S01j3nuytltDH1vf/m7Mktpg2 h1go5hXNEdpGVqTpiED+Vl1fRk9uytCkXU16A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EgKQp/IRAjBaBZYtG6LRhcmuLEyA3R5EG5bpDpLXiLY=; b=FLPJfMUyQS+UxHamv7h5iblII8JHzEwAgMJSJrSnmZWLIyaspkSuynbL1Qhi2pgyfv T9KRpCfdvWO1HDkH2FSJJW9YWnao6e3gbOjaSA4NkGBlfmHqgB+HGeJp9cwUrCe9ofwV LeeSxXNe1OpKu0dM0sDf0RR9XCimIjzl6aHdT601BEk9jzMJxiMUeqS+k/ix00oOyqBS 3MN7wKflpparanccxdQUWzNT3W6Y3+BLmlcyqklIj+AIYC+jguFFjCM76KCi+FXVtOnu 4Kz3Cei5h4m3caW4msZ6NALui4fTi1vhQbK9eJ59gwtERkMcgPFCAppwTkMtkSACnKY3 5WZg== X-Gm-Message-State: APjAAAX/uqB8FqpFOzPCVd1UZNIDlR7lvlY5zkDEJ+ZUM84j2QXcdN8P 1I0F1DJuV2ILnnBCyNK0+3pmSUpuLk7ifA+tw+TrlS5kO4ClzXBRMzMLlZZznb8wqRmIfFz89+/ 5rU03rTccAhA1TfqW2TUriClncUNxqLpP5aGLYp3JBHC7qvm0DmjPqPS8LKIb9YDk X-Google-Smtp-Source: APXvYqxw/gadyolc/EL/gN348GBf7aHS5vlqKiAq89vsCCbYRbYFv0q07X+q2SSCU1hktOWNsc4ATg== X-Received: by 2002:a0d:ca50:: with SMTP id m77mr12294309ywd.302.1559497391821; Sun, 02 Jun 2019 10:43:11 -0700 (PDT) Received: from lrichardson-VirtualBox.attlocal.net (69-218-223-106.lightspeed.rlghnc.sbcglobal.net. [69.218.223.106]) by smtp.gmail.com with ESMTPSA id n78sm1000819ywd.2.2019.06.02.10.43.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Jun 2019 10:43:11 -0700 (PDT) From: Lance Richardson To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com, ferruh.yigit@intel.com, Lance Richardson Date: Sun, 2 Jun 2019 13:42:45 -0400 Message-Id: <20190602174247.32368-11-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190602174247.32368-1-lance.richardson@broadcom.com> References: <20190602174247.32368-1-lance.richardson@broadcom.com> Subject: [dpdk-dev] [PATCH 10/11] net/bnxt: enable completion coalescing for thor 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" Enable completion coalescing for Thor-based adapters. Signed-off-by: Lance Richardson Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 42 +++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 29f270195..f5b7e4593 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -4095,6 +4095,37 @@ static void bnxt_hwrm_set_coal_params(struct bnxt_coal *hw_coal, req->flags = rte_cpu_to_le_16(flags); } +static int bnxt_hwrm_set_coal_params_thor(struct bnxt *bp, + struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *agg_req) +{ + struct hwrm_ring_aggint_qcaps_input req = {0}; + struct hwrm_ring_aggint_qcaps_output *resp = bp->hwrm_cmd_resp_addr; + uint32_t enables; + uint16_t flags; + int rc; + + HWRM_PREP(req, RING_AGGINT_QCAPS, BNXT_USE_CHIMP_MB); + rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); + if (rc) + goto out; + + agg_req->num_cmpl_dma_aggr = resp->num_cmpl_dma_aggr_max; + agg_req->cmpl_aggr_dma_tmr = resp->cmpl_aggr_dma_tmr_min; + + flags = HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET | + HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE; + agg_req->flags = rte_cpu_to_le_16(flags); + enables = + HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR | + HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR; + agg_req->enables = rte_cpu_to_le_32(enables); + +out: + HWRM_CHECK_RESULT(); + HWRM_UNLOCK(); + return rc; +} + int bnxt_hwrm_set_ring_coal(struct bnxt *bp, struct bnxt_coal *coal, uint16_t ring_id) { @@ -4103,12 +4134,17 @@ int bnxt_hwrm_set_ring_coal(struct bnxt *bp, bp->hwrm_cmd_resp_addr; int rc; - /* Set ring coalesce parameters only for Stratus 100G NIC */ - if (!bnxt_stratus_device(bp)) + /* Set ring coalesce parameters only for 100G NICs */ + if (BNXT_CHIP_THOR(bp)) { + if (bnxt_hwrm_set_coal_params_thor(bp, &req)) + return -1; + } else if (bnxt_stratus_device(bp)) { + bnxt_hwrm_set_coal_params(coal, &req); + } else { return 0; + } HWRM_PREP(req, RING_CMPL_RING_CFG_AGGINT_PARAMS, BNXT_USE_CHIMP_MB); - bnxt_hwrm_set_coal_params(coal, &req); req.ring_id = rte_cpu_to_le_16(ring_id); rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); HWRM_CHECK_RESULT(); -- 2.17.1