DPDK patches and discussions
 help / color / mirror / Atom feed
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 2/7] net/bnxt: fix ring alignment for thor-based adapters
Date: Fri, 30 Aug 2019 16:51:56 -0400	[thread overview]
Message-ID: <20190830205201.26644-3-lance.richardson@broadcom.com> (raw)
In-Reply-To: <20190830205201.26644-1-lance.richardson@broadcom.com>

When using transmit/receive queue sizes smaller than 256, alignment
requirements are not being met for Thor-based adapters. Fix by
forcing memory addresses used for transmit/receive/aggregation ring
allocations to be on 4K boundaries.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index ec17783cf..bc8b92b04 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -162,18 +162,21 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
 	int nq_ring_len = BNXT_CHIP_THOR(bp) ? cp_ring_len : 0;
 
 	int tx_ring_start = nq_ring_start + nq_ring_len;
+	tx_ring_start = RTE_ALIGN(tx_ring_start, 4096);
 	int tx_ring_len = tx_ring_info ?
 	    RTE_CACHE_LINE_ROUNDUP(tx_ring_info->tx_ring_struct->ring_size *
 				   sizeof(struct tx_bd_long)) : 0;
 	tx_ring_len = RTE_ALIGN(tx_ring_len, 4096);
 
 	int rx_ring_start = tx_ring_start + tx_ring_len;
+	rx_ring_start = RTE_ALIGN(rx_ring_start, 4096);
 	int rx_ring_len =  rx_ring_info ?
 		RTE_CACHE_LINE_ROUNDUP(rx_ring_info->rx_ring_struct->ring_size *
 		sizeof(struct rx_prod_pkt_bd)) : 0;
 	rx_ring_len = RTE_ALIGN(rx_ring_len, 4096);
 
 	int ag_ring_start = rx_ring_start + rx_ring_len;
+	ag_ring_start = RTE_ALIGN(ag_ring_start, 4096);
 	int ag_ring_len = rx_ring_len * AGG_RING_SIZE_FACTOR;
 	ag_ring_len = RTE_ALIGN(ag_ring_len, 4096);
 
-- 
2.17.1


  parent reply	other threads:[~2019-08-30 20:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 20:51 [dpdk-dev] [PATCH 0/7] bnxt patchset for thor and bnxt vector PMD Lance Richardson
2019-08-30 20:51 ` [dpdk-dev] [PATCH 1/7] net/bnxt: fix thor tqm entry allocation Lance Richardson
2019-08-30 20:51 ` Lance Richardson [this message]
2019-08-30 20:51 ` [dpdk-dev] [PATCH 3/7] net/bnxt: use common receive/transmit NQ ring Lance Richardson
2019-08-30 20:51 ` [dpdk-dev] [PATCH 4/7] net/bnxt: use correct default Rx queue for thor Lance Richardson
2019-08-30 20:51 ` [dpdk-dev] [PATCH 5/7] net/bnxt: add support for LRO for thor adapters Lance Richardson
2019-08-30 20:52 ` [dpdk-dev] [PATCH 6/7] net/bnxt: fix scatter receive offload capability Lance Richardson
2019-08-30 20:52 ` [dpdk-dev] [PATCH 7/7] net/bnxt: improve CPR handling in vector PMD Lance Richardson

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=20190830205201.26644-3-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).