Skip to content

Commit

Permalink
net/ena: report default ring size
Browse files Browse the repository at this point in the history
[ upstream commit 30a6c7e ]

Remove invalid ring size alignment logic and add default Rx and Tx port
ring sizes to the device info spec.

The logic in lines 1297 and 1371 is invalid. The
RTE_ETH_DEV_FALLBACK_RX_RINGSIZE (and the TX counterpart) is a value
that rte_eth_rx_queue_setup() will set if
dev_info.default_rxportconf.ring_size is 0 and user provided 0 in
nb_rx_desc argument. However the current code treats it as a hint for
the PMD to change the ring size to internal defaults.

Additionally since the ENA_DEFAULT_RING_SIZE is defined, report it in
the device capabilities so that both rte_ethdev code and the user can
utilize it for device configuration.

Fixes: ea93d37 ("net/ena: add HW queues depth setup")

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
  • Loading branch information
semihalf-kardach-stanislaw authored and steevenlee committed Jun 8, 2021
1 parent 4a79d25 commit c9000c6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/net/ena/ena_ethdev.c
Expand Up @@ -1275,9 +1275,6 @@ static int ena_tx_queue_setup(struct rte_eth_dev *dev,
return -EINVAL;
}

if (nb_desc == RTE_ETH_DEV_FALLBACK_TX_RINGSIZE)
nb_desc = adapter->max_tx_ring_size;

txq->port_id = dev->data->port_id;
txq->next_to_clean = 0;
txq->next_to_use = 0;
Expand Down Expand Up @@ -1349,9 +1346,6 @@ static int ena_rx_queue_setup(struct rte_eth_dev *dev,
return ENA_COM_FAULT;
}

if (nb_desc == RTE_ETH_DEV_FALLBACK_RX_RINGSIZE)
nb_desc = adapter->max_rx_ring_size;

if (!rte_is_power_of_2(nb_desc)) {
PMD_DRV_LOG(ERR,
"Unsupported size of RX queue: %d is not a power of 2.\n",
Expand Down Expand Up @@ -2068,6 +2062,9 @@ static int ena_infos_get(struct rte_eth_dev *dev,
dev_info->tx_desc_lim.nb_mtu_seg_max = RTE_MIN(ENA_PKT_MAX_BUFS,
adapter->max_tx_sgl_size);

dev_info->default_rxportconf.ring_size = ENA_DEFAULT_RING_SIZE;
dev_info->default_txportconf.ring_size = ENA_DEFAULT_RING_SIZE;

return 0;
}

Expand Down

0 comments on commit c9000c6

Please sign in to comment.