[dpdk-dev] [PATCH v3 15/16] net/avp: device start and stop operations
Stephen Hemminger
stephen at networkplumber.org
Thu Mar 2 01:37:29 CET 2017
On Wed, 1 Mar 2017 19:20:07 -0500
Allain Legacy <allain.legacy at windriver.com> wrote:
> +
> +static void
> +avp_dev_close(struct rte_eth_dev *eth_dev)
> +{
> + struct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
> + int ret;
> +
> + rte_spinlock_lock(&avp->lock);
> + if (avp->flags & AVP_F_DETACHED) {
> + PMD_DRV_LOG(ERR, "Operation not supported during VM live migration\n");
> + goto unlock;
> + }
> +
> + /* remember current link state */
> + avp->flags &= ~AVP_F_LINKUP;
> + avp->flags &= ~AVP_F_CONFIGURED;
> +
> + ret = avp_dev_disable_interrupts(eth_dev);
> + if (ret < 0) {
> + PMD_DRV_LOG(ERR, "Failed to disable interrupts\n");
> + /* continue */
> + }
> +
> + /* update device state */
> + ret = avp_dev_ctrl_shutdown(eth_dev);
> + if (ret < 0) {
> + PMD_DRV_LOG(ERR, "Device shutdown failed by host, ret=%d\n",
> + ret);
> + goto unlock;
> + }
> +
> +unlock:
> + rte_spinlock_unlock(&avp->lock);
> +}
The second goto is unnecessary.
More information about the dev
mailing list