ibcore: Delete old files and add new ones missed in the initial commit

for this projects branch.

Sponsored by:	Mellanox Technologies
This commit is contained in:
hselasky 2017-07-03 08:32:52 +00:00
parent 609eb4edee
commit b877b0cf03
23 changed files with 88 additions and 0 deletions

View File

@ -755,6 +755,29 @@ void ib_enum_all_roce_netdevs(roce_netdev_filter filter,
up_read(&lists_rwsem);
}
/**
* ib_cache_gid_del_all_by_netdev - delete GIDs belonging a netdevice
*
* @ndev: Pointer to netdevice
*/
void ib_cache_gid_del_all_by_netdev(struct net_device *ndev)
{
struct ib_device *ib_dev;
u8 port;
down_read(&lists_rwsem);
list_for_each_entry(ib_dev, &device_list, core_list) {
for (port = rdma_start_port(ib_dev);
port <= rdma_end_port(ib_dev);
port++) {
if (rdma_protocol_roce(ib_dev, port) == 0)
continue;
(void) ib_cache_gid_del_all_netdev_gids(ib_dev, port, ndev);
}
}
up_read(&lists_rwsem);
}
/**
* ib_query_pkey - Get P_Key table entry
* @device:Device to query

View File

@ -43,6 +43,7 @@
#include <linux/file.h>
#include <linux/cdev.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <asm/uaccess.h>
@ -1117,6 +1118,44 @@ static int find_overflow_devnum(void)
return ret;
}
static ssize_t
show_dev_device(struct device *device, struct device_attribute *attr, char *buf)
{
struct ib_uverbs_device *dev = dev_get_drvdata(device);
if (!dev || !dev->ib_dev->dma_device)
return -ENODEV;
return sprintf(buf, "0x%04x\n",
((struct pci_dev *)dev->ib_dev->dma_device)->device);
}
static DEVICE_ATTR(device, S_IRUGO, show_dev_device, NULL);
static ssize_t
show_dev_vendor(struct device *device, struct device_attribute *attr, char *buf)
{
struct ib_uverbs_device *dev = dev_get_drvdata(device);
if (!dev || !dev->ib_dev->dma_device)
return -ENODEV;
return sprintf(buf, "0x%04x\n",
((struct pci_dev *)dev->ib_dev->dma_device)->vendor);
}
static DEVICE_ATTR(vendor, S_IRUGO, show_dev_vendor, NULL);
struct attribute *device_attrs[] =
{
&dev_attr_device.attr,
&dev_attr_vendor.attr,
NULL
};
static struct attribute_group device_group = {
.name = "device",
.attrs = device_attrs
};
static void ib_uverbs_add_one(struct ib_device *device)
{
int devnum;
@ -1186,6 +1225,8 @@ static void ib_uverbs_add_one(struct ib_device *device)
goto err_class;
if (device_create_file(uverbs_dev->dev, &dev_attr_abi_version))
goto err_class;
if (sysfs_create_group(&uverbs_dev->dev->kobj, &device_group))
goto err_class;
ib_set_client_data(device, &uverbs_client, uverbs_dev);
@ -1288,6 +1329,7 @@ static void ib_uverbs_remove_one(struct ib_device *device, void *client_data)
if (!uverbs_dev)
return;
sysfs_remove_group(&uverbs_dev->dev->kobj, &device_group);
dev_set_drvdata(uverbs_dev->dev, NULL);
device_destroy(uverbs_class, uverbs_dev->cdev.dev);
cdev_del(&uverbs_dev->cdev);

View File

@ -34,7 +34,11 @@
#ifndef IB_USER_CM_H
#define IB_USER_CM_H
#ifdef _KERNEL
#include <linux/types.h>
#else
#include <infiniband/types.h>
#endif
#include <rdma/ib_user_sa.h>
#define IB_USER_CM_ABI_VERSION 5

View File

@ -34,8 +34,13 @@
#ifndef IB_USER_MAD_H
#define IB_USER_MAD_H
#ifdef _KERNEL
#include <linux/types.h>
#include <linux/ioctl.h>
#else
#include <infiniband/types.h>
#include <sys/ioccom.h>
#endif
/*
* Increment this value if any changes that break userspace ABI

View File

@ -33,7 +33,11 @@
#ifndef IB_USER_SA_H
#define IB_USER_SA_H
#ifdef _KERNEL
#include <linux/types.h>
#else
#include <infiniband/types.h>
#endif
enum {
IB_PATH_GMP = 1,

View File

@ -36,7 +36,11 @@
#ifndef IB_USER_VERBS_H
#define IB_USER_VERBS_H
#ifdef _KERNEL
#include <linux/types.h>
#else
#include <infiniband/types.h>
#endif
/*
* Increment this value if any changes that break userspace ABI

View File

@ -33,9 +33,15 @@
#ifndef RDMA_USER_CM_H
#define RDMA_USER_CM_H
#ifdef _KERNEL
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/in6.h>
#else
#include <infiniband/types.h>
#include <netinet/in.h>
#endif
#include <rdma/ib_user_verbs.h>
#include <rdma/ib_user_sa.h>