lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20170208182633.GF16878@collabora.com>
Date:   Wed, 8 Feb 2017 19:26:33 +0100
From:   Peter Senna Tschudin <peter.senna@...labora.com>
To:     Romain Perier <romain.perier@...labora.com>
Cc:     Dan Williams <dan.j.williams@...el.com>,
        Doug Ledford <dledford@...hat.com>,
        Sean Hefty <sean.hefty@...el.com>,
        Hal Rosenstock <hal.rosenstock@...il.com>,
        jeffrey.t.kirsher@...el.com,
        "David S. Miller" <davem@...emloft.net>, stas.yakovlev@...il.com,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-rdma@...r.kernel.org, netdev@...r.kernel.org,
        linux-usb@...r.kernel.org, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Peter Senna Tschudin <peter.senna@...labora.co.uk>
Subject: Re: [RFC 06/19] mlx5: Replace PCI pool old API

On Wed, Feb 08, 2017 at 05:34:44PM +0100, Romain Perier wrote:
> The PCI pool API is deprecated. This commits replaces the PCI pool old
> API by the appropriated function with the DMA pool API.



> 
> Signed-off-by: Romain Perier <romain.perier@...labora.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 10 +++++-----
>  include/linux/mlx5/driver.h                   |  2 +-
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
> index caa837e..7885e2b 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
> @@ -1061,7 +1061,7 @@ static struct mlx5_cmd_mailbox *alloc_cmd_box(struct mlx5_core_dev *dev,
>  	if (!mailbox)
>  		return ERR_PTR(-ENOMEM);
>  
> -	mailbox->buf = pci_pool_zalloc(dev->cmd.pool, flags,
> +	mailbox->buf = dma_pool_zalloc(dev->cmd.pool, flags,
>  				       &mailbox->dma);
>  	if (!mailbox->buf) {
>  		mlx5_core_dbg(dev, "failed allocation\n");
> @@ -1076,7 +1076,7 @@ static struct mlx5_cmd_mailbox *alloc_cmd_box(struct mlx5_core_dev *dev,
>  static void free_cmd_box(struct mlx5_core_dev *dev,
>  			 struct mlx5_cmd_mailbox *mailbox)
>  {
> -	pci_pool_free(dev->cmd.pool, mailbox->buf, mailbox->dma);
> +	dma_pool_free(dev->cmd.pool, mailbox->buf, mailbox->dma);
>  	kfree(mailbox);
>  }
>  
> @@ -1696,7 +1696,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)
>  		return -EINVAL;
>  	}
>  
> -	cmd->pool = pci_pool_create("mlx5_cmd", dev->pdev, size, align, 0);
> +	cmd->pool = dma_pool_create("mlx5_cmd", &dev->pdev->dev, size, align, 0);
This introduces line over 80 characters warning. Please fix and
resubmit. Other than that, looks good. I tested by compiling it.

>  	if (!cmd->pool)
>  		return -ENOMEM;
>  
> @@ -1786,7 +1786,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)
>  	free_cmd_page(dev, cmd);
>  
>  err_free_pool:
> -	pci_pool_destroy(cmd->pool);
> +	dma_pool_destroy(cmd->pool);
>  
>  	return err;
>  }
> @@ -1800,6 +1800,6 @@ void mlx5_cmd_cleanup(struct mlx5_core_dev *dev)
>  	destroy_workqueue(cmd->wq);
>  	destroy_msg_cache(dev);
>  	free_cmd_page(dev, cmd);
> -	pci_pool_destroy(cmd->pool);
> +	dma_pool_destroy(cmd->pool);
>  }
>  EXPORT_SYMBOL(mlx5_cmd_cleanup);
> diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
> index 2fcff6b..13a267c 100644
> --- a/include/linux/mlx5/driver.h
> +++ b/include/linux/mlx5/driver.h
> @@ -284,7 +284,7 @@ struct mlx5_cmd {
>  	struct semaphore pages_sem;
>  	int	mode;
>  	struct mlx5_cmd_work_ent *ent_arr[MLX5_MAX_COMMANDS];
> -	struct pci_pool *pool;
> +	struct dma_pool *pool;
>  	struct mlx5_cmd_debug dbg;
>  	struct cmd_msg_cache cache[MLX5_NUM_COMMAND_CACHES];
>  	int checksum_disabled;
> -- 
> 2.9.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