src/dpdk/drivers/compress/mlx5/mlx5_compress.c
static int
mlx5_compress_pci_remove(struct rte_pci_device *pdev)
{
	struct mlx5_compress_priv *priv = NULL;

	pthread_mutex_lock(&priv_list_lock);
	TAILQ_FOREACH(priv, &mlx5_compress_priv_list, next)
		if (rte_pci_addr_cmp(&priv->pci_dev->addr, &pdev->addr) != 0)
			break;
	if (priv)
		TAILQ_REMOVE(&mlx5_compress_priv_list, priv, next);
	pthread_mutex_unlock(&priv_list_lock);
	if (priv) {
		mlx5_mr_release_cache(&priv->mr_scache);
		mlx5_compress_hw_global_release(priv);
		rte_compressdev_pmd_destroy(priv->cdev);
		claim_zero(mlx5_glue->close_device(priv->ctx));
	}
	return 0;
}
/**
 * DPDK callback to remove a PCI device.
 *
 * This function removes all compress devices belong to a given PCI device.
 *
 * @param[in] pci_dev
 *   Pointer to the PCI device.
 *
 * @return
 *   0 on success, the function cannot fail.
 */
DPDK callback to remove a PCI device.
This function removes all compress devices belong to a given PCI device.

@param[in] pci_dev
Pointer to the PCI device.

@return
0 on success, the function cannot fail.
DPDK callback to remove a PCI device . This function removes all compress devices belong to a given PCI device . @param [ in ] pci_dev Pointer to the PCI device . @return 0 on success the function cannot fail .
static int
mlx5_compress_pci_remove(struct rte_pci_device *pdev)
{
	struct mlx5_compress_priv *priv = NULL;
	pthread_mutex_lock(&priv_list_lock);
	TAILQ_FOREACH(priv, &mlx5_compress_priv_list, next)
		if (rte_pci_addr_cmp(&priv->pci_dev->addr, &pdev->addr) != 0)
			break;
	if (priv)
		TAILQ_REMOVE(&mlx5_compress_priv_list, priv, next);
	pthread_mutex_unlock(&priv_list_lock);
	if (priv) {
		mlx5_mr_release_cache(&priv->mr_scache);
		mlx5_compress_hw_global_release(priv);
		rte_compressdev_pmd_destroy(priv->cdev);
		claim_zero(mlx5_glue->close_device(priv->ctx));
	}
	return 0;
}
static int mlx5_compress_pci_remove ( struct rte_pci_device * pdev ) { struct mlx5_compress_priv * priv = NULL ; pthread_mutex_lock ( & priv_list_lock ) ; TAILQ_FOREACH ( priv , & mlx5_compress_priv_list , next ) if ( rte_pci_addr_cmp ( & priv -> pci_dev -> addr , & pdev -> addr ) != 0 ) break ; if ( priv ) TAILQ_REMOVE ( & mlx5_compress_priv_list , priv , next ) ; pthread_mutex_unlock ( & priv_list_lock ) ; if ( priv ) { mlx5_mr_release_cache ( & priv -> mr_scache ) ; mlx5_compress_hw_global_release ( priv ) ; rte_compressdev_pmd_destroy ( priv -> cdev ) ; claim_zero ( mlx5_glue -> close_device ( priv -> ctx ) ) ; } return 0 ; }
DPDK callback to remove a PCI device.
DPDK callback to remove a PCI device .