예제 #1
0
파일: en_main.c 프로젝트: Abioy/kasan
static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr)
{
	struct mlx4_en_dev *mdev = endev_ptr;
	int i;

	mutex_lock(&mdev->state_lock);
	mdev->device_up = false;
	mutex_unlock(&mdev->state_lock);

	mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH)
		if (mdev->pndev[i])
			mlx4_en_destroy_netdev(mdev->pndev[i]);

	if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS)
		mlx4_en_remove_timestamp(mdev);

	flush_workqueue(mdev->workqueue);
	destroy_workqueue(mdev->workqueue);
	(void) mlx4_mr_free(dev, &mdev->mr);
	iounmap(mdev->uar_map);
	mlx4_uar_free(dev, &mdev->priv_uar);
	mlx4_pd_free(dev, mdev->priv_pdn);
	if (mdev->nb.notifier_call)
		unregister_netdevice_notifier(&mdev->nb);
	kfree(mdev);
}
예제 #2
0
static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr)
{
	struct mlx4_en_dev *mdev = endev_ptr;
	int i;

	mutex_lock(&mdev->state_lock);
	mdev->device_up = false;
	mutex_unlock(&mdev->state_lock);

	mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH)
		if (mdev->pndev[i])
			mlx4_en_destroy_netdev(mdev->pndev[i]);

	flush_workqueue(mdev->workqueue);
	destroy_workqueue(mdev->workqueue);
	mlx4_mr_free(dev, &mdev->mr);
	mlx4_uar_free(dev, &mdev->priv_uar);
	mlx4_pd_free(dev, mdev->priv_pdn);
	kfree(mdev);
}
예제 #3
0
파일: en_main.c 프로젝트: JabirTech/Source
static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr)
{
    struct mlx4_en_dev *mdev = endev_ptr;
    int i, ret;

    mutex_lock(&mdev->state_lock);
    mdev->device_up = false;
    mutex_unlock(&mdev->state_lock);

    mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH)
    if (mdev->pndev[i])
        mlx4_en_destroy_netdev(mdev->pndev[i]);

    flush_workqueue(mdev->workqueue);
    destroy_workqueue(mdev->workqueue);
    ret = mlx4_mr_free(dev, &mdev->mr);
    if (ret)
        mlx4_err(mdev, "Error deregistering MR. The system may have become unstable.");
    iounmap(mdev->uar_map);
    mlx4_uar_free(dev, &mdev->priv_uar);
    mlx4_pd_free(dev, mdev->priv_pdn);
    kfree(mdev);
}