[v3,16/19] net/ixgbe: remove use of VLAs for Windows built code
Checks
Commit Message
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 <roretzla@linux.microsoft.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++--
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
@@ -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);
@@ -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;