#include <linux/mlx4/device.h>
#include <linux/mlx4/doorbell.h>
+#include <asm/xen/pci.h>
#include "mlx4.h"
#include "fw.h"
return 0;
}
+static int mlx4_update_numa_node(struct notifier_block *this,
+ unsigned long event, void *ptr)
+{
+ struct pci_dev *pdev = ptr;
+ struct mlx4_dev_persistent *persist;
+ struct mlx4_dev *dev;
+ int pxm;
+
+ persist = pci_get_drvdata(pdev);
+ dev = persist->dev;
+ pxm = dev_to_node(&pdev->dev);
+
+ dev_info(&pdev->dev, "Updating PXM to %d\n", pxm);
+
+ dev->numa_node = pxm;
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block pxm_notifier_block = {
+ .notifier_call = mlx4_update_numa_node,
+};
+
static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
int total_vfs, int *nvfs, struct mlx4_priv *priv,
int reset_flow)
atomic_dec(&pf_loading);
kfree(dev_cap);
+
+ /* Update numa_node if there are changes. */
+ register_pci_pxm_handler(&pxm_notifier_block, pdev);
+
return 0;
err_port:
if (priv->removed)
return;
+ unregister_pci_pxm_handler(&pxm_notifier_block, pdev);
/* saving current ports type for further use */
for (i = 0; i < dev->caps.num_ports; i++) {
dev->persist->curr_port_type[i] = dev->caps.port_type[i + 1];