RDMA/qedr: Add support for registering an iWARP device
There are slight differences between iWARP and RoCE in the ibdev registration. This patch handles the changes. Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com> Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:

committed by
Doug Ledford

parent
99d195cc08
commit
e6a38c54fa
@@ -70,6 +70,20 @@ int qedr_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int qedr_iw_query_gid(struct ib_device *ibdev, u8 port,
|
||||
int index, union ib_gid *sgid)
|
||||
{
|
||||
struct qedr_dev *dev = get_qedr_dev(ibdev);
|
||||
|
||||
memset(sgid->raw, 0, sizeof(sgid->raw));
|
||||
ether_addr_copy(sgid->raw, dev->ndev->dev_addr);
|
||||
|
||||
DP_DEBUG(dev, QEDR_MSG_INIT, "QUERY sgid[%d]=%llx:%llx\n", index,
|
||||
sgid->global.interface_id, sgid->global.subnet_prefix);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int qedr_query_gid(struct ib_device *ibdev, u8 port, int index,
|
||||
union ib_gid *sgid)
|
||||
{
|
||||
@@ -3600,23 +3614,3 @@ int qedr_process_mad(struct ib_device *ibdev, int process_mad_flags,
|
||||
mad_hdr->method, mad_hdr->mgmt_class, mad_hdr->status);
|
||||
return IB_MAD_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
int qedr_port_immutable(struct ib_device *ibdev, u8 port_num,
|
||||
struct ib_port_immutable *immutable)
|
||||
{
|
||||
struct ib_port_attr attr;
|
||||
int err;
|
||||
|
||||
immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE |
|
||||
RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP;
|
||||
|
||||
err = ib_query_port(ibdev, port_num, &attr);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
immutable->pkey_tbl_len = attr.pkey_tbl_len;
|
||||
immutable->gid_tbl_len = attr.gid_tbl_len;
|
||||
immutable->max_mad_size = IB_MGMT_MAD_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user