From: Lance Richardson <lance.richardson@broadcom.com>
To: dev@dpdk.org
Cc: ajit.khaparde@broadcom.com, ferruh.yigit@intel.com,
Lance Richardson <lance.richardson@broadcom.com>
Subject: [dpdk-dev] [PATCH 10/11] net/bnxt: enable completion coalescing for thor
Date: Sun, 2 Jun 2019 13:42:45 -0400 [thread overview]
Message-ID: <20190602174247.32368-11-lance.richardson@broadcom.com> (raw)
In-Reply-To: <20190602174247.32368-1-lance.richardson@broadcom.com>
Enable completion coalescing for Thor-based adapters.
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
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
next prev parent reply other threads:[~2019-06-02 17:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-02 17:42 [dpdk-dev] [PATCH 00/11] add support for BCM57508 controller Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 01/11] net/bnxt: endianness conversions in cp ring macros Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 02/11] net/bnxt: fix ring type macro name usage Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 03/11] net/bnxt: fix width in stats ctx endian conversion Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 04/11] net/bnxt: use consistent values for vnic RSS rule Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 05/11] net/bnxt: reset function earlier in initialization Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 06/11] net/bnxt: support extended hwrm request sizes Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 07/11] net/bnxt: refactor doorbell handling Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 08/11] net/bnxt: refactor ring allocation code Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 09/11] net/bnxt: add support for thor controller Lance Richardson
2019-06-14 2:17 ` [dpdk-dev] compilation failing - " Thomas Monjalon
2019-06-14 3:34 ` Ajit Khaparde
2019-06-14 3:42 ` Lance Richardson
2019-06-14 4:20 ` [dpdk-dev] [PATCH] net/bnxt: fix compilation error with some compilers Ajit Khaparde
2019-06-14 6:56 ` Thomas Monjalon
2019-06-02 17:42 ` Lance Richardson [this message]
2019-06-02 17:42 ` [dpdk-dev] [PATCH 11/11] net/bnxt: enable RSS for thor-based adapters Lance Richardson
2019-06-02 17:42 ` [dpdk-dev] [PATCH 11/11] net/bnxt: enable RSS for thor-based controllers Lance Richardson
2019-06-07 10:48 ` [dpdk-dev] [PATCH 00/11] add support for BCM57508 controller Ferruh Yigit
2019-06-07 10:52 ` Ferruh Yigit
2019-06-07 13:45 ` Lance Richardson
2019-06-07 14:13 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190602174247.32368-11-lance.richardson@broadcom.com \
--to=lance.richardson@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).