IB/core: Add ability for drivers to report an alternate MAD size.

Add max MAD size to the device immutable data set and have all drivers that
support MADs report the current IB MAD size (IB_MGMT_MAD_SIZE) to the core.

Verify MAD size data in both the MAD core and when reading the immutable data.

OPA drivers will report alternate MAD sizes in subsequent patches.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
这个提交包含在:
Ira Weiny
2015-06-06 14:38:29 -04:00
提交者 Doug Ledford
父节点 da2dfaa3a3
当前提交 337877a466
修改 11 个文件,包含 43 行新增0 行删除

查看文件

@@ -1534,6 +1534,7 @@ struct ib_port_immutable {
int pkey_tbl_len;
int gid_tbl_len;
u32 core_cap_flags;
u32 max_mad_size;
};
struct ib_device {
@@ -2052,6 +2053,23 @@ static inline bool rdma_cap_read_multi_sge(struct ib_device *device,
return !(device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IWARP);
}
/**
* rdma_max_mad_size - Return the max MAD size required by this RDMA Port.
*
* @device: Device
* @port_num: Port number
*
* This MAD size includes the MAD headers and MAD payload. No other headers
* are included.
*
* Return the max MAD size required by the Port. Will return 0 if the port
* does not support MADs
*/
static inline size_t rdma_max_mad_size(const struct ib_device *device, u8 port_num)
{
return device->port_immutable[port_num].max_mad_size;
}
int ib_query_gid(struct ib_device *device,
u8 port_num, int index, union ib_gid *gid);