[dpdk-dev] [PATCH v1 34/42] net/txgbe: add remaining RX and TX queue operations

Ferruh Yigit ferruh.yigit at intel.com
Wed Sep 9 20:15:19 CEST 2020


On 9/1/2020 12:51 PM, Jiawen Wu wrote:
> Add remaining receive and transmit queue operaions.
> 
> Signed-off-by: Jiawen Wu <jiawenwu at trustnetic.com>
> ---
>  drivers/net/txgbe/txgbe_ethdev.c | 123 +++++++++++++++
>  drivers/net/txgbe/txgbe_ethdev.h |  16 ++
>  drivers/net/txgbe/txgbe_rxtx.c   | 259 +++++++++++++++++++++++++++++++
>  drivers/net/txgbe/txgbe_rxtx.h   |   1 +
>  4 files changed, 399 insertions(+)
> 
> diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
> index ba2849a82..54c97f81c 100644
> --- a/drivers/net/txgbe/txgbe_ethdev.c
> +++ b/drivers/net/txgbe/txgbe_ethdev.c
> @@ -622,6 +622,46 @@ static struct rte_pci_driver rte_txgbe_pmd = {
>  
>  
>  
> +static int
> +txgbe_check_mq_mode(struct rte_eth_dev *dev)
> +{
> +	RTE_SET_USED(dev);
> +
> +	return 0;
> +}
> +
> +static int
> +txgbe_dev_configure(struct rte_eth_dev *dev)
> +{
> +	struct txgbe_interrupt *intr = TXGBE_DEV_INTR(dev);
> +	struct txgbe_adapter *adapter = TXGBE_DEV_ADAPTER(dev);
> +	int ret;
> +
> +	PMD_INIT_FUNC_TRACE();
> +
> +	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
> +	/* multiple queue mode checking */
> +	ret  = txgbe_check_mq_mode(dev);
> +	if (ret != 0) {
> +		PMD_DRV_LOG(ERR, "txgbe_check_mq_mode fails with %d.",
> +			    ret);
> +		return ret;
> +	}
> +
> +	/* set flag to update link status after init */
> +	intr->flags |= TXGBE_FLAG_NEED_LINK_UPDATE;
> +
> +	/*
> +	 * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
> +	 * allocation Rx preconditions we will reset it.
> +	 */
> +	adapter->rx_bulk_alloc_allowed = true;
> +
> +	return 0;
> +}

'.dev_configure' is relatively more important funtion for the driver, I think it
would be better to introduce it in earlier stages in the patchset, if possible.

There is no guideline or requirement for the ordering but if the re-ordering
patches won't cause too much work, I would suggest following order as guideline
if helps (please don't take it too strict):
- basic infrastructure
  - build files, initial doc, log, probe()/init() funtions, base files (hw
config files) ...
- device configuration
  - .dev_configure, .dev_infos_get, interrupt configuration, mac set, link
status ...
- Data path
  - Rx/Tx init, queue setup, start/stop, data path implementations, ...
- More features
  - stats, vlan, flow ctrl, promiscuous and allmulticast, mtu ...
- Optional features
  - fw version, dump registers, led, eeprom get, descriptor_status ...



More information about the dev mailing list