Skip to contentSkip to conversation

Export device and port properties

GIT PULL In review Leon Romanovsky 3 participants 15 messages Aug 15, 2017 – Aug 24, 2017 6 messages not in the archive

Subsystems (10)
lore
Share & tools
lore
#0 lore raw

Hi,

This is the third part of RDMAtool infrastructure changes. In this series, I'm exporting various device and port properties which are parsed in RDMAtool.

Due to the fact, that the "IB/hfi1: Document phys port state bits not used in IB", I embed its content into the actual patches.

As part of this series, I performed small code cleanup to improve our static checker situation.

Thanks

Cc: Dennis Dalessandro <[email protected]>
Cc: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
----------------------------------------------------------------
The following changes since commit 30307f91febf1b99947307a479c0a82c3af72f93:

Documentation: Hardware tag matching (2017-08-15 11:46:45 +0300)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git tags/rdma-next-2017-08-15-2

for you to fetch changes up to 9335303fee9bac70b5d5c143126b846d20df56d6:

RDMA: Use defines instead of hard coded value for phys_state (2017-08-15 11:46:53 +0300)

----------------------------------------------------------------
Export port properties, physical state and node types to the UAPI

----------------------------------------------------------------
Leon Romanovsky (8):
RDMA/mlx4: Properly annotate link layer variable RDMA/core: Export device capabilities flags RDMA/core: Provide node type flags
RDMA/core: Move port capabilities to UAPI RDMA/core: Move port state to UAPI and rename it to be link RDMA/core: Add physical link state information to the UAPI RDMA/nes: Remove zeroed parameter from port query callback
RDMA: Use defines instead of hard coded value for phys_state

 drivers/infiniband/core/sysfs.c              |  24 ++--
 drivers/infiniband/hw/bnxt_re/ib_verbs.c     |   4 +-
 drivers/infiniband/hw/hfi1/opa_compat.h      |  30 ++--
 drivers/infiniband/hw/hns/hns_roce_main.c    |   4 +-
 drivers/infiniband/hw/mlx4/main.c            |   4 +-
 drivers/infiniband/hw/mlx4/qp.c              |   6 +-
 drivers/infiniband/hw/mlx5/main.c            |   4 +-
 drivers/infiniband/hw/nes/nes_verbs.c        |   5 -
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |   4 +-
 drivers/infiniband/hw/qedr/verbs.c           |   4 +-
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |   6 +-
 drivers/infiniband/sw/rxe/rxe_param.h        |   2 +-
 include/rdma/ib_verbs.h                      | 135 +++++++++---------
 include/uapi/rdma/ib_user_verbs.h            |   1 +
 include/uapi/rdma/rdma.h                     | 196 +++++++++++++++++++++++++++
 15 files changed, 314 insertions(+), 115 deletions(-)
 create mode 100644 include/uapi/rdma/rdma.h

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170815091431.12822-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#2 lore raw

PATCH 1/8 RDMA/mlx4: Properly annotate link layer variable

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

The rdma_port_get_link_layer() returns enum rdma_link_layer as a return value, hence it is better to store the return value in specially annotated variable and not in int.

---
 drivers/infiniband/hw/mlx4/qp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/infiniband/hw/mlx4/qp.c +2 -4
