From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: dev@dpdk.org
Cc: Matan Azrad <matan@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [PATCH] net/mlx5: remove non constant size from type cast
Date: Mon, 13 Nov 2023 09:20:38 -0800 [thread overview]
Message-ID: <1699896038-28106-1-git-send-email-roretzla@linux.microsoft.com> (raw)
Placing a non-constant size in the subscript [size] of a type cast is
causing unnecessary generation of a VLA. Remove size and just provide []
indicating the type is an array of unspecified size.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/mlx5/mlx5_rxq.c | 5 ++---
drivers/net/mlx5/mlx5_txq.c | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 88b2dc5..f0ab77d 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1951,9 +1951,8 @@ struct mlx5_rxq_ctrl *
tmpl->rxq.mp = rx_seg[0].mp;
tmpl->rxq.elts_n = log2above(desc);
tmpl->rxq.rq_repl_thresh = MLX5_VPMD_RXQ_RPLNSH_THRESH(desc_n);
- tmpl->rxq.elts = (struct rte_mbuf *(*)[desc_n])(tmpl + 1);
- tmpl->rxq.mprq_bufs =
- (struct mlx5_mprq_buf *(*)[desc])(*tmpl->rxq.elts + desc_n);
+ tmpl->rxq.elts = (struct rte_mbuf *(*)[])(tmpl + 1);
+ tmpl->rxq.mprq_bufs = (struct mlx5_mprq_buf *(*)[])(*tmpl->rxq.elts + desc_n);
tmpl->rxq.idx = idx;
if (conf->share_group > 0) {
tmpl->rxq.shared = 1;
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index b584055..3d219c4 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -64,7 +64,7 @@
const uint16_t elts_m = elts_n - 1;
uint16_t elts_head = txq_ctrl->txq.elts_head;
uint16_t elts_tail = txq_ctrl->txq.elts_tail;
- struct rte_mbuf *(*elts)[elts_n] = &txq_ctrl->txq.elts;
+ struct rte_mbuf *(*elts)[] = &txq_ctrl->txq.elts;
DRV_LOG(DEBUG, "port %u Tx queue %u freeing WRs",
PORT_ID(txq_ctrl->priv), txq_ctrl->txq.idx);
--
1.8.3.1
next reply other threads:[~2023-11-13 17:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 17:20 Tyler Retzlaff [this message]
2024-02-12 18:03 ` Tyler Retzlaff
2024-02-13 11:56 ` Slava Ovsiienko
2024-02-25 14:42 ` Raslan Darawsheh
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=1699896038-28106-1-git-send-email-roretzla@linux.microsoft.com \
--to=roretzla@linux.microsoft.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.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).