[PATCH v4 01/86] net/ntnic: add API for configuration NT flow dev

Ferruh Yigit ferruh.yigit at amd.com
Wed Oct 30 02:54:39 CET 2024


On 10/29/2024 4:41 PM, Serhii Iliushyk wrote:
> From: Danylo Vodopianov <dvo-plv at napatech.com>
> 
> This API allows to enable of flow profile for NT SmartNIC
> 
> Signed-off-by: Danylo Vodopianov <dvo-plv at napatech.com>
> 

<...>

> +	for (i = 0; i < alloc_rx_queues; i++) {
> +#ifdef SCATTER_GATHER
> +		eth_dev->rx_queue[i] = queue_ids[i];
> +#else
> +		int queue_id = flow_nic_alloc_resource(ndev, RES_QUEUE, 1);
> +
> +		if (queue_id < 0) {
> +			NT_LOG(ERR, FILTER, "ERROR: no more free queue IDs in NIC");
> +			goto err_exit0;
> +		}
> +
> +		eth_dev->rx_queue[eth_dev->num_queues].id = (uint8_t)queue_id;
> +		eth_dev->rx_queue[eth_dev->num_queues].hw_id =
> +			ndev->be.iface->alloc_rx_queue(ndev->be.be_dev,
> +			eth_dev->rx_queue[eth_dev->num_queues].id);
> +
> +		if (eth_dev->rx_queue[eth_dev->num_queues].hw_id < 0) {
> +			NT_LOG(ERR, FILTER, "ERROR: could not allocate a new queue");
> +			goto err_exit0;
> +		}
> +
> +		if (queue_ids)
> +			queue_ids[eth_dev->num_queues] = eth_dev->rx_queue[eth_dev->num_queues];
> +#endif
>

There is no clear way to set this build time configuration, hence easy
to miss testing it which leads to dead/broken code by time.
That is why it is better to convert these compile time configuration to
dynamic configuration.

For this set, are you OK to go with default value of the macro, for
SCATTER_GATHER as far as I can see it is defined by default?

Same for FLOW_DEBUG below. I can see it is used for log, in that case
dynamic logging should be used.



More information about the dev mailing list