From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4EEB943EA8; Thu, 18 Apr 2024 22:04:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93D6640A81; Thu, 18 Apr 2024 22:03:02 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3196440041 for ; Thu, 18 Apr 2024 22:02:46 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id D82B920FDABA; Thu, 18 Apr 2024 13:02:44 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D82B920FDABA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713470564; bh=DP5n0HNNobIG1YowCKQUcSqvBiQy9HlTgX3JdtLvITc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fypTr6a/bjwWCkVmRf3OmWuLfESgiPrbviG19JyJeZxUZrOgSfSJ4V4ox+Gq2KgKF J/1M+n+IboLndYTl0Oc5qPo9fCEwTQcRfISHoNpoAj8NjLynAZFHyvMcoKBA7W+3tV nGCfOwoEu63+i4DxaGDiyzZNiIYBo0kzffzoBKrM= From: Tyler Retzlaff To: dev@dpdk.org Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= , Akhil Goyal , Aman Singh , Anatoly Burakov , Andrew Rybchenko , Bruce Richardson , Chengwen Feng , Dariusz Sosnowski , Dmitry Kozlyuk , Fan Zhang , Ferruh Yigit , Harman Kalra , Harry van Haaren , Honnappa Nagarahalli , Jiayu Hu , Jingjing Wu , Kevin Laatz , Konstantin Ananyev , Matan Azrad , Ori Kam , Pallavi Kadam , Reshma Pattan , Sameh Gobriel , Suanming Mou , Thomas Monjalon , Tyler Retzlaff , Viacheslav Ovsiienko , Vladimir Medvedkin , Volodymyr Fialko , Yipeng Wang Subject: [PATCH v2 16/19] net/ixgbe: remove use of VLAs for Windows built code Date: Thu, 18 Apr 2024 13:02:39 -0700 Message-Id: <1713470562-17415-17-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1713470562-17415-1-git-send-email-roretzla@linux.microsoft.com> References: <1713397319-26135-1-git-send-email-roretzla@linux.microsoft.com> <1713470562-17415-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org MSVC does not support VLAs, replace VLAs with standard C arrays or alloca(). alloca() is available for all toolchain/platform combinations officially supported by DPDK. Signed-off-by: Tyler Retzlaff --- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++-- drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index c61c52b..d460596 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -3553,7 +3553,8 @@ static int ixgbe_dev_xstats_get_names_by_id( uint16_t i; uint16_t size = ixgbe_xstats_calc_num(); - struct rte_eth_xstat_name xstats_names_copy[size]; + struct rte_eth_xstat_name *xstats_names_copy = + alloca(sizeof(struct rte_eth_xstat_name) * size); ixgbe_dev_xstats_get_names_by_id(dev, NULL, xstats_names_copy, size); @@ -3736,7 +3737,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, uint16_t i; uint16_t size = ixgbe_xstats_calc_num(); - uint64_t values_copy[size]; + uint64_t *values_copy = alloca(sizeof(uint64_t) * size); ixgbe_dev_xstats_get_by_id(dev, NULL, values_copy, size); diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h index a4d9ec9..78b63b9 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h @@ -14,7 +14,7 @@ reassemble_packets(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_bufs, uint16_t nb_bufs, uint8_t *split_flags) { - struct rte_mbuf *pkts[nb_bufs]; /*finished pkts*/ + struct rte_mbuf **pkts = alloca(sizeof(struct rte_mbuf *) * nb_bufs); /*finished pkts*/ struct rte_mbuf *start = rxq->pkt_first_seg; struct rte_mbuf *end = rxq->pkt_last_seg; unsigned int pkt_idx, buf_idx; -- 1.8.3.1