]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/infiniband/hw/mlx5/main.c
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / drivers / infiniband / hw / mlx5 / main.c
index 9f3ba320ce70ee245ffcfb5242037cd1560f6e9f..d45772da09635c2164f4cef8bcf5255c17fe8cff 100644 (file)
@@ -3530,6 +3530,26 @@ static int mlx5_ib_get_hw_stats(struct ib_device *ibdev,
        return num_counters;
 }
 
+static struct net_device*
+mlx5_ib_alloc_rdma_netdev(struct ib_device *hca,
+                         u8 port_num,
+                         enum rdma_netdev_t type,
+                         const char *name,
+                         unsigned char name_assign_type,
+                         void (*setup)(struct net_device *))
+{
+       if (type != RDMA_NETDEV_IPOIB)
+               return ERR_PTR(-EOPNOTSUPP);
+
+       return mlx5_rdma_netdev_alloc(to_mdev(hca)->mdev, hca,
+                                     name, setup);
+}
+
+static void mlx5_ib_free_rdma_netdev(struct net_device *netdev)
+{
+       return mlx5_rdma_netdev_free(netdev);
+}
+
 static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
 {
        struct mlx5_ib_dev *dev;
@@ -3660,6 +3680,8 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
        dev->ib_dev.check_mr_status     = mlx5_ib_check_mr_status;
        dev->ib_dev.get_port_immutable  = mlx5_port_immutable;
        dev->ib_dev.get_dev_fw_str      = get_dev_fw_str;
+       dev->ib_dev.alloc_rdma_netdev   = mlx5_ib_alloc_rdma_netdev;
+       dev->ib_dev.free_rdma_netdev    = mlx5_ib_free_rdma_netdev;
        if (mlx5_core_is_pf(mdev)) {
                dev->ib_dev.get_vf_config       = mlx5_ib_get_vf_config;
                dev->ib_dev.set_vf_link_state   = mlx5_ib_set_vf_link_state;