Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b90a6d6 authored by Michael Wang's avatar Michael Wang Committed by Doug Ledford
Browse files

IB/Verbs: Implement new callback query_protocol()



Add new callback query_protocol() and implement for each HW.

Mapping List:
		node-type	link-layer	transport	protocol
nes		RNIC		ETH		IWARP		IWARP
amso1100	RNIC		ETH		IWARP		IWARP
cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB

Signed-off-by: default avatarMichael Wang <yun.wang@profitbricks.com>
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Tested-by: default avatarIra Weiny <ira.weiny@intel.com>
Reviewed-by: default avatarSean Hefty <sean.hefty@intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: default avatarDoug Ledford <dledford@redhat.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent e2608180
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ static int ib_device_check_mandatory(struct ib_device *device)
	} mandatory_table[] = {
		IB_MANDATORY_FUNC(query_device),
		IB_MANDATORY_FUNC(query_port),
		IB_MANDATORY_FUNC(query_protocol),
		IB_MANDATORY_FUNC(query_pkey),
		IB_MANDATORY_FUNC(query_gid),
		IB_MANDATORY_FUNC(alloc_pd),
+7 −0
Original line number Diff line number Diff line
@@ -99,6 +99,12 @@ static int c2_query_port(struct ib_device *ibdev,
	return 0;
}

static enum rdma_protocol_type
c2_query_protocol(struct ib_device *device, u8 port_num)
{
	return RDMA_PROTOCOL_IWARP;
}

static int c2_query_pkey(struct ib_device *ibdev,
			 u8 port, u16 index, u16 * pkey)
{
@@ -801,6 +807,7 @@ int c2_register_device(struct c2_dev *dev)
	dev->ibdev.dma_device = &dev->pcidev->dev;
	dev->ibdev.query_device = c2_query_device;
	dev->ibdev.query_port = c2_query_port;
	dev->ibdev.query_protocol = c2_query_protocol;
	dev->ibdev.query_pkey = c2_query_pkey;
	dev->ibdev.query_gid = c2_query_gid;
	dev->ibdev.alloc_ucontext = c2_alloc_ucontext;
+7 −0
Original line number Diff line number Diff line
@@ -1232,6 +1232,12 @@ static int iwch_query_port(struct ib_device *ibdev,
	return 0;
}

static enum rdma_protocol_type
iwch_query_protocol(struct ib_device *device, u8 port_num)
{
	return RDMA_PROTOCOL_IWARP;
}

static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
			char *buf)
{
@@ -1385,6 +1391,7 @@ int iwch_register_device(struct iwch_dev *dev)
	dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev);
	dev->ibdev.query_device = iwch_query_device;
	dev->ibdev.query_port = iwch_query_port;
	dev->ibdev.query_protocol = iwch_query_protocol;
	dev->ibdev.query_pkey = iwch_query_pkey;
	dev->ibdev.query_gid = iwch_query_gid;
	dev->ibdev.alloc_ucontext = iwch_alloc_ucontext;
+7 −0
Original line number Diff line number Diff line
@@ -390,6 +390,12 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port,
	return 0;
}

static enum rdma_protocol_type
c4iw_query_protocol(struct ib_device *device, u8 port_num)
{
	return RDMA_PROTOCOL_IWARP;
}

static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
			char *buf)
{
@@ -506,6 +512,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
	dev->ibdev.dma_device = &(dev->rdev.lldi.pdev->dev);
	dev->ibdev.query_device = c4iw_query_device;
	dev->ibdev.query_port = c4iw_query_port;
	dev->ibdev.query_protocol = c4iw_query_protocol;
	dev->ibdev.query_pkey = c4iw_query_pkey;
	dev->ibdev.query_gid = c4iw_query_gid;
	dev->ibdev.alloc_ucontext = c4iw_alloc_ucontext;
+6 −0
Original line number Diff line number Diff line
@@ -242,6 +242,12 @@ int ehca_query_port(struct ib_device *ibdev,
	return ret;
}

enum rdma_protocol_type
ehca_query_protocol(struct ib_device *device, u8 port_num)
{
	return RDMA_PROTOCOL_IB;
}

int ehca_query_sma_attr(struct ehca_shca *shca,
			u8 port, struct ehca_sma_attr *attr)
{
Loading