On Tue, 15 Oct 2024 11:09:22 +0800 Howard Wang <howard_w...@realsil.com.cn> wrote:
> +rtl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, > + uint16_t nb_tx_desc, unsigned int socket_id, > + const struct rte_eth_txconf *tx_conf) > +{ > + struct rtl_tx_queue *txq; > + const struct rte_memzone *mz; > + struct rtl_adapter *adapter = RTL_DEV_PRIVATE(dev); > + struct rtl_hw *hw = &adapter->hw; > + u32 size; > + > + PMD_INIT_FUNC_TRACE(); > + > + if (nb_tx_desc < RTL_MIN_TX_DESC || nb_tx_desc > RTL_MAX_TX_DESC) { > + PMD_INIT_LOG(ERR, "r8169: Number of Tx descriptors must be " > + "less than or equal to %d " > + "greater than or equal to %d\n", RTL_MAX_TX_DESC, > + RTL_MIN_TX_DESC); > + return -EINVAL; > + } > + Check in driver is redundant, if you set tx_desc_lim properly. Already checked in ethdev. if (nb_tx_desc > dev_info.tx_desc_lim.nb_max || nb_tx_desc < dev_info.tx_desc_lim.nb_min || nb_tx_desc % dev_info.tx_desc_lim.nb_align != 0) { RTE_ETHDEV_LOG_LINE(ERR, "Invalid value for nb_tx_desc(=%hu), should be: <= %hu, >= %hu, and a product of %hu", nb_tx_desc, dev_info.tx_desc_lim.nb_max, dev_info.tx_desc_lim.nb_min, dev_info.tx_desc_lim.nb_align); return -EINVAL; }