src/dpdk/drivers/net/nfp/nfp_net.c
static int
nfp_net_reconfig(struct nfp_net_hw *hw, uint32_t ctrl, uint32_t update)
{
	uint32_t err;

	PMD_DRV_LOG(DEBUG, "nfp_net_reconfig: ctrl=%08x update=%08x",
		    ctrl, update);

	rte_spinlock_lock(&hw->reconfig_lock);

	nn_cfg_writel(hw, NFP_NET_CFG_CTRL, ctrl);
	nn_cfg_writel(hw, NFP_NET_CFG_UPDATE, update);

	rte_wmb();

	err = __nfp_net_reconfig(hw, update);

	rte_spinlock_unlock(&hw->reconfig_lock);

	if (!err)
		return 0;

	/*
	 * Reconfig errors imply situations where they can be handled.
	 * Otherwise, rte_panic is called inside __nfp_net_reconfig
	 */
	PMD_INIT_LOG(ERR, "Error nfp_net reconfig for ctrl: %x update: %x",
		     ctrl, update);
	return -EIO;
}
/*
 * Reconfigure the NIC
 * @nn:    device to reconfigure
 * @ctrl:    The value for the ctrl field in the BAR config
 * @update:  The value for the update field in the BAR config
 *
 * Write the update word to the BAR and ping the reconfig queue. Then poll
 * until the firmware has acknowledged the update by zeroing the update word.
 */
Reconfigure the NIC
@nn:    device to reconfigure
@ctrl:    The value for the ctrl field in the BAR config
@update:  The value for the update field in the BAR config

Write the update word to the BAR and ping the reconfig queue. Then poll
until the firmware has acknowledged the update by zeroing the update word.
Reconfigure the NIC @nn : device to reconfigure @ctrl : The value for the ctrl field in the BAR config @update : The value for the update field in the BAR config Write the update word to the BAR and ping the reconfig queue . Then poll until the firmware has acknowledged the update by zeroing the update word .
static int
nfp_net_reconfig(struct nfp_net_hw *hw, uint32_t ctrl, uint32_t update)
{
	uint32_t err;
	PMD_DRV_LOG(DEBUG, "nfp_net_reconfig: ctrl=%08x update=%08x",
		    ctrl, update);
	rte_spinlock_lock(&hw->reconfig_lock);
	nn_cfg_writel(hw, NFP_NET_CFG_CTRL, ctrl);
	nn_cfg_writel(hw, NFP_NET_CFG_UPDATE, update);
	rte_wmb();
	err = __nfp_net_reconfig(hw, update);
	rte_spinlock_unlock(&hw->reconfig_lock);
	if (!err)
		return 0;
	PMD_INIT_LOG(ERR, "Error nfp_net reconfig for ctrl: %x update: %x",
		     ctrl, update);
	return -EIO;
}
static int nfp_net_reconfig ( struct nfp_net_hw * hw , uint32_t ctrl , uint32_t update ) { uint32_t err ; PMD_DRV_LOG ( DEBUG , " " , ctrl , update ) ; rte_spinlock_lock ( & hw -> reconfig_lock ) ; nn_cfg_writel ( hw , NFP_NET_CFG_CTRL , ctrl ) ; nn_cfg_writel ( hw , NFP_NET_CFG_UPDATE , update ) ; rte_wmb ( ) ; err = __nfp_net_reconfig ( hw , update ) ; rte_spinlock_unlock ( & hw -> reconfig_lock ) ; if ( ! err ) return 0 ; PMD_INIT_LOG ( ERR , " " , ctrl , update ) ; return - EIO ; }
Reconfigure the NIC
 @nn:    device to reconfigure
 @ctrl:    The value for the ctrl field in the BAR config
 @update:  The value for the update field in the BAR config
Reconfigure the NIC @nn : device to reconfigure @ctrl : The value for the ctrl field in the BAR config @update : The value for the update field in the BAR config
/*
	 * Reconfig errors imply situations where they can be handled.
	 * Otherwise, rte_panic is called inside __nfp_net_reconfig
	 */