aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2015-06-06 14:38:32 -0400
committerDoug Ledford <dledford@redhat.com>2015-06-12 14:49:17 -0400
commit65995fee842fd9f1427b62be24053846d9c32102 (patch)
tree13fa6c4fc58ecfc9d6850017a51e4892f413fa96 /include/rdma
parent4cd7c9479aff33746af490fa4a5a7dee8654891a (diff)
IB/core: Add OPA MAD core capability flag
Add OPA MAD support flags to the core capability immutable flags. In addition add the rdma_cap_opa_mad helper function for core functions to use to detect OPA MAD support. OPA MADs share a common header with IBTA MADs but with some differences for increased performance. Sharing a common header with IBTA MADs allows us to share most of the MAD processing code when dealing with OPA MADs in addition to supporting some IBTA MADs on OPA devices. OPA MADs differ in the following ways: 1) MADs are variable size up to 2K IBTA defined MADs remain fixed at 256 bytes 2) OPA SMPs must carry valid PKeys 3) OPA SMP packets are a different format The MAD stack will use this new functionality to determine if OPA MAD processing should occur on individual device ports. Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 46c8eb8f1bc7..986fddb08579 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -374,6 +374,7 @@ union rdma_protocol_stats {
374#define RDMA_CORE_CAP_IB_CM 0x00000004 374#define RDMA_CORE_CAP_IB_CM 0x00000004
375#define RDMA_CORE_CAP_IW_CM 0x00000008 375#define RDMA_CORE_CAP_IW_CM 0x00000008
376#define RDMA_CORE_CAP_IB_SA 0x00000010 376#define RDMA_CORE_CAP_IB_SA 0x00000010
377#define RDMA_CORE_CAP_OPA_MAD 0x00000020
377 378
378/* Address format 0x000FF000 */ 379/* Address format 0x000FF000 */
379#define RDMA_CORE_CAP_AF_IB 0x00001000 380#define RDMA_CORE_CAP_AF_IB 0x00001000
@@ -397,6 +398,8 @@ union rdma_protocol_stats {
397 | RDMA_CORE_CAP_ETH_AH) 398 | RDMA_CORE_CAP_ETH_AH)
398#define RDMA_CORE_PORT_IWARP (RDMA_CORE_CAP_PROT_IWARP \ 399#define RDMA_CORE_PORT_IWARP (RDMA_CORE_CAP_PROT_IWARP \
399 | RDMA_CORE_CAP_IW_CM) 400 | RDMA_CORE_CAP_IW_CM)
401#define RDMA_CORE_PORT_INTEL_OPA (RDMA_CORE_PORT_IBA_IB \
402 | RDMA_CORE_CAP_OPA_MAD)
400 403
401struct ib_port_attr { 404struct ib_port_attr {
402 enum ib_port_state state; 405 enum ib_port_state state;
@@ -1886,6 +1889,31 @@ static inline bool rdma_cap_ib_mad(const struct ib_device *device, u8 port_num)
1886} 1889}
1887 1890
1888/** 1891/**
1892 * rdma_cap_opa_mad - Check if the port of device provides support for OPA
1893 * Management Datagrams.
1894 * @device: Device to check
1895 * @port_num: Port number to check
1896 *
1897 * Intel OmniPath devices extend and/or replace the InfiniBand Management
1898 * datagrams with their own versions. These OPA MADs share many but not all of
1899 * the characteristics of InfiniBand MADs.
1900 *
1901 * OPA MADs differ in the following ways:
1902 *
1903 * 1) MADs are variable size up to 2K
1904 * IBTA defined MADs remain fixed at 256 bytes
1905 * 2) OPA SMPs must carry valid PKeys
1906 * 3) OPA SMP packets are a different format
1907 *
1908 * Return: true if the port supports OPA MAD packet formats.
1909 */
1910static inline bool rdma_cap_opa_mad(struct ib_device *device, u8 port_num)
1911{
1912 return (device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_OPA_MAD)
1913 == RDMA_CORE_CAP_OPA_MAD;
1914}
1915
1916/**
1889 * rdma_cap_ib_smi - Check if the port of a device provides an Infiniband 1917 * rdma_cap_ib_smi - Check if the port of a device provides an Infiniband
1890 * Subnet Management Agent (SMA) on the Subnet Management Interface (SMI). 1918 * Subnet Management Agent (SMA) on the Subnet Management Interface (SMI).
1891 * @device: Device to check 1919 * @device: Device to check