Allocate memory for the NUMA node of the NTB device.
Unified · Split
| @@ -413,10 +413,12 @@ static int ndev_init_isr(struct intel_ntb_dev *ndev, · 412 unmodified lines | ||
| 413 | 413 | int msix_shift, int total_shift) |
| 414 | 414 | { |
| 415 | 415 | struct pci_dev *pdev; |
| 416 | − int rc, i, msix_count; | |
| 416 | + int rc, i, msix_count, node; | |
| 417 | 417 | |
| 418 | 418 | pdev = ndev_pdev(ndev); |
| 419 | 419 | |
| 420 | + node = dev_to_node(&pdev->dev); | |
| 421 | + | |
| 420 | 422 | /* Mask all doorbell interrupts */ |
| 421 | 423 | ndev->db_mask = ndev->db_valid_mask; |
| 422 | 424 | ndev->reg->db_iowrite(ndev->db_mask, |
| @@ -425,11 +427,13 @@ static int ndev_init_isr(struct intel_ntb_dev *ndev, · 2 unmodified lines | ||
| 425 | 427 | |
| 426 | 428 | /* Try to set up msix irq */ |
| 427 | 429 | |
| 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); | |
| 429 | 432 | if (!ndev->vec) |
| 430 | 433 | goto err_msix_vec_alloc; |
| 431 | 434 | |
| 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); | |
| 433 | 437 | if (!ndev->msix) |
| 434 | 438 | goto err_msix_alloc; |
| 435 | 439 | |
| @@ -1955,10 +1959,12 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev, · 1519 unmodified lines | ||
| 1955 | 1959 | const struct pci_device_id *id) |
| 1956 | 1960 | { |
| 1957 | 1961 | struct intel_ntb_dev *ndev; |
| 1958 | − int rc; | |
| 1962 | + int rc, node; | |
| 1963 | + | |
| 1964 | + node = dev_to_node(&pdev->dev); | |
| 1959 | 1965 | |
| 1960 | 1966 | if (pdev_is_bwd(pdev)) { |
| 1961 | − ndev = kzalloc(sizeof(*ndev), GFP_KERNEL); | |
| 1967 | + ndev = kzalloc_node(sizeof(*ndev), GFP_KERNEL, node); | |
| 1962 | 1968 | if (!ndev) { |
| 1963 | 1969 | rc = -ENOMEM; |
| 1964 | 1970 | goto err_ndev; |
| @@ -1975,7 +1981,7 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev, · 10 unmodified lines | ||
| 1975 | 1981 | goto err_init_dev; |
| 1976 | 1982 | |
| 1977 | 1983 | } else if (pdev_is_snb(pdev)) { |
| 1978 | − ndev = kzalloc(sizeof(*ndev), GFP_KERNEL); | |
| 1984 | + ndev = kzalloc_node(sizeof(*ndev), GFP_KERNEL, node); | |
| 1979 | 1985 | if (!ndev) { |
| 1980 | 1986 | rc = -ENOMEM; |
| 1981 | 1987 | goto err_ndev; |