Commit 0e041fb5 authored by Allen Hubbe's avatar Allen Hubbe Committed by Jon Mason

NTB: Use NUMA memory in Intel driver

Allocate memory for the NUMA node of the NTB device.
Signed-off-by: default avatarAllen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
parent 1199aa61
...@@ -413,10 +413,12 @@ static int ndev_init_isr(struct intel_ntb_dev *ndev, ...@@ -413,10 +413,12 @@ static int ndev_init_isr(struct intel_ntb_dev *ndev,
int msix_shift, int total_shift) int msix_shift, int total_shift)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
int rc, i, msix_count; int rc, i, msix_count, node;
pdev = ndev_pdev(ndev); pdev = ndev_pdev(ndev);
node = dev_to_node(&pdev->dev);
/* Mask all doorbell interrupts */ /* Mask all doorbell interrupts */
ndev->db_mask = ndev->db_valid_mask; ndev->db_mask = ndev->db_valid_mask;
ndev->reg->db_iowrite(ndev->db_mask, ndev->reg->db_iowrite(ndev->db_mask,
...@@ -425,11 +427,13 @@ static int ndev_init_isr(struct intel_ntb_dev *ndev, ...@@ -425,11 +427,13 @@ static int ndev_init_isr(struct intel_ntb_dev *ndev,
/* Try to set up msix irq */ /* Try to set up msix irq */
ndev->vec = kcalloc(msix_max, sizeof(*ndev->vec), GFP_KERNEL); ndev->vec = kzalloc_node(msix_max * sizeof(*ndev->vec),
GFP_KERNEL, node);
if (!ndev->vec) if (!ndev->vec)
goto err_msix_vec_alloc; goto err_msix_vec_alloc;
ndev->msix = kcalloc(msix_max, sizeof(*ndev->msix), GFP_KERNEL); ndev->msix = kzalloc_node(msix_max * sizeof(*ndev->msix),
GFP_KERNEL, node);
if (!ndev->msix) if (!ndev->msix)
goto err_msix_alloc; goto err_msix_alloc;
...@@ -1955,10 +1959,12 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev, ...@@ -1955,10 +1959,12 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
struct intel_ntb_dev *ndev; struct intel_ntb_dev *ndev;
int rc; int rc, node;
node = dev_to_node(&pdev->dev);
if (pdev_is_bwd(pdev)) { if (pdev_is_bwd(pdev)) {
ndev = kzalloc(sizeof(*ndev), GFP_KERNEL); ndev = kzalloc_node(sizeof(*ndev), GFP_KERNEL, node);
if (!ndev) { if (!ndev) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_ndev; goto err_ndev;
...@@ -1975,7 +1981,7 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev, ...@@ -1975,7 +1981,7 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev,
goto err_init_dev; goto err_init_dev;
} else if (pdev_is_snb(pdev)) { } else if (pdev_is_snb(pdev)) {
ndev = kzalloc(sizeof(*ndev), GFP_KERNEL); ndev = kzalloc_node(sizeof(*ndev), GFP_KERNEL, node);
if (!ndev) { if (!ndev) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_ndev; goto err_ndev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment