src/dpdk/drivers/net/nfp/nfp_net.c
static int
nfp_net_configure(struct rte_eth_dev *dev)
{
	struct rte_eth_conf *dev_conf;
	struct rte_eth_rxmode *rxmode;
	struct rte_eth_txmode *txmode;
	struct nfp_net_hw *hw;

	hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);

	/*
	 * A DPDK app sends info about how many queues to use and how
	 * those queues need to be configured. This is used by the
	 * DPDK core and it makes sure no more queues than those
	 * advertised by the driver are requested. This function is
	 * called after that internal process
	 */

	PMD_INIT_LOG(DEBUG, "Configure");

	dev_conf = &dev->data->dev_conf;
	rxmode = &dev_conf->rxmode;
	txmode = &dev_conf->txmode;

	if (rxmode->mq_mode & ETH_MQ_RX_RSS_FLAG)
		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;

	/* Checking TX mode */
	if (txmode->mq_mode) {
		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported");
		return -EINVAL;
	}

	/* Checking RX mode */
	if (rxmode->mq_mode & ETH_MQ_RX_RSS &&
	    !(hw->cap & NFP_NET_CFG_CTRL_RSS)) {
		PMD_INIT_LOG(INFO, "RSS not supported");
		return -EINVAL;
	}

	return 0;
}
/*
 * Configure an Ethernet device. This function must be invoked first
 * before any other function in the Ethernet API. This function can
 * also be re-invoked when a device is in the stopped state.
 */
Configure an Ethernet device. This function must be invoked first
before any other function in the Ethernet API. This function can
also be re-invoked when a device is in the stopped state.
Configure an Ethernet device . This function must be invoked first before any other function in the Ethernet API . This function can also be re - invoked when a device is in the stopped state .
static int
nfp_net_configure(struct rte_eth_dev *dev)
{
	struct rte_eth_conf *dev_conf;
	struct rte_eth_rxmode *rxmode;
	struct rte_eth_txmode *txmode;
	struct nfp_net_hw *hw;
	hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
	PMD_INIT_LOG(DEBUG, "Configure");
	dev_conf = &dev->data->dev_conf;
	rxmode = &dev_conf->rxmode;
	txmode = &dev_conf->txmode;
	if (rxmode->mq_mode & ETH_MQ_RX_RSS_FLAG)
		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
	if (txmode->mq_mode) {
		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported");
		return -EINVAL;
	}
	if (rxmode->mq_mode & ETH_MQ_RX_RSS &&
	    !(hw->cap & NFP_NET_CFG_CTRL_RSS)) {
		PMD_INIT_LOG(INFO, "RSS not supported");
		return -EINVAL;
	}
	return 0;
}
static int nfp_net_configure ( struct rte_eth_dev * dev ) { struct rte_eth_conf * dev_conf ; struct rte_eth_rxmode * rxmode ; struct rte_eth_txmode * txmode ; struct nfp_net_hw * hw ; hw = NFP_NET_DEV_PRIVATE_TO_HW ( dev -> data -> dev_private ) ; PMD_INIT_LOG ( DEBUG , " " ) ; dev_conf = & dev -> data -> dev_conf ; rxmode = & dev_conf -> rxmode ; txmode = & dev_conf -> txmode ; if ( rxmode -> mq_mode & ETH_MQ_RX_RSS_FLAG ) rxmode -> offloads |= DEV_RX_OFFLOAD_RSS_HASH ; if ( txmode -> mq_mode ) { PMD_INIT_LOG ( INFO , " " ) ; return - EINVAL ; } if ( rxmode -> mq_mode & ETH_MQ_RX_RSS && ! ( hw -> cap & NFP_NET_CFG_CTRL_RSS ) ) { PMD_INIT_LOG ( INFO , " " ) ; return - EINVAL ; } return 0 ; }
Configure an Ethernet device.
Configure an Ethernet device .
/*
	 * A DPDK app sends info about how many queues to use and how
	 * those queues need to be configured. This is used by the
	 * DPDK core and it makes sure no more queues than those
	 * advertised by the driver are requested. This function is
	 * called after that internal process
	 */ /* Checking TX mode */ /* Checking RX mode */