diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2017-01-24 06:02:38 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-02-14 11:41:21 -0500 |
commit | ce1e055fb9aba56c80d84f63edfa102691f63d41 (patch) | |
tree | 580c36e9d811c7d57bc845348ba9d1d8ccfdd3e8 | |
parent | bc63f9d5580696a49d27056293e3ccd48b8b917e (diff) |
IB: Add protocol for USNIC
Add protocol definition for the proprietary the USNIC driver.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/hw/usnic/usnic_ib_main.c | 1 | ||||
-rw-r--r-- | include/rdma/ib_verbs.h | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_main.c b/drivers/infiniband/hw/usnic/usnic_ib_main.c index 0a89a955550b..dde0b23f6559 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_main.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_main.c | |||
@@ -325,6 +325,7 @@ static int usnic_port_immutable(struct ib_device *ibdev, u8 port_num, | |||
325 | if (err) | 325 | if (err) |
326 | return err; | 326 | return err; |
327 | 327 | ||
328 | immutable->core_cap_flags = RDMA_CORE_PORT_USNIC; | ||
328 | immutable->pkey_tbl_len = attr.pkey_tbl_len; | 329 | immutable->pkey_tbl_len = attr.pkey_tbl_len; |
329 | immutable->gid_tbl_len = attr.gid_tbl_len; | 330 | immutable->gid_tbl_len = attr.gid_tbl_len; |
330 | 331 | ||
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index f311c2593a85..07399023352b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -490,6 +490,7 @@ static inline struct rdma_hw_stats *rdma_alloc_hw_stats_struct( | |||
490 | #define RDMA_CORE_CAP_PROT_IWARP 0x00400000 | 490 | #define RDMA_CORE_CAP_PROT_IWARP 0x00400000 |
491 | #define RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP 0x00800000 | 491 | #define RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP 0x00800000 |
492 | #define RDMA_CORE_CAP_PROT_RAW_PACKET 0x01000000 | 492 | #define RDMA_CORE_CAP_PROT_RAW_PACKET 0x01000000 |
493 | #define RDMA_CORE_CAP_PROT_USNIC 0x02000000 | ||
493 | 494 | ||
494 | #define RDMA_CORE_PORT_IBA_IB (RDMA_CORE_CAP_PROT_IB \ | 495 | #define RDMA_CORE_PORT_IBA_IB (RDMA_CORE_CAP_PROT_IB \ |
495 | | RDMA_CORE_CAP_IB_MAD \ | 496 | | RDMA_CORE_CAP_IB_MAD \ |
@@ -515,6 +516,8 @@ static inline struct rdma_hw_stats *rdma_alloc_hw_stats_struct( | |||
515 | 516 | ||
516 | #define RDMA_CORE_PORT_RAW_PACKET (RDMA_CORE_CAP_PROT_RAW_PACKET) | 517 | #define RDMA_CORE_PORT_RAW_PACKET (RDMA_CORE_CAP_PROT_RAW_PACKET) |
517 | 518 | ||
519 | #define RDMA_CORE_PORT_USNIC (RDMA_CORE_CAP_PROT_USNIC) | ||
520 | |||
518 | struct ib_port_attr { | 521 | struct ib_port_attr { |
519 | u64 subnet_prefix; | 522 | u64 subnet_prefix; |
520 | enum ib_port_state state; | 523 | enum ib_port_state state; |
@@ -2350,6 +2353,11 @@ static inline bool rdma_protocol_raw_packet(const struct ib_device *device, u8 p | |||
2350 | return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_RAW_PACKET; | 2353 | return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_RAW_PACKET; |
2351 | } | 2354 | } |
2352 | 2355 | ||
2356 | static inline bool rdma_protocol_usnic(const struct ib_device *device, u8 port_num) | ||
2357 | { | ||
2358 | return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_USNIC; | ||
2359 | } | ||
2360 | |||
2353 | /** | 2361 | /** |
2354 | * rdma_cap_ib_mad - Check if the port of a device supports Infiniband | 2362 | * rdma_cap_ib_mad - Check if the port of a device supports Infiniband |
2355 | * Management Datagrams. | 2363 | * Management Datagrams. |