* Reconfigure the NIC. * * 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. * * @param hw * Device to reconfigure. * @param ctrl * The value for the ctrl field in the BAR config. * @param update * The value for the update field in the BAR config. * * @return * - (0) if OK to rec
| 78 | * - (-EIO) if I/O err and fail to reconfigure the device. |
| 79 | */ |
| 80 | int |
| 81 | nfp_reconfig(struct nfp_hw *hw, |
| 82 | uint32_t ctrl, |
| 83 | uint32_t update) |
| 84 | { |
| 85 | int ret; |
| 86 | |
| 87 | rte_spinlock_lock(&hw->reconfig_lock); |
| 88 | |
| 89 | nn_cfg_writel(hw, NFP_NET_CFG_CTRL, ctrl); |
| 90 | nn_cfg_writel(hw, NFP_NET_CFG_UPDATE, update); |
| 91 | |
| 92 | rte_wmb(); |
| 93 | |
| 94 | ret = nfp_reconfig_real(hw, update); |
| 95 | |
| 96 | rte_spinlock_unlock(&hw->reconfig_lock); |
| 97 | |
| 98 | if (ret != 0) { |
| 99 | PMD_DRV_LOG(ERR, "Error nfp reconfig: ctrl=%#08x update=%#08x", |
| 100 | ctrl, update); |
| 101 | return -EIO; |
| 102 | } |
| 103 | |
| 104 | return 0; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Reconfigure the NIC for the extend ctrl BAR. |
no test coverage detected