From c42260f1954598b92d9e834f3d55160318573a5e Mon Sep 17 00:00:00 2001 From: Vu Pham Date: Mon, 29 Apr 2019 18:14:05 +0000 Subject: net/mlx5: Separate and generalize dma device from pci device The mlx5 Sub-Function (SF) sub device will be introduced in subsequent patches. It will be created as mediated device and belong to mdev bus. It is necessary to treat dma operations on PF, VF and SF in uniform way, hence reduce the dependency on pdev pci dev struct and work directly out of newly introduced 'struct device' from previous patch. This patch does not change any functionality. Signed-off-by: Vu Pham Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/infiniband/hw/mlx5/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/infiniband/hw/mlx5') diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 3c76ee24a17e..44d00cc5ffe2 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -181,7 +181,7 @@ static int mlx5_netdev_event(struct notifier_block *this, ibdev->rep->vport); if (rep_ndev == ndev) roce->netdev = ndev; - } else if (ndev->dev.parent == &mdev->pdev->dev) { + } else if (ndev->dev.parent == mdev->device) { roce->netdev = ndev; } write_unlock(&roce->netdev_lock); @@ -5666,7 +5666,8 @@ static int mlx5_ib_init_multiport_master(struct mlx5_ib_dev *dev) } if (bound) { - dev_dbg(&mpi->mdev->pdev->dev, "removing port from unaffiliated list.\n"); + dev_dbg(mpi->mdev->device, + "removing port from unaffiliated list.\n"); mlx5_ib_dbg(dev, "port %d bound\n", i + 1); list_del(&mpi->list); break; @@ -5865,7 +5866,7 @@ int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev) dev->ib_dev.local_dma_lkey = 0 /* not supported for now */; dev->ib_dev.phys_port_cnt = dev->num_ports; dev->ib_dev.num_comp_vectors = mlx5_comp_vectors_count(mdev); - dev->ib_dev.dev.parent = &mdev->pdev->dev; + dev->ib_dev.dev.parent = mdev->device; mutex_init(&dev->cap_mask_mutex); INIT_LIST_HEAD(&dev->qp_list); @@ -6554,7 +6555,8 @@ static void *mlx5_ib_add_slave_port(struct mlx5_core_dev *mdev) if (!bound) { list_add_tail(&mpi->list, &mlx5_ib_unaffiliated_port_list); - dev_dbg(&mdev->pdev->dev, "no suitable IB device found to bind to, added to unaffiliated list.\n"); + dev_dbg(mdev->device, + "no suitable IB device found to bind to, added to unaffiliated list.\n"); } mutex_unlock(&mlx5_ib_multiport_mutex); -- cgit v1.2.3 From 6cfdc7e4684287cea37dcfbfb1b545273e757355 Mon Sep 17 00:00:00 2001 From: Aya Levin Date: Mon, 29 Apr 2019 18:14:07 +0000 Subject: IB/mlx5: Restrict 'DELAY_DROP_TIMEOUT' subtype to Ethernet interfaces Subtype 'DELAY_DROP_TIMEOUT' (under 'GENERAL' event) is restricted to Ethernet interfaces. This patch doesn't change functionality or breaks current flow. In the downstream patch, non Ethernet (like IB) interfaces will receive 'GENERAL' event. Fixes: 5d3c537f9070 ("net/mlx5: Handle event of power detection in the PCIE slot") Signed-off-by: Aya Levin Signed-off-by: Saeed Mahameed --- drivers/infiniband/hw/mlx5/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/infiniband/hw/mlx5') diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 44d00cc5ffe2..fae6a6a1fbea 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -4347,9 +4347,13 @@ static void delay_drop_handler(struct work_struct *work) static void handle_general_event(struct mlx5_ib_dev *ibdev, struct mlx5_eqe *eqe, struct ib_event *ibev) { + u8 port = (eqe->data.port.port >> 4) & 0xf; + switch (eqe->sub_type) { case MLX5_GENERAL_SUBTYPE_DELAY_DROP_TIMEOUT: - schedule_work(&ibdev->delay_drop.delay_drop_work); + if (mlx5_ib_port_link_layer(&ibdev->ib_dev, port) == + IB_LINK_LAYER_ETHERNET) + schedule_work(&ibdev->delay_drop.delay_drop_work); break; default: /* do nothing */ return; -- cgit v1.2.3