DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com,
	Lance Richardson <lance.richardson@broadcom.com>,
	Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Subject: [dpdk-dev] [PATCH v2 2/9] net/bnxt: fix ring alignment for thor-based adapters
Date: Thu,  3 Oct 2019 20:48:56 -0700	[thread overview]
Message-ID: <20191004034903.85233-3-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20191004034903.85233-1-ajit.khaparde@broadcom.com>

From: Lance Richardson <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 a3e5a68714..4662e94132 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.20.1 (Apple Git-117)


  parent reply	other threads:[~2019-10-04  3:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04  3:48 [dpdk-dev] [PATCH v2 0/9] bnxt patchset Ajit Khaparde
2019-10-04  3:48 ` [dpdk-dev] [PATCH v2 1/9] net/bnxt: increase tqm entry allocation Ajit Khaparde
2019-10-04  3:48 ` Ajit Khaparde [this message]
2019-10-04  3:48 ` [dpdk-dev] [PATCH v2 3/9] net/bnxt: add support for LRO on thor adapters Ajit Khaparde
2019-10-04  3:48 ` [dpdk-dev] [PATCH v2 4/9] net/bnxt: add support for CoS classification Ajit Khaparde
2019-10-04  3:48 ` [dpdk-dev] [PATCH v2 5/9] net/bnxt: use common receive transmit nq ring Ajit Khaparde
2019-10-04  3:49 ` [dpdk-dev] [PATCH v2 6/9] net/bnxt: fix stats context calculation Ajit Khaparde
2019-10-04  3:49 ` [dpdk-dev] [PATCH v2 7/9] net/bnxt: use correct default Rx queue for thor Ajit Khaparde
2019-10-04  3:49 ` [dpdk-dev] [PATCH v2 8/9] net/bnxt: advertise scatter receive offload capability Ajit Khaparde
2019-10-04  3:49 ` [dpdk-dev] [PATCH v2 9/9] net/bnxt: improve CPR handling in vector PMD Ajit Khaparde
2019-10-07 17:35 ` [dpdk-dev] [PATCH v2 0/9] bnxt patchset 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=20191004034903.85233-3-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=lance.richardson@broadcom.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).