[PATCH 1/8] net/nfb: prepare for indirect queue mapping scheme

Stephen Hemminger stephen at networkplumber.org
Fri Jan 16 18:34:00 CET 2026


On Thu, 15 Jan 2026 16:16:49 +0100
spinler at cesnet.cz wrote:

> diff --git a/drivers/net/nfb/nfb.h b/drivers/net/nfb/nfb.h
> index d85c5fba62..ef41d100ac 100644
> --- a/drivers/net/nfb/nfb.h
> +++ b/drivers/net/nfb/nfb.h
> @@ -47,6 +47,10 @@ struct pmd_internals {
>  	uint16_t         max_txmac;
>  	struct nc_rxmac *rxmac[RTE_MAX_NC_RXMAC];
>  	struct nc_txmac *txmac[RTE_MAX_NC_TXMAC];
> +
> +	int             *queue_map_rx;
> +	int             *queue_map_tx;


Since these are queues, would prefer uint16_t rather than int.

> +
>  	struct nfb_device *nfb;
>  };
>  
> diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
> index 74728f91dd..247f78fe24 100644
> --- a/drivers/net/nfb/nfb_ethdev.c
> +++ b/drivers/net/nfb/nfb_ethdev.c
> @@ -510,6 +510,7 @@ static const struct eth_dev_ops ops = {
>  static int
>  nfb_eth_dev_init(struct rte_eth_dev *dev)
>  {
> +	int i;
>  	int ret;
>  	uint32_t mac_count;
>  	struct rte_eth_dev_data *data = dev->data;
> @@ -567,6 +568,23 @@ nfb_eth_dev_init(struct rte_eth_dev *dev)
>  	dev->rx_pkt_burst = nfb_eth_ndp_rx;
>  	dev->tx_pkt_burst = nfb_eth_ndp_tx;
>  
> +	internals->queue_map_rx = rte_malloc("NFB queue map",
> +			sizeof(*internals->queue_map_rx) *
> +			(priv->max_rx_queues + priv->max_tx_queues), 0);

Use rte_calloc() of arrays.
> +	if (internals->queue_map_rx == NULL) {


More information about the dev mailing list