Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1604036

[PATCH v6 06/15] mlx5: Replace PCI pool old API

From Romain Perier <romain.perier@collabora.com>
Newsgroups linux.kernel
Subject [PATCH v6 06/15] mlx5: Replace PCI pool old API
Date 2017-03-19 18:10 +0100
Message-ID <tmMv8-oz-23@gated-at.bofh.it> (permalink)
References <tmMv8-oz-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The PCI pool API is deprecated. This commit replaces the PCI pool old
API by the appropriate function with the DMA pool API.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Reviewed-by: Peter Senna Tschudin <peter.senna@collabora.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 11 ++++++-----
 include/linux/mlx5/driver.h                   |  2 +-
 2 files changed, 7 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..6eef344 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,8 @@ 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);
 	if (!cmd->pool)
 		return -ENOMEM;
 
@@ -1786,7 +1787,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 +1801,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 48d8b66..0e33e65 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v6 00/15] Replace PCI pool by DMA pool API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 10/15] scsi: lpfc: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 06/15] mlx5: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
    Re: [PATCH v6 06/15] mlx5: Replace PCI pool old API Leon Romanovsky <leon@kernel.org> - 2017-03-20 07:40 +0100
      Re: [PATCH v6 06/15] mlx5: Replace PCI pool old API Doug Ledford <dledford@redhat.com> - 2017-03-25 04:50 +0100
  [PATCH v6 04/15] net: e100: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 08/15] scsi: be2iscsi: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 02/15] dmaengine: pch_dma: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 07/15] wireless: ipw2200: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 11/15] scsi: megaraid: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 13/15] scsi: mvsas: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 03/15] IB/mthca: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
    Re: [PATCH v6 03/15] IB/mthca: Replace PCI pool old API Doug Ledford <dledford@redhat.com> - 2017-03-25 06:30 +0100
  [PATCH v6 12/15] scsi: mpt3sas: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 09/15] scsi: csiostor: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 01/15] block: DAC960: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:10 +0100
  [PATCH v6 14/15] scsi: pmcraid: Replace PCI pool old API Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:20 +0100
  [PATCH v6 15/15] PCI: Remove PCI pool macro functions Romain Perier <romain.perier@collabora.com> - 2017-03-19 18:20 +0100

csiph-web