index 2874d8790570..8c6ccc392d87 100644
@@ -2732,19 +2732,17 @@ enum {
 static int _mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 			      int attr_mask, struct ib_udata *udata)
 {
+	enum rdma_link_layer ll = IB_LINK_LAYER_UNSPECIFIED;
 	struct mlx4_ib_dev *dev = to_mdev(ibqp->device);
 	struct mlx4_ib_qp *qp = to_mqp(ibqp);
 	enum ib_qp_state cur_state, new_state;
 	int err = -EINVAL;
-	int ll;
 	mutex_lock(&qp->mutex);
 
 	cur_state = attr_mask & IB_QP_CUR_STATE ? attr->cur_qp_state : qp->state;
 	new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
 
-	if (cur_state == new_state && cur_state == IB_QPS_RESET) {
-		ll = IB_LINK_LAYER_UNSPECIFIED;
-	} else {
+	if (cur_state != new_state || cur_state != IB_QPS_RESET) {
 		int port = attr_mask & IB_QP_PORT ? attr->port_num : qp->port;
 		ll = rdma_port_get_link_layer(&dev->ib_dev, port);
 	}
Signature · 6 lines
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH 2/8 RDMA/core: Export device capabilities flags

In reply to a message not in the archive

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

Provide to the user space application the ability
to understand device capabilities.

---
 include/rdma/ib_verbs.h           |  68 ++++++++++++------------
 include/uapi/rdma/ib_user_verbs.h |   1 +
 include/uapi/rdma/rdma.h          | 106 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 140 insertions(+), 35 deletions(-)
 create mode 100644 include/uapi/rdma/rdma.h
include/rdma/ib_verbs.h +33 -35
index 80ede01d2237..bfedcda04ef7 100644
@@ -157,22 +157,21 @@ enum rdma_link_layer {
 };
 
 enum ib_device_cap_flags {
-	IB_DEVICE_RESIZE_MAX_WR			= (1 << 0),
-	IB_DEVICE_BAD_PKEY_CNTR			= (1 << 1),
-	IB_DEVICE_BAD_QKEY_CNTR			= (1 << 2),
-	IB_DEVICE_RAW_MULTI			= (1 << 3),
-	IB_DEVICE_AUTO_PATH_MIG			= (1 << 4),
-	IB_DEVICE_CHANGE_PHY_PORT		= (1 << 5),
-	IB_DEVICE_UD_AV_PORT_ENFORCE		= (1 << 6),
-	IB_DEVICE_CURR_QP_STATE_MOD		= (1 << 7),
-	IB_DEVICE_SHUTDOWN_PORT			= (1 << 8),
+	IB_DEVICE_RESIZE_MAX_WR			= RDMA_DEV_RESIZE_MAX_WR,
+	IB_DEVICE_BAD_PKEY_CNTR			= RDMA_DEV_BAD_PKEY_CNTR,
+	IB_DEVICE_BAD_QKEY_CNTR			= RDMA_DEV_BAD_QKEY_CNTR,
+	IB_DEVICE_RAW_MULTI			= RDMA_DEV_RAW_MULTI,
+	IB_DEVICE_AUTO_PATH_MIG			= RDMA_DEV_AUTO_PATH_MIG,
+	IB_DEVICE_CHANGE_PHY_PORT		= RDMA_DEV_CHANGE_PHY_PORT,
+	IB_DEVICE_UD_AV_PORT_ENFORCE		= RDMA_DEV_UD_AV_PORT_ENFORCE,
+	IB_DEVICE_CURR_QP_STATE_MOD		= RDMA_DEV_CURR_QP_STATE_MOD,
+	IB_DEVICE_SHUTDOWN_PORT			= RDMA_DEV_SHUTDOWN_PORT,
 	/* Not in use, former INIT_TYPE		= (1 << 9),*/
-	IB_DEVICE_PORT_ACTIVE_EVENT		= (1 << 10),
-	IB_DEVICE_SYS_IMAGE_GUID		= (1 << 11),
-	IB_DEVICE_RC_RNR_NAK_GEN		= (1 << 12),
-	IB_DEVICE_SRQ_RESIZE			= (1 << 13),
-	IB_DEVICE_N_NOTIFY_CQ			= (1 << 14),
-
+	IB_DEVICE_PORT_ACTIVE_EVENT		= RDMA_DEV_PORT_ACTIVE_EVENT,
+	IB_DEVICE_SYS_IMAGE_GUID		= RDMA_DEV_SYS_IMAGE_GUID,
+	IB_DEVICE_RC_RNR_NAK_GEN		= RDMA_DEV_RC_RNR_NAK_GEN,
+	IB_DEVICE_SRQ_RESIZE			= RDMA_DEV_SRQ_RESIZE,
+	IB_DEVICE_N_NOTIFY_CQ			= RDMA_DEV_N_NOTIFY_CQ,
 	/*
 	 * This device supports a per-device lkey or stag that can be
 	 * used without performing a memory registration for the local
@@ -180,9 +179,9 @@ enum ib_device_cap_flags {
 	 * instead of use the local_dma_lkey flag in the ib_pd structure,
 	 * which will always contain a usable lkey.
 	 */
-	IB_DEVICE_LOCAL_DMA_LKEY		= (1 << 15),
+	IB_DEVICE_LOCAL_DMA_LKEY		= RDMA_DEV_LOCAL_DMA_LKEY,
 	/* Reserved, old SEND_W_INV		= (1 << 16),*/
-	IB_DEVICE_MEM_WINDOW			= (1 << 17),
+	IB_DEVICE_MEM_WINDOW			= RDMA_DEV_MEM_WINDOW,
 	/*
 	 * Devices should set IB_DEVICE_UD_IP_SUM if they support
 	 * insertion of UDP and TCP checksum on outgoing UD IPoIB
@@ -190,10 +189,9 @@ enum ib_device_cap_flags {
 	 * incoming messages.  Setting this flag implies that the
 	 * IPoIB driver may set NETIF_F_IP_CSUM for datagram mode.
 	 */
-	IB_DEVICE_UD_IP_CSUM			= (1 << 18),
-	IB_DEVICE_UD_TSO			= (1 << 19),
-	IB_DEVICE_XRC				= (1 << 20),
-
+	IB_DEVICE_UD_IP_CSUM			= RDMA_DEV_UD_IP_CSUM,
+	IB_DEVICE_UD_TSO			= RDMA_DEV_UD_TSO,
+	IB_DEVICE_XRC				= RDMA_DEV_XRC,
 	/*
 	 * This device supports the IB "base memory management extension",
 	 * which includes support for fast registrations (IB_WR_REG_MR,
@@ -203,28 +201,28 @@ enum ib_device_cap_flags {
 	 * IB_WR_RDMA_READ_WITH_INV verb for RDMA READs that invalidate the
 	 * stag.
 	 */
-	IB_DEVICE_MEM_MGT_EXTENSIONS		= (1 << 21),
-	IB_DEVICE_BLOCK_MULTICAST_LOOPBACK	= (1 << 22),
-	IB_DEVICE_MEM_WINDOW_TYPE_2A		= (1 << 23),
-	IB_DEVICE_MEM_WINDOW_TYPE_2B		= (1 << 24),
-	IB_DEVICE_RC_IP_CSUM			= (1 << 25),
+	IB_DEVICE_MEM_MGT_EXTENSIONS		= RDMA_DEV_MEM_MGT_EXTENSIONS,
+	IB_DEVICE_BLOCK_MULTICAST_LOOPBACK	= RDMA_DEV_BLOCK_MULTICAST_LOOPBACK,
+	IB_DEVICE_MEM_WINDOW_TYPE_2A		= RDMA_DEV_MEM_WINDOW_TYPE_2A,
+	IB_DEVICE_MEM_WINDOW_TYPE_2B		= RDMA_DEV_MEM_WINDOW_TYPE_2B,
+	IB_DEVICE_RC_IP_CSUM			= RDMA_DEV_RC_IP_CSUM,
 	/* Deprecated. Please use IB_RAW_PACKET_CAP_IP_CSUM. */
-	IB_DEVICE_RAW_IP_CSUM			= (1 << 26),
+	IB_DEVICE_RAW_IP_CSUM			= RDMA_DEV_RAW_IP_CSUM,
 	/*
 	 * Devices should set IB_DEVICE_CROSS_CHANNEL if they
 	 * support execution of WQEs that involve synchronization
 	 * of I/O operations with single completion queue managed
 	 * by hardware.
 	 */
-	IB_DEVICE_CROSS_CHANNEL			= (1 << 27),
-	IB_DEVICE_MANAGED_FLOW_STEERING		= (1 << 29),
-	IB_DEVICE_SIGNATURE_HANDOVER		= (1 << 30),
-	IB_DEVICE_ON_DEMAND_PAGING		= (1ULL << 31),
-	IB_DEVICE_SG_GAPS_REG			= (1ULL << 32),
-	IB_DEVICE_VIRTUAL_FUNCTION		= (1ULL << 33),
+	IB_DEVICE_CROSS_CHANNEL			= RDMA_DEV_CROSS_CHANNEL,
+	IB_DEVICE_MANAGED_FLOW_STEERING		= RDMA_DEV_MANAGED_FLOW_STEERING,
+	IB_DEVICE_SIGNATURE_HANDOVER		= RDMA_DEV_SIGNATURE_HANDOVER,
+	IB_DEVICE_ON_DEMAND_PAGING		= RDMA_DEV_ON_DEMAND_PAGING,
+	IB_DEVICE_SG_GAPS_REG			= RDMA_DEV_SG_GAPS_REG,
+	IB_DEVICE_VIRTUAL_FUNCTION		= RDMA_DEV_VIRTUAL_FUNCTION,
 	/* Deprecated. Please use IB_RAW_PACKET_CAP_SCATTER_FCS. */
-	IB_DEVICE_RAW_SCATTER_FCS		= (1ULL << 34),
-	IB_DEVICE_RDMA_NETDEV_OPA_VNIC		= (1ULL << 35),
+	IB_DEVICE_RAW_SCATTER_FCS		= RDMA_DEV_RAW_SCATTER_FCS,
+	IB_DEVICE_RDMA_NETDEV_OPA_VNIC		= RDMA_DEV_RDMA_NETDEV_OPA_VNIC,
 };
 
 enum ib_signature_prot_cap {
include/uapi/rdma/ib_user_verbs.h +1 -0
index 9a0b6479fe0c..803106ffa93c 100644
@@ -37,6 +37,7 @@
 #define IB_USER_VERBS_H
 
 #include <linux/types.h>
+#include <rdma/rdma.h>
 
 /*
  * Increment this value if any changes that break userspace ABI
include/uapi/rdma/rdma.h new file +106 -0

106 lines not on this page · raw message

Signature · 6 lines
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

PATCH 3/8 RDMA/core: Provide node type flags

In reply to a message not in the archive

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

Expose node types for the user space applications.

---
 include/rdma/ib_verbs.h  | 7 -------
 include/uapi/rdma/rdma.h | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
include/rdma/ib_verbs.h +0 -7
index bfedcda04ef7..0aced267cc53 100644
@@ -93,13 +93,6 @@ struct ib_gid_attr {
 	struct net_device	*ndev;
 };
 
-enum rdma_node_type {
-	/* IB values map to NodeInfo:NodeType. */
-	RDMA_NODE_IB_CA		= 1,
-	RDMA_NODE_RNIC		= 4,
-	RDMA_NODE_USNIC_UDP	= 6,
-};
-
 enum {
 	/* set the local administered indication */
 	IB_SA_WELL_KNOWN_GUID	= BIT_ULL(57) | 2,
include/uapi/rdma/rdma.h +7 -0
index dcdf61474118..75c1baad313b 100644
@@ -103,4 +103,11 @@ enum rdma_dev_cap {
 	RDMA_DEV_RAW_SCATTER_FCS		= (1ULL << 34),
 	RDMA_DEV_RDMA_NETDEV_OPA_VNIC		= (1ULL << 35),
 };
+
+enum rdma_node_type {
+	/* IB values map to NodeInfo:NodeType. */
+	RDMA_NODE_IB_CA		= 1,
+	RDMA_NODE_RNIC		= 4,
+	RDMA_NODE_USNIC_UDP	= 6,
+};
 #endif /* _RDMA_H */
Signature · 6 lines
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

PATCH 4/8 RDMA/core: Move port capabilities to UAPI

In reply to a message not in the archive

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

Provide to user space applications ability to reuse kernel port capabilities enum.

---
 include/rdma/ib_verbs.h  | 48 ++++++++++++++++++++++++------------------------
 include/uapi/rdma/rdma.h | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 24 deletions(-)
include/rdma/ib_verbs.h +24 -24
index 0aced267cc53..a7cd54061f48 100644
@@ -392,30 +392,30 @@ enum ib_port_state {
 };
 
 enum ib_port_cap_flags {
-	IB_PORT_SM				= 1 <<  1,
-	IB_PORT_NOTICE_SUP			= 1 <<  2,
-	IB_PORT_TRAP_SUP			= 1 <<  3,
-	IB_PORT_OPT_IPD_SUP                     = 1 <<  4,
-	IB_PORT_AUTO_MIGR_SUP			= 1 <<  5,
-	IB_PORT_SL_MAP_SUP			= 1 <<  6,
-	IB_PORT_MKEY_NVRAM			= 1 <<  7,
-	IB_PORT_PKEY_NVRAM			= 1 <<  8,
-	IB_PORT_LED_INFO_SUP			= 1 <<  9,
-	IB_PORT_SM_DISABLED			= 1 << 10,
-	IB_PORT_SYS_IMAGE_GUID_SUP		= 1 << 11,
-	IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP	= 1 << 12,
-	IB_PORT_EXTENDED_SPEEDS_SUP             = 1 << 14,
-	IB_PORT_CM_SUP				= 1 << 16,
-	IB_PORT_SNMP_TUNNEL_SUP			= 1 << 17,
-	IB_PORT_REINIT_SUP			= 1 << 18,
-	IB_PORT_DEVICE_MGMT_SUP			= 1 << 19,
-	IB_PORT_VENDOR_CLASS_SUP		= 1 << 20,
-	IB_PORT_DR_NOTICE_SUP			= 1 << 21,
-	IB_PORT_CAP_MASK_NOTICE_SUP		= 1 << 22,
-	IB_PORT_BOOT_MGMT_SUP			= 1 << 23,
-	IB_PORT_LINK_LATENCY_SUP		= 1 << 24,
-	IB_PORT_CLIENT_REG_SUP			= 1 << 25,
-	IB_PORT_IP_BASED_GIDS			= 1 << 26,
+	IB_PORT_SM				= RDMA_PORT_SM,
+	IB_PORT_NOTICE_SUP			= RDMA_PORT_NOTICE,
+	IB_PORT_TRAP_SUP			= RDMA_PORT_TRAP,
+	IB_PORT_OPT_IPD_SUP                     = RDMA_PORT_OPT_IPD,
+	IB_PORT_AUTO_MIGR_SUP			= RDMA_PORT_AUTO_MIGR,
+	IB_PORT_SL_MAP_SUP			= RDMA_PORT_SL_MAP,
+	IB_PORT_MKEY_NVRAM			= RDMA_PORT_MKEY_NVRAM,
+	IB_PORT_PKEY_NVRAM			= RDMA_PORT_PKEY_NVRAM,
+	IB_PORT_LED_INFO_SUP			= RDMA_PORT_LED_INFO,
+	IB_PORT_SM_DISABLED			= RDMA_PORT_SM_DISABLED,
+	IB_PORT_SYS_IMAGE_GUID_SUP		= RDMA_PORT_SYS_IMAGE_GUID,
+	IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP	= RDMA_PORT_PKEY_SW_EXT_PORT_TRAP,
+	IB_PORT_EXTENDED_SPEEDS_SUP             = RDMA_PORT_EXTENDED_SPEEDS,
+	IB_PORT_CM_SUP				= RDMA_PORT_CM,
+	IB_PORT_SNMP_TUNNEL_SUP			= RDMA_PORT_SNMP_TUNNEL,
+	IB_PORT_REINIT_SUP			= RDMA_PORT_REINIT,
+	IB_PORT_DEVICE_MGMT_SUP			= RDMA_PORT_DEVICE_MGMT,
+	IB_PORT_VENDOR_CLASS_SUP		= RDMA_PORT_VENDOR_CLASS,
+	IB_PORT_DR_NOTICE_SUP			= RDMA_PORT_DR_NOTICE,
+	IB_PORT_CAP_MASK_NOTICE_SUP		= RDMA_PORT_CAP_MASK_NOTICE,
+	IB_PORT_BOOT_MGMT_SUP			= RDMA_PORT_BOOT_MGMT,
+	IB_PORT_LINK_LATENCY_SUP		= RDMA_PORT_LINK_LATENCY,
+	IB_PORT_CLIENT_REG_SUP			= RDMA_PORT_CLIENT_REG,
+	IB_PORT_IP_BASED_GIDS			= RDMA_PORT_IP_BASED_GIDS,
 };
 
 enum ib_port_width {
include/uapi/rdma/rdma.h +33 -0
index 75c1baad313b..397796e63a3a 100644
@@ -110,4 +110,37 @@ enum rdma_node_type {
 	RDMA_NODE_RNIC		= 4,
 	RDMA_NODE_USNIC_UDP	= 6,
 };
+
+/*
+ * This capability flags are taken from
+ * InfiniBandTM Architecture Specification Volume 1, Revision 1.3
+ * 14.2.5.6 PORTINFO - CapabilityMask
+ *
+ */
+enum rdma_port_cap {
+	RDMA_PORT_SM				= 1 <<  1,
+	RDMA_PORT_NOTICE			= 1 <<  2,
+	RDMA_PORT_TRAP				= 1 <<  3,
+	RDMA_PORT_OPT_IPD			= 1 <<  4,
+	RDMA_PORT_AUTO_MIGR			= 1 <<  5,
+	RDMA_PORT_SL_MAP			= 1 <<  6,
+	RDMA_PORT_MKEY_NVRAM			= 1 <<  7,
+	RDMA_PORT_PKEY_NVRAM			= 1 <<  8,
+	RDMA_PORT_LED_INFO			= 1 <<  9,
+	RDMA_PORT_SM_DISABLED			= 1 << 10,
+	RDMA_PORT_SYS_IMAGE_GUID		= 1 << 11,
+	RDMA_PORT_PKEY_SW_EXT_PORT_TRAP		= 1 << 12,
+	RDMA_PORT_EXTENDED_SPEEDS		= 1 << 14,
+	RDMA_PORT_CM				= 1 << 16,
+	RDMA_PORT_SNMP_TUNNEL			= 1 << 17,
+	RDMA_PORT_REINIT			= 1 << 18,
+	RDMA_PORT_DEVICE_MGMT			= 1 << 19,
+	RDMA_PORT_VENDOR_CLASS			= 1 << 20,
+	RDMA_PORT_DR_NOTICE			= 1 << 21,
+	RDMA_PORT_CAP_MASK_NOTICE		= 1 << 22,
+	RDMA_PORT_BOOT_MGMT			= 1 << 23,
+	RDMA_PORT_LINK_LATENCY			= 1 << 24,
+	RDMA_PORT_CLIENT_REG			= 1 << 25,
+	RDMA_PORT_IP_BASED_GIDS			= 1 << 26,
+};
 #endif /* _RDMA_H */
Signature · 6 lines
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

PATCH 5/8 RDMA/core: Move port state to UAPI and rename it to be link

In reply to a message not in the archive

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

Provide to user space applications ability to reuse kernel link state enum.

---
 include/rdma/ib_verbs.h  | 12 ++++++------
 include/uapi/rdma/rdma.h | 10 ++++++++++
 2 files changed, 16 insertions(+), 6 deletions(-)
include/rdma/ib_verbs.h +6 -6
index a7cd54061f48..7e9940244e38 100644
@@ -383,12 +383,12 @@ static inline enum ib_mtu ib_mtu_int_to_enum(int mtu)
 }
 
 enum ib_port_state {
-	IB_PORT_NOP		= 0,
-	IB_PORT_DOWN		= 1,
-	IB_PORT_INIT		= 2,
-	IB_PORT_ARMED		= 3,
-	IB_PORT_ACTIVE		= 4,
-	IB_PORT_ACTIVE_DEFER	= 5
+	IB_PORT_NOP		= RDMA_LINK_STATE_NOP,
+	IB_PORT_DOWN		= RDMA_LINK_STATE_DOWN,
+	IB_PORT_INIT		= RDMA_LINK_STATE_INIT,
+	IB_PORT_ARMED		= RDMA_LINK_STATE_ARMED,
+	IB_PORT_ACTIVE		= RDMA_LINK_STATE_ACTIVE,
+	IB_PORT_ACTIVE_DEFER	= RDMA_LINK_STATE_ACTIVE_DEFER
 };
 
 enum ib_port_cap_flags {
include/uapi/rdma/rdma.h +10 -0
index 397796e63a3a..5f4019e2c5d4 100644
@@ -143,4 +143,14 @@ enum rdma_port_cap {
 	RDMA_PORT_CLIENT_REG			= 1 << 25,
 	RDMA_PORT_IP_BASED_GIDS			= 1 << 26,
 };
+
+enum rdma_link_state {
+	RDMA_LINK_STATE_NOP,
+	RDMA_LINK_STATE_DOWN,
+	RDMA_LINK_STATE_INIT,
+	RDMA_LINK_STATE_ARMED,
+	RDMA_LINK_STATE_ACTIVE,
+	RDMA_LINK_STATE_ACTIVE_DEFER,
+};
+};
 #endif /* _RDMA_H */
Signature · 6 lines
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#7 lore raw

PATCH 6/8 RDMA/core: Add physical link state information to the UAPI

In reply to a message not in the archive

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

Add physical link state information to the UAPI and convert hardcoded values to use the exported enum.

---
 drivers/infiniband/core/sysfs.c | 24 ++++++++++++++++--------
 include/uapi/rdma/rdma.h        | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+), 8 deletions(-)
drivers/infiniband/core/sysfs.c +16 -8
index c43280f8d5b3..913919c6822b 100644
@@ -284,14 +284,22 @@ static ssize_t phys_state_show(struct ib_port *p, struct port_attribute *unused,
 		return ret;
 
 	switch (attr.phys_state) {
-	case 1:  return sprintf(buf, "1: Sleep\n");
-	case 2:  return sprintf(buf, "2: Polling\n");
-	case 3:  return sprintf(buf, "3: Disabled\n");
-	case 4:  return sprintf(buf, "4: PortConfigurationTraining\n");
-	case 5:  return sprintf(buf, "5: LinkUp\n");
-	case 6:  return sprintf(buf, "6: LinkErrorRecovery\n");
-	case 7:  return sprintf(buf, "7: Phy Test\n");
-	default: return sprintf(buf, "%d: <unknown>\n", attr.phys_state);
+	case RDMA_LINK_PHYS_STATE_SLEEP:
+		return sprintf(buf, "1: Sleep\n");
+	case RDMA_LINK_PHYS_STATE_POLLING:
+		return sprintf(buf, "2: Polling\n");
+	case RDMA_LINK_PHYS_STATE_DISABLED:
+		return sprintf(buf, "3: Disabled\n");
+	case RDMA_LINK_PHYS_STATE_PORT_CONFIGURATION_TRAINING:
+		return sprintf(buf, "4: PortConfigurationTraining\n");
+	case RDMA_LINK_PHYS_STATE_LINK_UP:
+		return sprintf(buf, "5: LinkUp\n");
+	case RDMA_LINK_PHYS_STATE_LINK_ERROR_RECOVER:
+		return sprintf(buf, "6: LinkErrorRecovery\n");
+	case RDMA_LINK_PHYS_STATE_LINK_PHY_TEST:
+		return sprintf(buf, "7: Phy Test\n");
+	default:
+		return sprintf(buf, "%d: <unknown>\n", attr.phys_state);
 	}
 }
 
include/uapi/rdma/rdma.h +40 -0
index 5f4019e2c5d4..42af3fe57b5a 100644
@@ -152,5 +152,45 @@ enum rdma_link_state {
 	RDMA_LINK_STATE_ACTIVE,
 	RDMA_LINK_STATE_ACTIVE_DEFER,
 };
+
+/*
+ * When writing this field, only values 0, 1, 2, and 3
+ * are valid. Other values are ignored. See InfiniBand Architecture
+ * Specification Volume 2, Link/Phy Interface chapter.
+ */
+enum rdma_link_phys_state {
+	/*
+	 * 0 - 7 are according to the IB specification
+	 * 8 - 15 -  Reserved and ignored in IB, but partially
+	 *	     in use by OmniPath
+	 */
+	RDMA_LINK_PHYS_STATE_NOP,
+	RDMA_LINK_PHYS_STATE_SLEEP,
+	RDMA_LINK_PHYS_STATE_POLLING,
+	RDMA_LINK_PHYS_STATE_DISABLED,
+	RDMA_LINK_PHYS_STATE_PORT_CONFIGURATION_TRAINING,
+	RDMA_LINK_PHYS_STATE_LINK_UP,
+	RDMA_LINK_PHYS_STATE_LINK_ERROR_RECOVER,
+	RDMA_LINK_PHYS_STATE_LINK_PHY_TEST,
+
+	/* 8 is reserved in OPA */
+
+	/*
+	 * Offline: Port is quiet (transmitters disabled) due to lack of
+	 * physical media, unsupported media, or transition between link up
+	 * and next link up attempt
+	 */
+	RDMA_LINK_PHYS_STATE_OFFLINE = 9,
+
+	/* 10 is reserved in OPA */
+
+	/*
+	 * Phy_Test: Specific test patterns are transmitted, and receiver BER
+	 * can be monitored. This facilitates signal integrity testing for the
+	 * physical layer of the port.
+	 */
+	RDMA_LINK_PHYS_STATE_TEST = 11,
+
+	/* values 12-15 are reserved/ignored */
 };
 #endif /* _RDMA_H */
Signature · 6 lines
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw

PATCH 7/8 RDMA/nes: Remove zeroed parameter from port query callback

In reply to a message not in the archive

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

There is no need to explicitly zero parameters, because the structure requested to be filled already initialized to zeros.

---
 drivers/infiniband/hw/nes/nes_verbs.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/infiniband/hw/nes/nes_verbs.c +0 -5
index c2943e39d2f9..f0dc5f4aa177 100644
@@ -481,21 +481,16 @@ static int nes_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr
 	props->active_mtu = ib_mtu_int_to_enum(netdev->mtu);
 
 	props->lid = 1;
-	props->lmc = 0;
-	props->sm_lid = 0;
-	props->sm_sl = 0;
 	if (netif_queue_stopped(netdev))
 		props->state = IB_PORT_DOWN;
 	else if (nesvnic->linkup)
 		props->state = IB_PORT_ACTIVE;
 	else
 		props->state = IB_PORT_DOWN;
-	props->phys_state = 0;
 	props->port_cap_flags = IB_PORT_CM_SUP | IB_PORT_REINIT_SUP |
 			IB_PORT_VENDOR_CLASS_SUP | IB_PORT_BOOT_MGMT_SUP;
 	props->gid_tbl_len = 1;
 	props->pkey_tbl_len = 1;
-	props->qkey_viol_cntr = 0;
 	props->active_width = IB_WIDTH_4X;
 	props->active_speed = IB_SPEED_SDR;
 	props->max_msg_sz = 0x80000000;
Signature · 6 lines
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#9 lore raw

PATCH 8/8 RDMA: Use defines instead of hard coded value for phys_state

In reply to a message not in the archive

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

There are new defines to express the physical state of the link, so let's reuse them instead hard-coded values.

---
 drivers/infiniband/hw/bnxt_re/ib_verbs.c     |  4 ++--
 drivers/infiniband/hw/hfi1/opa_compat.h      | 30 +++++++++++++++++-----------
 drivers/infiniband/hw/hns/hns_roce_main.c    |  4 +++-
 drivers/infiniband/hw/mlx4/main.c            |  4 +++-
 drivers/infiniband/hw/mlx5/main.c            |  4 ++--
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |  4 ++--
 drivers/infiniband/hw/qedr/verbs.c           |  4 ++--
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |  6 +++---
 drivers/infiniband/sw/rxe/rxe_param.h        |  2 +-
 9 files changed, 36 insertions(+), 26 deletions(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +2 -2
index d78fedc654d0..9bc28c756210 100644
@@ -234,10 +234,10 @@ int bnxt_re_query_port(struct ib_device *ibdev, u8 port_num,
 
 	if (netif_running(rdev->netdev) && netif_carrier_ok(rdev->netdev)) {
 		port_attr->state = IB_PORT_ACTIVE;
-		port_attr->phys_state = 5;
+		port_attr->phys_state = RDMA_LINK_PHYS_STATE_LINK_UP;
 	} else {
 		port_attr->state = IB_PORT_DOWN;
-		port_attr->phys_state = 3;
+		port_attr->phys_state = RDMA_LINK_PHYS_STATE_DISABLED;
 	}
 	port_attr->max_mtu = IB_MTU_4096;
 	port_attr->active_mtu = iboe_get_mtu(rdev->netdev->mtu);
drivers/infiniband/hw/hfi1/opa_compat.h +18 -12
index 6ef3c1cbdcd7..011ea5c89e25 100644
@@ -92,20 +92,26 @@ static inline u8 port_states_to_phys_state(struct opa_port_states *ps)
  * Returned by the ibphys_portstate() routine.
  */
 enum opa_port_phys_state {
-	IB_PORTPHYSSTATE_NOP = 0,
+	IB_PORTPHYSSTATE_NOP = RDMA_LINK_PHYS_STATE_NOP,
+
 	/* 1 is reserved */
-	IB_PORTPHYSSTATE_POLLING = 2,
-	IB_PORTPHYSSTATE_DISABLED = 3,
-	IB_PORTPHYSSTATE_TRAINING = 4,
-	IB_PORTPHYSSTATE_LINKUP = 5,
-	IB_PORTPHYSSTATE_LINK_ERROR_RECOVERY = 6,
-	IB_PORTPHYSSTATE_PHY_TEST = 7,
+
+	IB_PORTPHYSSTATE_POLLING = RDMA_LINK_PHYS_STATE_POLLING,
+	IB_PORTPHYSSTATE_DISABLED = RDMA_LINK_PHYS_STATE_DISABLED,
+	IB_PORTPHYSSTATE_TRAINING = RDMA_LINK_PHYS_STATE_PORT_CONFIGURATION_TRAINING,
+	IB_PORTPHYSSTATE_LINKUP = RDMA_LINK_PHYS_STATE_LINK_UP,
+	IB_PORTPHYSSTATE_LINK_ERROR_RECOVERY = RDMA_LINK_PHYS_STATE_LINK_ERROR_RECOVER,
+	IB_PORTPHYSSTATE_PHY_TEST = RDMA_LINK_PHYS_STATE_LINK_PHY_TEST,
+
 	/* 8 is reserved */
-	OPA_PORTPHYSSTATE_OFFLINE = 9,
-	OPA_PORTPHYSSTATE_GANGED = 10,
-	OPA_PORTPHYSSTATE_TEST = 11,
-	OPA_PORTPHYSSTATE_MAX = 11,
+
+	OPA_PORTPHYSSTATE_OFFLINE = RDMA_LINK_PHYS_STATE_OFFLINE,
+
+	/* 10 is reserved */
+
+	OPA_PORTPHYSSTATE_TEST = RDMA_LINK_PHYS_STATE_TEST,
+	OPA_PORTPHYSSTATE_MAX = OPA_PORTPHYSSTATE_TEST,
+
 	/* values 12-15 are reserved/ignored */
 };
-
 #endif /* _LINUX_H */
drivers/infiniband/hw/hns/hns_roce_main.c +3 -1
index d9777b662eba..48e88357d1c4 100644
@@ -272,7 +272,9 @@ static int hns_roce_query_port(struct ib_device *ib_dev, u8 port_num,
 	props->active_mtu = mtu ? min(props->max_mtu, mtu) : IB_MTU_256;
 	props->state = (netif_running(net_dev) && netif_carrier_ok(net_dev)) ?
 			IB_PORT_ACTIVE : IB_PORT_DOWN;
-	props->phys_state = (props->state == IB_PORT_ACTIVE) ? 5 : 3;
+	props->phys_state = (props->state == IB_PORT_ACTIVE) ?
+			    RDMA_LINK_PHYS_STATE_LINK_UP :
+			    RDMA_LINK_PHYS_STATE_DISABLED;
 
 	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
 
drivers/infiniband/hw/mlx4/main.c +3 -1
index c636842c5be0..d1598ef15406 100644
@@ -694,7 +694,9 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port,
 
 static u8 state_to_phys_state(enum ib_port_state state)
 {
-	return state == IB_PORT_ACTIVE ? 5 : 3;
+	return state == IB_PORT_ACTIVE ?
+		RDMA_LINK_PHYS_STATE_LINK_UP :
+		RDMA_LINK_PHYS_STATE_DISABLED;
 }
 
 static int eth_link_query_port(struct ib_device *ibdev, u8 port,
drivers/infiniband/hw/mlx5/main.c +2 -2
index 894aec4a7c9d..8b3f19060a67 100644
@@ -282,7 +282,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num,
 	props->max_msg_sz       = 1 << MLX5_CAP_GEN(dev->mdev, log_max_msg);
 	props->pkey_tbl_len     = 1;
 	props->state            = IB_PORT_DOWN;
-	props->phys_state       = 3;
+	props->phys_state       = RDMA_LINK_PHYS_STATE_DISABLED;
 
 	mlx5_query_nic_vport_qkey_viol_cntr(dev->mdev, &qkey_viol_cntr);
 	props->qkey_viol_cntr = qkey_viol_cntr;
@@ -304,7 +304,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num,
 
 	if (netif_running(ndev) && netif_carrier_ok(ndev)) {
 		props->state      = IB_PORT_ACTIVE;
-		props->phys_state = 5;
+		props->phys_state = RDMA_LINK_PHYS_STATE_LINK_UP;
 	}
 
 	ndev_ib_mtu = iboe_get_mtu(ndev->mtu);
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +2 -2
index 27d5e8d9f08d..32e7a04b027f 100644
@@ -220,10 +220,10 @@ int ocrdma_query_port(struct ib_device *ibdev,
 	netdev = dev->nic_info.netdev;
 	if (netif_running(netdev) && netif_oper_up(netdev)) {
 		port_state = IB_PORT_ACTIVE;
-		props->phys_state = 5;
+		props->phys_state = RDMA_LINK_PHYS_STATE_LINK_UP;
 	} else {
 		port_state = IB_PORT_DOWN;
-		props->phys_state = 3;
+		props->phys_state = RDMA_LINK_PHYS_STATE_DISABLED;
 	}
 	props->max_mtu = IB_MTU_4096;
 	props->active_mtu = iboe_get_mtu(netdev->mtu);
drivers/infiniband/hw/qedr/verbs.c +2 -2
index 9ee2dce3e5bb..724921aad51b 100644
@@ -251,10 +251,10 @@ int qedr_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr *attr)
 	/* *attr being zeroed by the caller, avoid zeroing it here */
 	if (rdma_port->port_state == QED_RDMA_PORT_UP) {
 		attr->state = IB_PORT_ACTIVE;
-		attr->phys_state = 5;
+		attr->phys_state = RDMA_LINK_PHYS_STATE_LINK_UP;
 	} else {
 		attr->state = IB_PORT_DOWN;
-		attr->phys_state = 3;
+		attr->phys_state = RDMA_LINK_PHYS_STATE_DISABLED;
 	}
 	attr->max_mtu = IB_MTU_4096;
 	attr->active_mtu = iboe_get_mtu(dev->ndev->mtu);
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +3 -3
index e5f57dd49980..8889b549a6bc 100644
@@ -324,13 +324,13 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
 
 	if (!us_ibdev->ufdev->link_up) {
 		props->state = IB_PORT_DOWN;
-		props->phys_state = 3;
+		props->phys_state = RDMA_LINK_PHYS_STATE_DISABLED;
 	} else if (!us_ibdev->ufdev->inaddr) {
 		props->state = IB_PORT_INIT;
-		props->phys_state = 4;
+		props->phys_state = RDMA_LINK_PHYS_STATE_PORT_CONFIGURATION_TRAINING;
 	} else {
 		props->state = IB_PORT_ACTIVE;
-		props->phys_state = 5;
+		props->phys_state = RDMA_LINK_PHYS_STATE_LINK_UP;
 	}
 
 	props->port_cap_flags = 0;
drivers/infiniband/sw/rxe/rxe_param.h +1 -1
index 1b596fbbe251..475767262102 100644
@@ -157,7 +157,7 @@ enum rxe_port_param {
 	RXE_PORT_ACTIVE_WIDTH		= IB_WIDTH_1X,
 	RXE_PORT_ACTIVE_SPEED		= 1,
 	RXE_PORT_PKEY_TBL_LEN		= 64,
-	RXE_PORT_PHYS_STATE		= 2,
+	RXE_PORT_PHYS_STATE		= RDMA_LINK_PHYS_STATE_POLLING,
 	RXE_PORT_SUBNET_PREFIX		= 0xfe80000000000000ULL,
 };
 
Signature · 6 lines
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170815091431.12822-9-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#11 lore raw

Re: [rdma-next 8/8] RDMA: Use defines instead of hard coded value for phys_state

Quoted 13 lines · On 8/15/17, 5:14 AM, "[email protected]…

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

There are new defines to express the physical state of the link, so let's reuse them instead hard-coded values.

---

drivers/infiniband/sw/rxe/rxe_param.h +0 -0
index 1b596fbbe251..475767262102 100644

drivers/infiniband/sw/rxe/rxe_param.h enum rxe_port_param { · line 162

Quoted 7 lines
drivers/infiniband/sw/rxe/rxe_param.h +1 -1
@@ -157,7 +157,7 @@ enum rxe_port_param {
 	RXE_PORT_ACTIVE_WIDTH		= IB_WIDTH_1X,
 	RXE_PORT_ACTIVE_SPEED		= 1,
 	RXE_PORT_PKEY_TBL_LEN		= 64,
-	RXE_PORT_PHYS_STATE		= 2,
+	RXE_PORT_PHYS_STATE		= RDMA_LINK_PHYS_STATE_POLLING,
 	RXE_PORT_SUBNET_PREFIX		= 0xfe80000000000000ULL,
 };

You can also remove IB_PHYS_STATE_* from rxe.h and the places where they¹re used.

Quoted 8 lines
Signature · 7 lines
-- 
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): D5C31047.1DB0A%[email protected]

#13 lore raw

Re: [rdma-next 8/8] RDMA: Use defines instead of hard coded value for phys_state

Quoted 21 lines · Andrew
Quoted 15 lines · On 8/15/17, 5:14 AM, "[email protected]…

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

There are new defines to express the physical state of the link, so let's reuse them instead hard-coded values.

---

drivers/infiniband/sw/rxe/rxe_param.h +0 -0
index 1b596fbbe251..475767262102 100644
@@ -157,7 +157,7 @@ enum rxe_port_param {
 	RXE_PORT_ACTIVE_WIDTH		= IB_WIDTH_1X,
 	RXE_PORT_ACTIVE_SPEED		= 1,
Quoted 8 lines

drivers/infiniband/sw/rxe/rxe_param.h enum rxe_port_param { · line 162

Quoted 5 lines
drivers/infiniband/sw/rxe/rxe_param.h +1 -1
 	RXE_PORT_PKEY_TBL_LEN		= 64,
-	RXE_PORT_PHYS_STATE		= 2,
+	RXE_PORT_PHYS_STATE		= RDMA_LINK_PHYS_STATE_POLLING,
 	RXE_PORT_SUBNET_PREFIX		= 0xfe80000000000000ULL,
 };

You can also remove IB_PHYS_STATE_* from rxe.h and the places where they¹re used.

At the end, I found the way to avoid the whole this series. This series is dropped.

Thanks

Quoted 10 lines
Quoted 9 lines
drivers/infiniband/sw/rxe/rxe_param.h +0 -1
--

2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170823152915.GQ1724-U/[email protected]

#15 lore raw

Re: [rdma-next 8/8] RDMA: Use defines instead of hard coded value for phys_state

T24gOC8yMy8xNywgMTE6MjkgQU0sICJMZW9uIFJvbWFub3Zza3kiIDxsZW9uQGtlcm5lbC5vcmc+ IHdyb3RlOg0KDQo+T24gV2VkLCBBdWcgMjMsIDIwMTcgYXQgMDI6NTk6NTJQTSArMDAwMCwgQm95 ZXIsIEFuZHJldyB3cm90ZToNCj4+DQo+Pg0KPj4gT24gOC8xNS8xNywgNToxNCBBTSwgImxpbnV4 LXJkbWEtb3duZXJAdmdlci5rZXJuZWwub3JnIG9uIGJlaGFsZiBvZiBMZW9uDQo+PiBSb21hbm92 c2t5IiA8bGludXgtcmRtYS1vd25lckB2Z2VyLmtlcm5lbC5vcmcgb24gYmVoYWxmIG9mDQo+PiBs ZW9uQGtlcm5lbC5vcmc+IHdyb3RlOg0KPj4NCj4+ID5Gcm9tOiBMZW9uIFJvbWFub3Zza3kgPGxl b25yb0BtZWxsYW5veC5jb20+DQo+PiA+DQo+PiA+VGhlcmUgYXJlIG5ldyBkZWZpbmVzIHRvIGV4 cHJlc3MgdGhlIHBoeXNpY2FsIHN0YXRlIG9mIHRoZSBsaW5rLCBzbw0KPj4gPmxldCdzIHJldXNl IHRoZW0gaW5zdGVhZCBoYXJkLWNvZGVkIHZhbHVlcy4NCj4+ID4NCj4+ID5TaWduZWQtb2ZmLWJ5 OiBMZW9uIFJvbWFub3Zza3kgPGxlb25yb0BtZWxsYW5veC5jb20+DQo+PiA+LS0tDQo+PiA+ZGlm ZiAtLWdpdCBhL2RyaXZlcnMvaW5maW5pYmFuZC9zdy9yeGUvcnhlX3BhcmFtLmgNCj4+ID5iL2Ry aXZlcnMvaW5maW5pYmFuZC9zdy9yeGUvcnhlX3BhcmFtLmgNCj4+ID5pbmRleCAxYjU5NmZiYmUy NTEuLjQ3NTc2NzI2MjEwMiAxMDA2NDQNCj4+ID4tLS0gYS9kcml2ZXJzL2luZmluaWJhbmQvc3cv cnhlL3J4ZV9wYXJhbS5oDQo+PiA+KysrIGIvZHJpdmVycy9pbmZpbmliYW5kL3N3L3J4ZS9yeGVf cGFyYW0uaA0KPj4gPkBAIC0xNTcsNyArMTU3LDcgQEAgZW51bSByeGVfcG9ydF9wYXJhbSB7DQo+ PiA+IAlSWEVfUE9SVF9BQ1RJVkVfV0lEVEgJCT0gSUJfV0lEVEhfMVgsDQo+PiA+IAlSWEVfUE9S VF9BQ1RJVkVfU1BFRUQJCT0gMSwNCj4+ID4gCVJYRV9QT1JUX1BLRVlfVEJMX0xFTgkJPSA2NCwN Cj4+ID4tCVJYRV9QT1JUX1BIWVNfU1RBVEUJCT0gMiwNCj4+ID4rCVJYRV9QT1JUX1BIWVNfU1RB VEUJCT0gUkRNQV9MSU5LX1BIWVNfU1RBVEVfUE9MTElORywNCj4+ID4gCVJYRV9QT1JUX1NVQk5F VF9QUkVGSVgJCT0gMHhmZTgwMDAwMDAwMDAwMDAwVUxMLA0KPj4gPiB9Ow0KPj4NCj4+IFlvdSBj YW4gYWxzbyByZW1vdmUgSUJfUEhZU19TVEFURV8qIGZyb20gcnhlLmggYW5kIHRoZSBwbGFjZXMg d2hlcmUNCj4+IHRoZXmp9nJlIHVzZWQuDQo+DQo+QXQgdGhlIGVuZCwgSSBmb3VuZCB0aGUgd2F5 IHRvIGF2b2lkIHRoZSB3aG9sZSB0aGlzIHNlcmllcy4NCj5UaGlzIHNlcmllcyBpcyBkcm9wcGVk Lg0KPg0KPlRoYW5rcw0KDQpXb3VsZCB5b3Ugb2JqZWN0IGlmIEkgYWRkZWQgc2ltaWxhciAvIG1h dGNoaW5nIGRlZmluZXMgaW4gaWJfdmVyYnMuaD8NCg0KVGhlIHBoeXNfc3RhdGUgZmllbGQgYWxs b3dzIHVzZXJzcGFjZSB0byBkaXN0aW5ndWlzaCBiZXR3ZWVuIGEgbGluayB0aGF0oa9zDQpkb3du IGFuZCBhIGxpbmsgdGhhdKGvcyB0dXJuZWQgb2ZmLCBidXQgb25seSBhIGZldyBkcml2ZXJzIHNl ZW0gdG8gc3VwcG9ydA0KaXQuDQoNCi1BbmRyZXcNCg0KDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): D5C444A5.1DC28%[email protected]

#17 lore raw

Re: [rdma-next 8/8] RDMA: Use defines instead of hard coded value for phys_state

Quoted 33 lines · Andrew
Quoted 31 lines · Leon Romanovsky
Quoted 29 lines · Andrew
Quoted 13 lines · On 8/15/17, 5:14 AM, "[email protected]…

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

There are new defines to express the physical state of the link, so let's reuse them instead hard-coded values.

---

drivers/infiniband/sw/rxe/rxe_param.h +0 -0
index 1b596fbbe251..475767262102 100644

drivers/infiniband/sw/rxe/rxe_param.h enum rxe_port_param { · line 162

Quoted 7 lines
drivers/infiniband/sw/rxe/rxe_param.h +1 -1
@@ -157,7 +157,7 @@ enum rxe_port_param {
 	RXE_PORT_ACTIVE_WIDTH		= IB_WIDTH_1X,
 	RXE_PORT_ACTIVE_SPEED		= 1,
 	RXE_PORT_PKEY_TBL_LEN		= 64,
-	RXE_PORT_PHYS_STATE		= 2,
+	RXE_PORT_PHYS_STATE		= RDMA_LINK_PHYS_STATE_POLLING,
 	RXE_PORT_SUBNET_PREFIX		= 0xfe80000000000000ULL,
 };

You can also remove IB_PHYS_STATE_* from rxe.h and the places where they¹re used.

Quoted 6 lines
Quoted 4 lines

At the end, I found the way to avoid the whole this series. This series is dropped.

Thanks

Would you object if I added similar / matching defines in ib_verbs.h?

Of course not, it will be good to see most of the cleanups from this pull request, so feel free to resend/base your work on it.

Quoted 8 lines

The phys_state field allows userspace to distinguish between a link that’s down and a link that’s turned off, but only a few drivers seem to support it.

-Andrew

#18 lore raw
In reply to a message not in the archive
Quoted 9 lines · Leon Romanovsky

Hi,

This is the third part of RDMAtool infrastructure changes. In this series, I'm exporting various device and port properties which are parsed in RDMAtool.

Due to the fact, that the "IB/hfi1: Document phys port state bits not used in IB", I embed its content into the actual patches.

Quoted 8 lines

As part of this series, I performed small code cleanup to improve our static checker situation.

Thanks

Cc: Dennis Dalessandro <[email protected]>
Cc: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
----------------------------------------------------------------

Doug,
To be clear, this PR is not needed.

Thanks,

A message that is not in the archive (sent off-list or not yet received): 20170823162718.GS1724-U/[email protected]

#20 lore raw
Quoted 17 lines · Leon Romanovsky
Quoted 16 lines · Leon Romanovsky

Hi,

This is the third part of RDMAtool infrastructure changes. In this series,
I'm exporting various device and port properties which are parsed in
RDMAtool.

Due to the fact, that the "IB/hfi1: Document phys port state bits not
used in IB", I embed its content into the actual patches.

As part of this series, I performed small code cleanup to improve our
static checker situation.

Quoted 8 lines
Quoted 5 lines

Thanks

Cc: Dennis Dalessandro <[email protected]>
Cc: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
----------------------------------------------------------------

Doug,
To be clear, this PR is not needed.

Dropped.

Signature · 8 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html