History

NTB: Use NUMA memory in Intel driver

Allocate memory for the NUMA node of the NTB device.

Allen Hubbe committed 11 years ago

Commit 0e041fb1 parent 1199aa61 file · +12 −6Browse files

Unified · Split

drivers/ntb/hw/intel/ntb_hw_intel.c+12−6
@@ -413,10 +413,12 @@ static int ndev_init_isr(struct intel_ntb_dev *ndev, · 412 unmodified lines
413413 int msix_shift, int total_shift)
414414 {
415415 struct pci_dev *pdev;
416− int rc, i, msix_count;
416+ int rc, i, msix_count, node;
417417
418418 pdev = ndev_pdev(ndev);
419419
420+ node = dev_to_node(&pdev->dev);
421+
420422 /* Mask all doorbell interrupts */
421423 ndev->db_mask = ndev->db_valid_mask;
422424 ndev->reg->db_iowrite(ndev->db_mask,
@@ -425,11 +427,13 @@ static int ndev_init_isr(struct intel_ntb_dev *ndev, · 2 unmodified lines
425427
426428 /* Try to set up msix irq */
427429
428− ndev->vec = kcalloc(msix_max, sizeof(*ndev->vec), GFP_KERNEL);
430+ ndev->vec = kzalloc_node(msix_max * sizeof(*ndev->vec),
431+ GFP_KERNEL, node);
429432 if (!ndev->vec)
430433 goto err_msix_vec_alloc;
431434
432− ndev->msix = kcalloc(msix_max, sizeof(*ndev->msix), GFP_KERNEL);
435+ ndev->msix = kzalloc_node(msix_max * sizeof(*ndev->msix),
436+ GFP_KERNEL, node);
433437 if (!ndev->msix)
434438 goto err_msix_alloc;
435439
@@ -1955,10 +1959,12 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev, · 1519 unmodified lines
19551959 const struct pci_device_id *id)
19561960 {
19571961 struct intel_ntb_dev *ndev;
1958− int rc;
1962+ int rc, node;
1963+
1964+ node = dev_to_node(&pdev->dev);
19591965
19601966 if (pdev_is_bwd(pdev)) {
1961− ndev = kzalloc(sizeof(*ndev), GFP_KERNEL);
1967+ ndev = kzalloc_node(sizeof(*ndev), GFP_KERNEL, node);
19621968 if (!ndev) {
19631969 rc = -ENOMEM;
19641970 goto err_ndev;
@@ -1975,7 +1981,7 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev, · 10 unmodified lines
19751981 goto err_init_dev;
19761982
19771983 } else if (pdev_is_snb(pdev)) {
1978− ndev = kzalloc(sizeof(*ndev), GFP_KERNEL);
1984+ ndev = kzalloc_node(sizeof(*ndev), GFP_KERNEL, node);
19791985 if (!ndev) {
19801986 rc = -ENOMEM;
19811987 goto err_ndev;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t