Skip to contentSkip to conversation

IB/Verbs: IB Management Helpers

PATCH Superseded Michael Wang 11 participants 110 messages Apr 20, 2015 – Apr 27, 2015 3 messages not in the archive

Subsystems (9)

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v5 cover IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the device/port.

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals below.

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB

For example:

	if (transport == IB) && (link-layer == ETH)
will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier for extending.

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be another series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Proposals:

    Sean:
	https://www.mail-archive.com/[email protected]/msg23339.html
    Doug:
	https://www.mail-archive.com/[email protected]/msg23418.html
	https://www.mail-archive.com/[email protected]/msg23765.html
    Jason:
	https://www.mail-archive.com/[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4 
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1 
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8 
 drivers/infiniband/core/ucm.c                |    5 
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6 
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7 
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7 
 drivers/infiniband/hw/cxgb4/provider.c       |    7 
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6 
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3 
 drivers/infiniband/hw/ehca/ehca_main.c       |    1 
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7 
 drivers/infiniband/hw/mlx4/main.c            |   10 
 drivers/infiniband/hw/mlx5/main.c            |    7 
 drivers/infiniband/hw/mthca/mthca_provider.c |    7 
 drivers/infiniband/hw/nes/nes_verbs.c        |    6 
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1 
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6 
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3 
 drivers/infiniband/hw/qib/qib_verbs.c        |    7 
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1 
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6 
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2 
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6 
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#1 lore raw

PATCH v5 1/27 IB/Verbs: Implement new callback query_transport()

Add new callback query_transport() and implement for each HW.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/device.c             |  1 +
 drivers/infiniband/core/verbs.c              |  4 +++-
 drivers/infiniband/hw/amso1100/c2_provider.c |  7 +++++++
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |  7 +++++++
 drivers/infiniband/hw/cxgb4/provider.c       |  7 +++++++
 drivers/infiniband/hw/ehca/ehca_hca.c        |  6 ++++++
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |  3 +++
 drivers/infiniband/hw/ehca/ehca_main.c       |  1 +
 drivers/infiniband/hw/ipath/ipath_verbs.c    |  7 +++++++
 drivers/infiniband/hw/mlx4/main.c            | 10 ++++++++++
 drivers/infiniband/hw/mlx5/main.c            |  7 +++++++
 drivers/infiniband/hw/mthca/mthca_provider.c |  7 +++++++
 drivers/infiniband/hw/nes/nes_verbs.c        |  6 ++++++
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |  1 +
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |  6 ++++++
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |  3 +++
 drivers/infiniband/hw/qib/qib_verbs.c        |  7 +++++++
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |  1 +
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |  6 ++++++
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |  2 ++
 include/rdma/ib_verbs.h                      |  7 ++++++-
 21 files changed, 104 insertions(+), 2 deletions(-)
drivers/infiniband/core/device.c +1 -0
index 18c1ece..a9587c4 100644
@@ -76,6 +76,7 @@ static int ib_device_check_mandatory(struct ib_device *device)
 	} mandatory_table[] = {
 		IB_MANDATORY_FUNC(query_device),
 		IB_MANDATORY_FUNC(query_port),
+		IB_MANDATORY_FUNC(query_transport),
 		IB_MANDATORY_FUNC(query_pkey),
 		IB_MANDATORY_FUNC(query_gid),
 		IB_MANDATORY_FUNC(alloc_pd),
drivers/infiniband/core/verbs.c +3 -1
index f93eb8d..626c9cf 100644
@@ -133,14 +133,16 @@ enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_
 	if (device->get_link_layer)
 		return device->get_link_layer(device, port_num);
 
-	switch (rdma_node_get_transport(device->node_type)) {
+	switch (device->query_transport(device, port_num)) {
 	case RDMA_TRANSPORT_IB:
 		return IB_LINK_LAYER_INFINIBAND;
+	case RDMA_TRANSPORT_IBOE:
 	case RDMA_TRANSPORT_IWARP:
 	case RDMA_TRANSPORT_USNIC:
 	case RDMA_TRANSPORT_USNIC_UDP:
 		return IB_LINK_LAYER_ETHERNET;
 	default:
+		BUG();
 		return IB_LINK_LAYER_UNSPECIFIED;
 	}
 }
drivers/infiniband/hw/amso1100/c2_provider.c +7 -0
index bdf3507..d46bbb0 100644
@@ -99,6 +99,12 @@ static int c2_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+c2_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static int c2_query_pkey(struct ib_device *ibdev,
 			 u8 port, u16 index, u16 * pkey)
 {
@@ -801,6 +807,7 @@ int c2_register_device(struct c2_dev *dev)
 	dev->ibdev.dma_device = &dev->pcidev->dev;
 	dev->ibdev.query_device = c2_query_device;
 	dev->ibdev.query_port = c2_query_port;
+	dev->ibdev.query_transport = c2_query_transport;
 	dev->ibdev.query_pkey = c2_query_pkey;
 	dev->ibdev.query_gid = c2_query_gid;
 	dev->ibdev.alloc_ucontext = c2_alloc_ucontext;
drivers/infiniband/hw/cxgb3/iwch_provider.c +7 -0
index 811b24a..09682e9e 100644
@@ -1232,6 +1232,12 @@ static int iwch_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+iwch_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
 			char *buf)
 {
@@ -1385,6 +1391,7 @@ int iwch_register_device(struct iwch_dev *dev)
 	dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev);
 	dev->ibdev.query_device = iwch_query_device;
 	dev->ibdev.query_port = iwch_query_port;
+	dev->ibdev.query_transport = iwch_query_transport;
 	dev->ibdev.query_pkey = iwch_query_pkey;
 	dev->ibdev.query_gid = iwch_query_gid;
 	dev->ibdev.alloc_ucontext = iwch_alloc_ucontext;
drivers/infiniband/hw/cxgb4/provider.c +7 -0
index 66bd6a2..a445e0d 100644
@@ -390,6 +390,12 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+static enum rdma_transport_type
+c4iw_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
 			char *buf)
 {
@@ -506,6 +512,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
 	dev->ibdev.dma_device = &(dev->rdev.lldi.pdev->dev);
 	dev->ibdev.query_device = c4iw_query_device;
 	dev->ibdev.query_port = c4iw_query_port;
+	dev->ibdev.query_transport = c4iw_query_transport;
 	dev->ibdev.query_pkey = c4iw_query_pkey;
 	dev->ibdev.query_gid = c4iw_query_gid;
 	dev->ibdev.alloc_ucontext = c4iw_alloc_ucontext;
drivers/infiniband/hw/ehca/ehca_hca.c +6 -0
index 9ed4d25..d5a34a6 100644
@@ -242,6 +242,12 @@ query_port1:
 	return ret;
 }
 
+enum rdma_transport_type
+ehca_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 int ehca_query_sma_attr(struct ehca_shca *shca,
 			u8 port, struct ehca_sma_attr *attr)
 {
drivers/infiniband/hw/ehca/ehca_iverbs.h +3 -0
index 22f79af..cec945f 100644
@@ -49,6 +49,9 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props);
 int ehca_query_port(struct ib_device *ibdev, u8 port,
 		    struct ib_port_attr *props);
 
+enum rdma_transport_type
+ehca_query_transport(struct ib_device *device, u8 port_num);
+
 int ehca_query_sma_attr(struct ehca_shca *shca, u8 port,
 			struct ehca_sma_attr *attr);
 
drivers/infiniband/hw/ehca/ehca_main.c +1 -0
index cd8d290..60e0a09 100644
@@ -467,6 +467,7 @@ static int ehca_init_device(struct ehca_shca *shca)
 	shca->ib_device.dma_device          = &shca->ofdev->dev;
 	shca->ib_device.query_device        = ehca_query_device;
 	shca->ib_device.query_port          = ehca_query_port;
+	shca->ib_device.query_transport     = ehca_query_transport;
 	shca->ib_device.query_gid           = ehca_query_gid;
 	shca->ib_device.query_pkey          = ehca_query_pkey;
 	/* shca->in_device.modify_device    = ehca_modify_device    */
drivers/infiniband/hw/ipath/ipath_verbs.c +7 -0
index 44ea939..58d36e3 100644
@@ -1638,6 +1638,12 @@ static int ipath_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+ipath_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int ipath_modify_device(struct ib_device *device,
 			       int device_modify_mask,
 			       struct ib_device_modify *device_modify)
@@ -2140,6 +2146,7 @@ int ipath_register_ib_device(struct ipath_devdata *dd)
 	dev->query_device = ipath_query_device;
 	dev->modify_device = ipath_modify_device;
 	dev->query_port = ipath_query_port;
+	dev->query_transport = ipath_query_transport;
 	dev->modify_port = ipath_modify_port;
 	dev->query_pkey = ipath_query_pkey;
 	dev->query_gid = ipath_query_gid;
drivers/infiniband/hw/mlx4/main.c +10 -0
index b972c0b..e1424ad 100644
@@ -420,6 +420,15 @@ static int mlx4_ib_query_port(struct ib_device *ibdev, u8 port,
 	return __mlx4_ib_query_port(ibdev, port, props, 0);
 }
 
+static enum rdma_transport_type
+mlx4_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	struct mlx4_dev *dev = to_mdev(device)->dev;
+
+	return dev->caps.port_mask[port_num] == MLX4_PORT_TYPE_IB ?
+		RDMA_TRANSPORT_IB : RDMA_TRANSPORT_IBOE;
+}
+
 int __mlx4_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
 			union ib_gid *gid, int netw_view)
 {
@@ -2201,6 +2210,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
 
 	ibdev->ib_dev.query_device	= mlx4_ib_query_device;
 	ibdev->ib_dev.query_port	= mlx4_ib_query_port;
+	ibdev->ib_dev.query_transport	= mlx4_ib_query_transport;
 	ibdev->ib_dev.get_link_layer	= mlx4_ib_port_link_layer;
 	ibdev->ib_dev.query_gid		= mlx4_ib_query_gid;
 	ibdev->ib_dev.query_pkey	= mlx4_ib_query_pkey;
drivers/infiniband/hw/mlx5/main.c +7 -0
index cc4ac1e..209c796 100644
@@ -351,6 +351,12 @@ out:
 	return err;
 }
 
+static enum rdma_transport_type
+mlx5_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int mlx5_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
 			     union ib_gid *gid)
 {
@@ -1336,6 +1342,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
 
 	dev->ib_dev.query_device	= mlx5_ib_query_device;
 	dev->ib_dev.query_port		= mlx5_ib_query_port;
+	dev->ib_dev.query_transport	= mlx5_ib_query_transport;
 	dev->ib_dev.query_gid		= mlx5_ib_query_gid;
 	dev->ib_dev.query_pkey		= mlx5_ib_query_pkey;
 	dev->ib_dev.modify_device	= mlx5_ib_modify_device;
drivers/infiniband/hw/mthca/mthca_provider.c +7 -0
index 415f8e1..67ac6a4 100644
@@ -179,6 +179,12 @@ static int mthca_query_port(struct ib_device *ibdev,
 	return err;
 }
 
+static enum rdma_transport_type
+mthca_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int mthca_modify_device(struct ib_device *ibdev,
 			       int mask,
 			       struct ib_device_modify *props)
@@ -1281,6 +1287,7 @@ int mthca_register_device(struct mthca_dev *dev)
 	dev->ib_dev.dma_device           = &dev->pdev->dev;
 	dev->ib_dev.query_device         = mthca_query_device;
 	dev->ib_dev.query_port           = mthca_query_port;
+	dev->ib_dev.query_transport      = mthca_query_transport;
 	dev->ib_dev.modify_device        = mthca_modify_device;
 	dev->ib_dev.modify_port          = mthca_modify_port;
 	dev->ib_dev.query_pkey           = mthca_query_pkey;
drivers/infiniband/hw/nes/nes_verbs.c +6 -0
index c0d0296..8df5b61 100644
@@ -606,6 +606,11 @@ static int nes_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr
 	return 0;
 }
 
+static enum rdma_transport_type
+nes_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
 
 /**
  * nes_query_pkey
@@ -3879,6 +3884,7 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
 	nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev;
 	nesibdev->ibdev.query_device = nes_query_device;
 	nesibdev->ibdev.query_port = nes_query_port;
+	nesibdev->ibdev.query_transport = nes_query_transport;
 	nesibdev->ibdev.query_pkey = nes_query_pkey;
 	nesibdev->ibdev.query_gid = nes_query_gid;
 	nesibdev->ibdev.alloc_ucontext = nes_alloc_ucontext;
drivers/infiniband/hw/ocrdma/ocrdma_main.c +1 -0
index 7a2b59a..9f4d182 100644
@@ -244,6 +244,7 @@ static int ocrdma_register_device(struct ocrdma_dev *dev)
 	/* mandatory verbs. */
 	dev->ibdev.query_device = ocrdma_query_device;
 	dev->ibdev.query_port = ocrdma_query_port;
+	dev->ibdev.query_transport = ocrdma_query_transport;
 	dev->ibdev.modify_port = ocrdma_modify_port;
 	dev->ibdev.query_gid = ocrdma_query_gid;
 	dev->ibdev.get_link_layer = ocrdma_link_layer;
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +6 -0
index 8771755..73bace4 100644
@@ -187,6 +187,12 @@ int ocrdma_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+enum rdma_transport_type
+ocrdma_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IBOE;
+}
+
 int ocrdma_modify_port(struct ib_device *ibdev, u8 port, int mask,
 		       struct ib_port_modify *props)
 {
drivers/infiniband/hw/ocrdma/ocrdma_verbs.h +3 -0
index b8f7853..4a81b63 100644
@@ -41,6 +41,9 @@ int ocrdma_query_port(struct ib_device *, u8 port, struct ib_port_attr *props);
 int ocrdma_modify_port(struct ib_device *, u8 port, int mask,
 		       struct ib_port_modify *props);
 
+enum rdma_transport_type
+ocrdma_query_transport(struct ib_device *device, u8 port_num);
+
 void ocrdma_get_guid(struct ocrdma_dev *, u8 *guid);
 int ocrdma_query_gid(struct ib_device *, u8 port,
 		     int index, union ib_gid *gid);
drivers/infiniband/hw/qib/qib_verbs.c +7 -0
index 4a35998..caad665 100644
@@ -1650,6 +1650,12 @@ static int qib_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+static enum rdma_transport_type
+qib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int qib_modify_device(struct ib_device *device,
 			     int device_modify_mask,
 			     struct ib_device_modify *device_modify)
@@ -2184,6 +2190,7 @@ int qib_register_ib_device(struct qib_devdata *dd)
 	ibdev->query_device = qib_query_device;
 	ibdev->modify_device = qib_modify_device;
 	ibdev->query_port = qib_query_port;
+	ibdev->query_transport = qib_query_transport;
 	ibdev->modify_port = qib_modify_port;
 	ibdev->query_pkey = qib_query_pkey;
 	ibdev->query_gid = qib_query_gid;
drivers/infiniband/hw/usnic/usnic_ib_main.c +1 -0
index 0d0f986..03ea9f3 100644
@@ -360,6 +360,7 @@ static void *usnic_ib_device_add(struct pci_dev *dev)
 
 	us_ibdev->ib_dev.query_device = usnic_ib_query_device;
 	us_ibdev->ib_dev.query_port = usnic_ib_query_port;
+	us_ibdev->ib_dev.query_transport = usnic_ib_query_transport;
 	us_ibdev->ib_dev.query_pkey = usnic_ib_query_pkey;
 	us_ibdev->ib_dev.query_gid = usnic_ib_query_gid;
 	us_ibdev->ib_dev.get_link_layer = usnic_ib_port_link_layer;
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +6 -0
index 53bd6a2..ff9a5f7 100644
@@ -348,6 +348,12 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+enum rdma_transport_type
+usnic_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_USNIC_UDP;
+}
+
 int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
 				int qp_attr_mask,
 				struct ib_qp_init_attr *qp_init_attr)
drivers/infiniband/hw/usnic/usnic_ib_verbs.h +2 -0
index bb864f5..0b1633b 100644
@@ -27,6 +27,8 @@ int usnic_ib_query_device(struct ib_device *ibdev,
 				struct ib_device_attr *props);
 int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
 				struct ib_port_attr *props);
+enum rdma_transport_type
+usnic_ib_query_transport(struct ib_device *device, u8 port_num);
 int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
 				int qp_attr_mask,
 				struct ib_qp_init_attr *qp_init_attr);
include/rdma/ib_verbs.h +6 -1
index 65994a1..d54f91e 100644
@@ -75,10 +75,13 @@ enum rdma_node_type {
 };
 
 enum rdma_transport_type {
+	/* legacy for users */
 	RDMA_TRANSPORT_IB,
 	RDMA_TRANSPORT_IWARP,
 	RDMA_TRANSPORT_USNIC,
-	RDMA_TRANSPORT_USNIC_UDP
+	RDMA_TRANSPORT_USNIC_UDP,
+	/* new transport */
+	RDMA_TRANSPORT_IBOE,
 };
 
 __attribute_const__ enum rdma_transport_type
@@ -1501,6 +1504,8 @@ struct ib_device {
 	int		           (*query_port)(struct ib_device *device,
 						 u8 port_num,
 						 struct ib_port_attr *port_attr);
+	enum rdma_transport_type   (*query_transport)(struct ib_device *device,
+						      u8 port_num);
 	enum rdma_link_layer	   (*get_link_layer)(struct ib_device *device,
 						     u8 port_num);
 	int		           (*query_gid)(struct ib_device *device,
Signature · 1 line
2.1.0
Reviewed-by on v5 1/27
#2 lore raw

Re: [PATCH v5 01/27] IB/Verbs: Implement new callback query_transport()

Quoted 18 lines · Michael Wang

Add new callback query_transport() and implement for each HW.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB
Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 443 lines
---
 drivers/infiniband/core/device.c             |  1 +
 drivers/infiniband/core/verbs.c              |  4 +++-
 drivers/infiniband/hw/amso1100/c2_provider.c |  7 +++++++
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |  7 +++++++
 drivers/infiniband/hw/cxgb4/provider.c       |  7 +++++++
 drivers/infiniband/hw/ehca/ehca_hca.c        |  6 ++++++
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |  3 +++
 drivers/infiniband/hw/ehca/ehca_main.c       |  1 +
 drivers/infiniband/hw/ipath/ipath_verbs.c    |  7 +++++++
 drivers/infiniband/hw/mlx4/main.c            | 10 ++++++++++
 drivers/infiniband/hw/mlx5/main.c            |  7 +++++++
 drivers/infiniband/hw/mthca/mthca_provider.c |  7 +++++++
 drivers/infiniband/hw/nes/nes_verbs.c        |  6 ++++++
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |  1 +
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |  6 ++++++
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |  3 +++
 drivers/infiniband/hw/qib/qib_verbs.c        |  7 +++++++
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |  1 +
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |  6 ++++++
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |  2 ++
 include/rdma/ib_verbs.h                      |  7 ++++++-
 21 files changed, 104 insertions(+), 2 deletions(-)
drivers/infiniband/core/device.c +1 -0
index 18c1ece..a9587c4 100644
@@ -76,6 +76,7 @@ static int ib_device_check_mandatory(struct ib_device *device)
 	} mandatory_table[] = {
 		IB_MANDATORY_FUNC(query_device),
 		IB_MANDATORY_FUNC(query_port),
+		IB_MANDATORY_FUNC(query_transport),
 		IB_MANDATORY_FUNC(query_pkey),
 		IB_MANDATORY_FUNC(query_gid),
 		IB_MANDATORY_FUNC(alloc_pd),
drivers/infiniband/core/verbs.c +3 -1
index f93eb8d..626c9cf 100644
@@ -133,14 +133,16 @@ enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_
 	if (device->get_link_layer)
 		return device->get_link_layer(device, port_num);
 
-	switch (rdma_node_get_transport(device->node_type)) {
+	switch (device->query_transport(device, port_num)) {
 	case RDMA_TRANSPORT_IB:
 		return IB_LINK_LAYER_INFINIBAND;
+	case RDMA_TRANSPORT_IBOE:
 	case RDMA_TRANSPORT_IWARP:
 	case RDMA_TRANSPORT_USNIC:
 	case RDMA_TRANSPORT_USNIC_UDP:
 		return IB_LINK_LAYER_ETHERNET;
 	default:
+		BUG();
 		return IB_LINK_LAYER_UNSPECIFIED;
 	}
 }
drivers/infiniband/hw/amso1100/c2_provider.c +7 -0
index bdf3507..d46bbb0 100644
@@ -99,6 +99,12 @@ static int c2_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+c2_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static int c2_query_pkey(struct ib_device *ibdev,
 			 u8 port, u16 index, u16 * pkey)
 {
@@ -801,6 +807,7 @@ int c2_register_device(struct c2_dev *dev)
 	dev->ibdev.dma_device = &dev->pcidev->dev;
 	dev->ibdev.query_device = c2_query_device;
 	dev->ibdev.query_port = c2_query_port;
+	dev->ibdev.query_transport = c2_query_transport;
 	dev->ibdev.query_pkey = c2_query_pkey;
 	dev->ibdev.query_gid = c2_query_gid;
 	dev->ibdev.alloc_ucontext = c2_alloc_ucontext;
drivers/infiniband/hw/cxgb3/iwch_provider.c +7 -0
index 811b24a..09682e9e 100644
@@ -1232,6 +1232,12 @@ static int iwch_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+iwch_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
 			char *buf)
 {
@@ -1385,6 +1391,7 @@ int iwch_register_device(struct iwch_dev *dev)
 	dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev);
 	dev->ibdev.query_device = iwch_query_device;
 	dev->ibdev.query_port = iwch_query_port;
+	dev->ibdev.query_transport = iwch_query_transport;
 	dev->ibdev.query_pkey = iwch_query_pkey;
 	dev->ibdev.query_gid = iwch_query_gid;
 	dev->ibdev.alloc_ucontext = iwch_alloc_ucontext;
drivers/infiniband/hw/cxgb4/provider.c +7 -0
index 66bd6a2..a445e0d 100644
@@ -390,6 +390,12 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+static enum rdma_transport_type
+c4iw_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
 			char *buf)
 {
@@ -506,6 +512,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
 	dev->ibdev.dma_device = &(dev->rdev.lldi.pdev->dev);
 	dev->ibdev.query_device = c4iw_query_device;
 	dev->ibdev.query_port = c4iw_query_port;
+	dev->ibdev.query_transport = c4iw_query_transport;
 	dev->ibdev.query_pkey = c4iw_query_pkey;
 	dev->ibdev.query_gid = c4iw_query_gid;
 	dev->ibdev.alloc_ucontext = c4iw_alloc_ucontext;
drivers/infiniband/hw/ehca/ehca_hca.c +6 -0
index 9ed4d25..d5a34a6 100644
@@ -242,6 +242,12 @@ query_port1:
 	return ret;
 }
 
+enum rdma_transport_type
+ehca_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 int ehca_query_sma_attr(struct ehca_shca *shca,
 			u8 port, struct ehca_sma_attr *attr)
 {
drivers/infiniband/hw/ehca/ehca_iverbs.h +3 -0
index 22f79af..cec945f 100644
@@ -49,6 +49,9 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props);
 int ehca_query_port(struct ib_device *ibdev, u8 port,
 		    struct ib_port_attr *props);
 
+enum rdma_transport_type
+ehca_query_transport(struct ib_device *device, u8 port_num);
+
 int ehca_query_sma_attr(struct ehca_shca *shca, u8 port,
 			struct ehca_sma_attr *attr);
 
drivers/infiniband/hw/ehca/ehca_main.c +1 -0
index cd8d290..60e0a09 100644
@@ -467,6 +467,7 @@ static int ehca_init_device(struct ehca_shca *shca)
 	shca->ib_device.dma_device          = &shca->ofdev->dev;
 	shca->ib_device.query_device        = ehca_query_device;
 	shca->ib_device.query_port          = ehca_query_port;
+	shca->ib_device.query_transport     = ehca_query_transport;
 	shca->ib_device.query_gid           = ehca_query_gid;
 	shca->ib_device.query_pkey          = ehca_query_pkey;
 	/* shca->in_device.modify_device    = ehca_modify_device    */
drivers/infiniband/hw/ipath/ipath_verbs.c +7 -0
index 44ea939..58d36e3 100644
@@ -1638,6 +1638,12 @@ static int ipath_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+ipath_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int ipath_modify_device(struct ib_device *device,
 			       int device_modify_mask,
 			       struct ib_device_modify *device_modify)
@@ -2140,6 +2146,7 @@ int ipath_register_ib_device(struct ipath_devdata *dd)
 	dev->query_device = ipath_query_device;
 	dev->modify_device = ipath_modify_device;
 	dev->query_port = ipath_query_port;
+	dev->query_transport = ipath_query_transport;
 	dev->modify_port = ipath_modify_port;
 	dev->query_pkey = ipath_query_pkey;
 	dev->query_gid = ipath_query_gid;
drivers/infiniband/hw/mlx4/main.c +10 -0
index b972c0b..e1424ad 100644
@@ -420,6 +420,15 @@ static int mlx4_ib_query_port(struct ib_device *ibdev, u8 port,
 	return __mlx4_ib_query_port(ibdev, port, props, 0);
 }
 
+static enum rdma_transport_type
+mlx4_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	struct mlx4_dev *dev = to_mdev(device)->dev;
+
+	return dev->caps.port_mask[port_num] == MLX4_PORT_TYPE_IB ?
+		RDMA_TRANSPORT_IB : RDMA_TRANSPORT_IBOE;
+}
+
 int __mlx4_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
 			union ib_gid *gid, int netw_view)
 {
@@ -2201,6 +2210,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
 
 	ibdev->ib_dev.query_device	= mlx4_ib_query_device;
 	ibdev->ib_dev.query_port	= mlx4_ib_query_port;
+	ibdev->ib_dev.query_transport	= mlx4_ib_query_transport;
 	ibdev->ib_dev.get_link_layer	= mlx4_ib_port_link_layer;
 	ibdev->ib_dev.query_gid		= mlx4_ib_query_gid;
 	ibdev->ib_dev.query_pkey	= mlx4_ib_query_pkey;
drivers/infiniband/hw/mlx5/main.c +7 -0
index cc4ac1e..209c796 100644
@@ -351,6 +351,12 @@ out:
 	return err;
 }
 
+static enum rdma_transport_type
+mlx5_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int mlx5_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
 			     union ib_gid *gid)
 {
@@ -1336,6 +1342,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
 
 	dev->ib_dev.query_device	= mlx5_ib_query_device;
 	dev->ib_dev.query_port		= mlx5_ib_query_port;
+	dev->ib_dev.query_transport	= mlx5_ib_query_transport;
 	dev->ib_dev.query_gid		= mlx5_ib_query_gid;
 	dev->ib_dev.query_pkey		= mlx5_ib_query_pkey;
 	dev->ib_dev.modify_device	= mlx5_ib_modify_device;
drivers/infiniband/hw/mthca/mthca_provider.c +7 -0
index 415f8e1..67ac6a4 100644
@@ -179,6 +179,12 @@ static int mthca_query_port(struct ib_device *ibdev,
 	return err;
 }
 
+static enum rdma_transport_type
+mthca_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int mthca_modify_device(struct ib_device *ibdev,
 			       int mask,
 			       struct ib_device_modify *props)
@@ -1281,6 +1287,7 @@ int mthca_register_device(struct mthca_dev *dev)
 	dev->ib_dev.dma_device           = &dev->pdev->dev;
 	dev->ib_dev.query_device         = mthca_query_device;
 	dev->ib_dev.query_port           = mthca_query_port;
+	dev->ib_dev.query_transport      = mthca_query_transport;
 	dev->ib_dev.modify_device        = mthca_modify_device;
 	dev->ib_dev.modify_port          = mthca_modify_port;
 	dev->ib_dev.query_pkey           = mthca_query_pkey;
drivers/infiniband/hw/nes/nes_verbs.c +6 -0
index c0d0296..8df5b61 100644
@@ -606,6 +606,11 @@ static int nes_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr
 	return 0;
 }
 
+static enum rdma_transport_type
+nes_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
 
 /**
  * nes_query_pkey
@@ -3879,6 +3884,7 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
 	nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev;
 	nesibdev->ibdev.query_device = nes_query_device;
 	nesibdev->ibdev.query_port = nes_query_port;
+	nesibdev->ibdev.query_transport = nes_query_transport;
 	nesibdev->ibdev.query_pkey = nes_query_pkey;
 	nesibdev->ibdev.query_gid = nes_query_gid;
 	nesibdev->ibdev.alloc_ucontext = nes_alloc_ucontext;
drivers/infiniband/hw/ocrdma/ocrdma_main.c +1 -0
index 7a2b59a..9f4d182 100644
@@ -244,6 +244,7 @@ static int ocrdma_register_device(struct ocrdma_dev *dev)
 	/* mandatory verbs. */
 	dev->ibdev.query_device = ocrdma_query_device;
 	dev->ibdev.query_port = ocrdma_query_port;
+	dev->ibdev.query_transport = ocrdma_query_transport;
 	dev->ibdev.modify_port = ocrdma_modify_port;
 	dev->ibdev.query_gid = ocrdma_query_gid;
 	dev->ibdev.get_link_layer = ocrdma_link_layer;
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +6 -0
index 8771755..73bace4 100644
@@ -187,6 +187,12 @@ int ocrdma_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+enum rdma_transport_type
+ocrdma_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IBOE;
+}
+
 int ocrdma_modify_port(struct ib_device *ibdev, u8 port, int mask,
 		       struct ib_port_modify *props)
 {
drivers/infiniband/hw/ocrdma/ocrdma_verbs.h +3 -0
index b8f7853..4a81b63 100644
@@ -41,6 +41,9 @@ int ocrdma_query_port(struct ib_device *, u8 port, struct ib_port_attr *props);
 int ocrdma_modify_port(struct ib_device *, u8 port, int mask,
 		       struct ib_port_modify *props);
 
+enum rdma_transport_type
+ocrdma_query_transport(struct ib_device *device, u8 port_num);
+
 void ocrdma_get_guid(struct ocrdma_dev *, u8 *guid);
 int ocrdma_query_gid(struct ib_device *, u8 port,
 		     int index, union ib_gid *gid);
drivers/infiniband/hw/qib/qib_verbs.c +7 -0
index 4a35998..caad665 100644
@@ -1650,6 +1650,12 @@ static int qib_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+static enum rdma_transport_type
+qib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int qib_modify_device(struct ib_device *device,
 			     int device_modify_mask,
 			     struct ib_device_modify *device_modify)
@@ -2184,6 +2190,7 @@ int qib_register_ib_device(struct qib_devdata *dd)
 	ibdev->query_device = qib_query_device;
 	ibdev->modify_device = qib_modify_device;
 	ibdev->query_port = qib_query_port;
+	ibdev->query_transport = qib_query_transport;
 	ibdev->modify_port = qib_modify_port;
 	ibdev->query_pkey = qib_query_pkey;
 	ibdev->query_gid = qib_query_gid;
drivers/infiniband/hw/usnic/usnic_ib_main.c +1 -0
index 0d0f986..03ea9f3 100644
@@ -360,6 +360,7 @@ static void *usnic_ib_device_add(struct pci_dev *dev)
 
 	us_ibdev->ib_dev.query_device = usnic_ib_query_device;
 	us_ibdev->ib_dev.query_port = usnic_ib_query_port;
+	us_ibdev->ib_dev.query_transport = usnic_ib_query_transport;
 	us_ibdev->ib_dev.query_pkey = usnic_ib_query_pkey;
 	us_ibdev->ib_dev.query_gid = usnic_ib_query_gid;
 	us_ibdev->ib_dev.get_link_layer = usnic_ib_port_link_layer;
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +6 -0
index 53bd6a2..ff9a5f7 100644
@@ -348,6 +348,12 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+enum rdma_transport_type
+usnic_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_USNIC_UDP;
+}
+
 int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
 				int qp_attr_mask,
 				struct ib_qp_init_attr *qp_init_attr)
drivers/infiniband/hw/usnic/usnic_ib_verbs.h +2 -0
index bb864f5..0b1633b 100644
@@ -27,6 +27,8 @@ int usnic_ib_query_device(struct ib_device *ibdev,
 				struct ib_device_attr *props);
 int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
 				struct ib_port_attr *props);
+enum rdma_transport_type
+usnic_ib_query_transport(struct ib_device *device, u8 port_num);
 int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
 				int qp_attr_mask,
 				struct ib_qp_init_attr *qp_init_attr);
include/rdma/ib_verbs.h +6 -1
index 65994a1..d54f91e 100644
@@ -75,10 +75,13 @@ enum rdma_node_type {
 };
 
 enum rdma_transport_type {
+	/* legacy for users */
 	RDMA_TRANSPORT_IB,
 	RDMA_TRANSPORT_IWARP,
 	RDMA_TRANSPORT_USNIC,
-	RDMA_TRANSPORT_USNIC_UDP
+	RDMA_TRANSPORT_USNIC_UDP,
+	/* new transport */
+	RDMA_TRANSPORT_IBOE,
 };
 
 __attribute_const__ enum rdma_transport_type
@@ -1501,6 +1504,8 @@ struct ib_device {
 	int		           (*query_port)(struct ib_device *device,
 						 u8 port_num,
 						 struct ib_port_attr *port_attr);
+	enum rdma_transport_type   (*query_transport)(struct ib_device *device,
+						      u8 port_num);
 	enum rdma_link_layer	   (*get_link_layer)(struct ib_device *device,
 						     u8 port_num);
 	int		           (*query_gid)(struct ib_device *device,
Signature · 1 line
2.1.0
#3 lore raw

Re: [PATCH v5 01/27] IB/Verbs: Implement new callback query_transport()

In reply to Michael Wang
Quoted 1 line · Michael Wang

Add new callback query_transport() and implement for each HW.

The more I think about it, the more I think we need to eliminate this patch entirely.

The problem here is that, if we follow my suggestion, then we are going to eliminate the query as an API function and replace the information it gives us with a static port attribute bitmap. If we do this patch, then reform this patch to my idea later, we introduce a very short lived API/ABI change in the kernel module interface that serves absolutely no purpose. Instead, let's do the bitmap creation first, update the drivers to properly set the bitmap, then do all of the remaining reforms you have here using that bitmap and completely skip the query_transport() API item that will no longer serve a purpose.

Quoted 464 lines

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/device.c             |  1 +
 drivers/infiniband/core/verbs.c              |  4 +++-
 drivers/infiniband/hw/amso1100/c2_provider.c |  7 +++++++
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |  7 +++++++
 drivers/infiniband/hw/cxgb4/provider.c       |  7 +++++++
 drivers/infiniband/hw/ehca/ehca_hca.c        |  6 ++++++
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |  3 +++
 drivers/infiniband/hw/ehca/ehca_main.c       |  1 +
 drivers/infiniband/hw/ipath/ipath_verbs.c    |  7 +++++++
 drivers/infiniband/hw/mlx4/main.c            | 10 ++++++++++
 drivers/infiniband/hw/mlx5/main.c            |  7 +++++++
 drivers/infiniband/hw/mthca/mthca_provider.c |  7 +++++++
 drivers/infiniband/hw/nes/nes_verbs.c        |  6 ++++++
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |  1 +
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |  6 ++++++
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |  3 +++
 drivers/infiniband/hw/qib/qib_verbs.c        |  7 +++++++
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |  1 +
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |  6 ++++++
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |  2 ++
 include/rdma/ib_verbs.h                      |  7 ++++++-
 21 files changed, 104 insertions(+), 2 deletions(-)
drivers/infiniband/core/device.c +1 -0
index 18c1ece..a9587c4 100644
@@ -76,6 +76,7 @@ static int ib_device_check_mandatory(struct ib_device *device)
 	} mandatory_table[] = {
 		IB_MANDATORY_FUNC(query_device),
 		IB_MANDATORY_FUNC(query_port),
+		IB_MANDATORY_FUNC(query_transport),
 		IB_MANDATORY_FUNC(query_pkey),
 		IB_MANDATORY_FUNC(query_gid),
 		IB_MANDATORY_FUNC(alloc_pd),
drivers/infiniband/core/verbs.c +3 -1
index f93eb8d..626c9cf 100644
@@ -133,14 +133,16 @@ enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_
 	if (device->get_link_layer)
 		return device->get_link_layer(device, port_num);
 
-	switch (rdma_node_get_transport(device->node_type)) {
+	switch (device->query_transport(device, port_num)) {
 	case RDMA_TRANSPORT_IB:
 		return IB_LINK_LAYER_INFINIBAND;
+	case RDMA_TRANSPORT_IBOE:
 	case RDMA_TRANSPORT_IWARP:
 	case RDMA_TRANSPORT_USNIC:
 	case RDMA_TRANSPORT_USNIC_UDP:
 		return IB_LINK_LAYER_ETHERNET;
 	default:
+		BUG();
 		return IB_LINK_LAYER_UNSPECIFIED;
 	}
 }
drivers/infiniband/hw/amso1100/c2_provider.c +7 -0
index bdf3507..d46bbb0 100644
@@ -99,6 +99,12 @@ static int c2_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+c2_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static int c2_query_pkey(struct ib_device *ibdev,
 			 u8 port, u16 index, u16 * pkey)
 {
@@ -801,6 +807,7 @@ int c2_register_device(struct c2_dev *dev)
 	dev->ibdev.dma_device = &dev->pcidev->dev;
 	dev->ibdev.query_device = c2_query_device;
 	dev->ibdev.query_port = c2_query_port;
+	dev->ibdev.query_transport = c2_query_transport;
 	dev->ibdev.query_pkey = c2_query_pkey;
 	dev->ibdev.query_gid = c2_query_gid;
 	dev->ibdev.alloc_ucontext = c2_alloc_ucontext;
drivers/infiniband/hw/cxgb3/iwch_provider.c +7 -0
index 811b24a..09682e9e 100644
@@ -1232,6 +1232,12 @@ static int iwch_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+iwch_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
 			char *buf)
 {
@@ -1385,6 +1391,7 @@ int iwch_register_device(struct iwch_dev *dev)
 	dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev);
 	dev->ibdev.query_device = iwch_query_device;
 	dev->ibdev.query_port = iwch_query_port;
+	dev->ibdev.query_transport = iwch_query_transport;
 	dev->ibdev.query_pkey = iwch_query_pkey;
 	dev->ibdev.query_gid = iwch_query_gid;
 	dev->ibdev.alloc_ucontext = iwch_alloc_ucontext;
drivers/infiniband/hw/cxgb4/provider.c +7 -0
index 66bd6a2..a445e0d 100644
@@ -390,6 +390,12 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+static enum rdma_transport_type
+c4iw_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
 			char *buf)
 {
@@ -506,6 +512,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
 	dev->ibdev.dma_device = &(dev->rdev.lldi.pdev->dev);
 	dev->ibdev.query_device = c4iw_query_device;
 	dev->ibdev.query_port = c4iw_query_port;
+	dev->ibdev.query_transport = c4iw_query_transport;
 	dev->ibdev.query_pkey = c4iw_query_pkey;
 	dev->ibdev.query_gid = c4iw_query_gid;
 	dev->ibdev.alloc_ucontext = c4iw_alloc_ucontext;
drivers/infiniband/hw/ehca/ehca_hca.c +6 -0
index 9ed4d25..d5a34a6 100644
@@ -242,6 +242,12 @@ query_port1:
 	return ret;
 }
 
+enum rdma_transport_type
+ehca_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 int ehca_query_sma_attr(struct ehca_shca *shca,
 			u8 port, struct ehca_sma_attr *attr)
 {
drivers/infiniband/hw/ehca/ehca_iverbs.h +3 -0
index 22f79af..cec945f 100644
@@ -49,6 +49,9 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props);
 int ehca_query_port(struct ib_device *ibdev, u8 port,
 		    struct ib_port_attr *props);
 
+enum rdma_transport_type
+ehca_query_transport(struct ib_device *device, u8 port_num);
+
 int ehca_query_sma_attr(struct ehca_shca *shca, u8 port,
 			struct ehca_sma_attr *attr);
 
drivers/infiniband/hw/ehca/ehca_main.c +1 -0
index cd8d290..60e0a09 100644
@@ -467,6 +467,7 @@ static int ehca_init_device(struct ehca_shca *shca)
 	shca->ib_device.dma_device          = &shca->ofdev->dev;
 	shca->ib_device.query_device        = ehca_query_device;
 	shca->ib_device.query_port          = ehca_query_port;
+	shca->ib_device.query_transport     = ehca_query_transport;
 	shca->ib_device.query_gid           = ehca_query_gid;
 	shca->ib_device.query_pkey          = ehca_query_pkey;
 	/* shca->in_device.modify_device    = ehca_modify_device    */
drivers/infiniband/hw/ipath/ipath_verbs.c +7 -0
index 44ea939..58d36e3 100644
@@ -1638,6 +1638,12 @@ static int ipath_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+ipath_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int ipath_modify_device(struct ib_device *device,
 			       int device_modify_mask,
 			       struct ib_device_modify *device_modify)
@@ -2140,6 +2146,7 @@ int ipath_register_ib_device(struct ipath_devdata *dd)
 	dev->query_device = ipath_query_device;
 	dev->modify_device = ipath_modify_device;
 	dev->query_port = ipath_query_port;
+	dev->query_transport = ipath_query_transport;
 	dev->modify_port = ipath_modify_port;
 	dev->query_pkey = ipath_query_pkey;
 	dev->query_gid = ipath_query_gid;
drivers/infiniband/hw/mlx4/main.c +10 -0
index b972c0b..e1424ad 100644
@@ -420,6 +420,15 @@ static int mlx4_ib_query_port(struct ib_device *ibdev, u8 port,
 	return __mlx4_ib_query_port(ibdev, port, props, 0);
 }
 
+static enum rdma_transport_type
+mlx4_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	struct mlx4_dev *dev = to_mdev(device)->dev;
+
+	return dev->caps.port_mask[port_num] == MLX4_PORT_TYPE_IB ?
+		RDMA_TRANSPORT_IB : RDMA_TRANSPORT_IBOE;
+}
+
 int __mlx4_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
 			union ib_gid *gid, int netw_view)
 {
@@ -2201,6 +2210,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
 
 	ibdev->ib_dev.query_device	= mlx4_ib_query_device;
 	ibdev->ib_dev.query_port	= mlx4_ib_query_port;
+	ibdev->ib_dev.query_transport	= mlx4_ib_query_transport;
 	ibdev->ib_dev.get_link_layer	= mlx4_ib_port_link_layer;
 	ibdev->ib_dev.query_gid		= mlx4_ib_query_gid;
 	ibdev->ib_dev.query_pkey	= mlx4_ib_query_pkey;
drivers/infiniband/hw/mlx5/main.c +7 -0
index cc4ac1e..209c796 100644
@@ -351,6 +351,12 @@ out:
 	return err;
 }
 
+static enum rdma_transport_type
+mlx5_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int mlx5_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
 			     union ib_gid *gid)
 {
@@ -1336,6 +1342,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
 
 	dev->ib_dev.query_device	= mlx5_ib_query_device;
 	dev->ib_dev.query_port		= mlx5_ib_query_port;
+	dev->ib_dev.query_transport	= mlx5_ib_query_transport;
 	dev->ib_dev.query_gid		= mlx5_ib_query_gid;
 	dev->ib_dev.query_pkey		= mlx5_ib_query_pkey;
 	dev->ib_dev.modify_device	= mlx5_ib_modify_device;
drivers/infiniband/hw/mthca/mthca_provider.c +7 -0
index 415f8e1..67ac6a4 100644
@@ -179,6 +179,12 @@ static int mthca_query_port(struct ib_device *ibdev,
 	return err;
 }
 
+static enum rdma_transport_type
+mthca_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int mthca_modify_device(struct ib_device *ibdev,
 			       int mask,
 			       struct ib_device_modify *props)
@@ -1281,6 +1287,7 @@ int mthca_register_device(struct mthca_dev *dev)
 	dev->ib_dev.dma_device           = &dev->pdev->dev;
 	dev->ib_dev.query_device         = mthca_query_device;
 	dev->ib_dev.query_port           = mthca_query_port;
+	dev->ib_dev.query_transport      = mthca_query_transport;
 	dev->ib_dev.modify_device        = mthca_modify_device;
 	dev->ib_dev.modify_port          = mthca_modify_port;
 	dev->ib_dev.query_pkey           = mthca_query_pkey;
drivers/infiniband/hw/nes/nes_verbs.c +6 -0
index c0d0296..8df5b61 100644
@@ -606,6 +606,11 @@ static int nes_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr
 	return 0;
 }
 
+static enum rdma_transport_type
+nes_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
 
 /**
  * nes_query_pkey
@@ -3879,6 +3884,7 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
 	nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev;
 	nesibdev->ibdev.query_device = nes_query_device;
 	nesibdev->ibdev.query_port = nes_query_port;
+	nesibdev->ibdev.query_transport = nes_query_transport;
 	nesibdev->ibdev.query_pkey = nes_query_pkey;
 	nesibdev->ibdev.query_gid = nes_query_gid;
 	nesibdev->ibdev.alloc_ucontext = nes_alloc_ucontext;
drivers/infiniband/hw/ocrdma/ocrdma_main.c +1 -0
index 7a2b59a..9f4d182 100644
@@ -244,6 +244,7 @@ static int ocrdma_register_device(struct ocrdma_dev *dev)
 	/* mandatory verbs. */
 	dev->ibdev.query_device = ocrdma_query_device;
 	dev->ibdev.query_port = ocrdma_query_port;
+	dev->ibdev.query_transport = ocrdma_query_transport;
 	dev->ibdev.modify_port = ocrdma_modify_port;
 	dev->ibdev.query_gid = ocrdma_query_gid;
 	dev->ibdev.get_link_layer = ocrdma_link_layer;
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +6 -0
index 8771755..73bace4 100644
@@ -187,6 +187,12 @@ int ocrdma_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+enum rdma_transport_type
+ocrdma_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IBOE;
+}
+
 int ocrdma_modify_port(struct ib_device *ibdev, u8 port, int mask,
 		       struct ib_port_modify *props)
 {
drivers/infiniband/hw/ocrdma/ocrdma_verbs.h +3 -0
index b8f7853..4a81b63 100644
@@ -41,6 +41,9 @@ int ocrdma_query_port(struct ib_device *, u8 port, struct ib_port_attr *props);
 int ocrdma_modify_port(struct ib_device *, u8 port, int mask,
 		       struct ib_port_modify *props);
 
+enum rdma_transport_type
+ocrdma_query_transport(struct ib_device *device, u8 port_num);
+
 void ocrdma_get_guid(struct ocrdma_dev *, u8 *guid);
 int ocrdma_query_gid(struct ib_device *, u8 port,
 		     int index, union ib_gid *gid);
drivers/infiniband/hw/qib/qib_verbs.c +7 -0
index 4a35998..caad665 100644
@@ -1650,6 +1650,12 @@ static int qib_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+static enum rdma_transport_type
+qib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int qib_modify_device(struct ib_device *device,
 			     int device_modify_mask,
 			     struct ib_device_modify *device_modify)
@@ -2184,6 +2190,7 @@ int qib_register_ib_device(struct qib_devdata *dd)
 	ibdev->query_device = qib_query_device;
 	ibdev->modify_device = qib_modify_device;
 	ibdev->query_port = qib_query_port;
+	ibdev->query_transport = qib_query_transport;
 	ibdev->modify_port = qib_modify_port;
 	ibdev->query_pkey = qib_query_pkey;
 	ibdev->query_gid = qib_query_gid;
drivers/infiniband/hw/usnic/usnic_ib_main.c +1 -0
index 0d0f986..03ea9f3 100644
@@ -360,6 +360,7 @@ static void *usnic_ib_device_add(struct pci_dev *dev)
 
 	us_ibdev->ib_dev.query_device = usnic_ib_query_device;
 	us_ibdev->ib_dev.query_port = usnic_ib_query_port;
+	us_ibdev->ib_dev.query_transport = usnic_ib_query_transport;
 	us_ibdev->ib_dev.query_pkey = usnic_ib_query_pkey;
 	us_ibdev->ib_dev.query_gid = usnic_ib_query_gid;
 	us_ibdev->ib_dev.get_link_layer = usnic_ib_port_link_layer;
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +6 -0
index 53bd6a2..ff9a5f7 100644
@@ -348,6 +348,12 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+enum rdma_transport_type
+usnic_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_USNIC_UDP;
+}
+
 int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
 				int qp_attr_mask,
 				struct ib_qp_init_attr *qp_init_attr)
drivers/infiniband/hw/usnic/usnic_ib_verbs.h +2 -0
index bb864f5..0b1633b 100644
@@ -27,6 +27,8 @@ int usnic_ib_query_device(struct ib_device *ibdev,
 				struct ib_device_attr *props);
 int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
 				struct ib_port_attr *props);
+enum rdma_transport_type
+usnic_ib_query_transport(struct ib_device *device, u8 port_num);
 int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
 				int qp_attr_mask,
 				struct ib_qp_init_attr *qp_init_attr);
include/rdma/ib_verbs.h +6 -1
index 65994a1..d54f91e 100644
@@ -75,10 +75,13 @@ enum rdma_node_type {
 };
 
 enum rdma_transport_type {
+	/* legacy for users */
 	RDMA_TRANSPORT_IB,
 	RDMA_TRANSPORT_IWARP,
 	RDMA_TRANSPORT_USNIC,
-	RDMA_TRANSPORT_USNIC_UDP
+	RDMA_TRANSPORT_USNIC_UDP,
+	/* new transport */
+	RDMA_TRANSPORT_IBOE,
 };
 
 __attribute_const__ enum rdma_transport_type
@@ -1501,6 +1504,8 @@ struct ib_device {
 	int		           (*query_port)(struct ib_device *device,
 						 u8 port_num,
 						 struct ib_port_attr *port_attr);
+	enum rdma_transport_type   (*query_transport)(struct ib_device *device,
+						      u8 port_num);
 	enum rdma_link_layer	   (*get_link_layer)(struct ib_device *device,
 						     u8 port_num);
 	int		           (*query_gid)(struct ib_device *device,
Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD
#4 lore raw

RE: [PATCH v5 01/27] IB/Verbs: Implement new callback query_transport()

PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBsaW51eC1yZG1hLW93bmVyQHZn ZXIua2VybmVsLm9yZyBbbWFpbHRvOmxpbnV4LXJkbWEtDQo+IG93bmVyQHZnZXIua2VybmVsLm9y Z10gT24gQmVoYWxmIE9mIERvdWcgTGVkZm9yZA0KPiBTZW50OiBXZWRuZXNkYXksIEFwcmlsIDIy LCAyMDE1IDg6MzMgUE0NCj4gVG86IE1pY2hhZWwgV2FuZw0KPiBDYzogUm9sYW5kIERyZW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ZXJ5X2dpZCkoc3RydWN0IGliX2Rl dmljZSAqZGV2aWNlLA0KPiANCj4gDQo+IC0tDQo+IERvdWcgTGVkZm9yZCA8ZGxlZGZvcmRAcmVk aGF0LmNvbT4NCj4gICAgICAgICAgICAgICBHUEcgS2V5SUQ6IDBFNTcyRkREDQo+IA0KDQo= --
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

Re: [PATCH v5 01/27] IB/Verbs: Implement new callback query_transport()

Quoted 29 lines · Devesh Sharma
Quoted 19 lines

-----Original Message-----
From: [email protected] [mailto:linux-rdma- [email protected]] On Behalf Of Doug Ledford
Sent: Wednesday, April 22, 2015 8:33 PM
To: Michael Wang
Cc: Roland Dreier; Sean Hefty; [email protected]; linux- [email protected]; [email protected]; Tom Tucker; Steve Wise; Hoang-Nam Nguyen; Christoph Raisch; Mike Marciniszyn; Eli Cohen; Faisal
Latif; Jack Morgenstein; Or Gerlitz; Haggai Eran; Ira Weiny; Tom Talpey; Jason
Gunthorpe
Subject: Re: [PATCH v5 01/27] IB/Verbs: Implement new callback
query_transport()

Quoted 1 line · Michael Wang

Add new callback query_transport() and implement for each HW.

The more I think about it, the more I think we need to eliminate this patch entirely.

Quoted 9 lines

The problem here is that, if we follow my suggestion, then we are going to eliminate the query as an API function and replace the information it gives us with a static port attribute bitmap. If we do this patch, then reform this patch to my idea later, we introduce a very short lived API/ABI change in the kernel module interface that serves absolutely no purpose. Instead, let's do the bitmap creation first, update the drivers to properly set the bitmap, then do all of the remaining reforms you have here using that bitmap and completely skip the
query_transport() API item that will no longer serve a purpose.

Quoted 2 lines

Any vendor device that registers with IB stack already has capability flags, are you referring to the same as bit maps? Is it possible to use same as bitmaps you are referring to? I am trying to understand you complete idea.

The idea was to use additional bit maps.

https://www.mail-archive.com/[email protected]/msg23765.html

Ira

--
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

Re: [PATCH v5 01/27] IB/Verbs: Implement new callback query_transport()

In reply to Devesh Sharma
Quoted 29 lines · Devesh Sharma
Quoted 19 lines

-----Original Message-----
From: [email protected] [mailto:linux-rdma- [email protected]] On Behalf Of Doug Ledford
Sent: Wednesday, April 22, 2015 8:33 PM
To: Michael Wang
Cc: Roland Dreier; Sean Hefty; [email protected]; linux- [email protected]; [email protected]; Tom Tucker; Steve Wise; Hoang-Nam Nguyen; Christoph Raisch; Mike Marciniszyn; Eli Cohen; Faisal Latif; Jack Morgenstein; Or Gerlitz; Haggai Eran; Ira Weiny; Tom Talpey; Jason Gunthorpe
Subject: Re: [PATCH v5 01/27] IB/Verbs: Implement new callback query_transport()

Quoted 1 line · Michael Wang

Add new callback query_transport() and implement for each HW.

The more I think about it, the more I think we need to eliminate this patch entirely.

Quoted 9 lines

The problem here is that, if we follow my suggestion, then we are going to eliminate the query as an API function and replace the information it gives us with a static port attribute bitmap. If we do this patch, then reform this patch to my idea later, we introduce a very short lived API/ABI change in the kernel module interface that serves absolutely no purpose. Instead, let's do the bitmap creation first, update the drivers to properly set the bitmap, then do all of the remaining reforms you have here using that bitmap and completely skip the
query_transport() API item that will no longer serve a purpose.

Quoted 2 lines

Any vendor device that registers with IB stack already has capability flags, are you referring to the same as bit maps? Is it possible to use same as bitmaps you are referring to? I am trying to understand you complete idea.

There are two capability flags right now, a device caps flag set and a port caps flag set (not counting possible driver internal flags). Regardless of whether or not we wanted to use one or the other, they are both too full to be used for our purposes. We can't get enough bits. We would get to drop the node_type, but that's only a u8 and so it doesn't have enough bits either. In addition, node_type is set per device, and it would really be best if our new bitmap were per port.

That then raises the issue that right now, the core code doesn't have direct access to per-port information, everything is done via a combination of direct access to the per device node check and per port driver callbacks. We may have no choice but to continue with that for now, but I find that inefficient. And if we make the bitmap per port, then even our node check becomes a callback.

So, what we need to do, is define a specific bitmap just for the node/transport/link bits and the capability bits that explicitly go with that tuple *and* define a way to access it without necessarily requiring a callback.

Michael's patch set has gone through a lot of revisions and I think we are getting close to the set of things we want to know, so it shouldn't be that hard now to create the proper bitmap that makes knowing those things quick and efficient.

The harder part will be making it accessible. Since the current struct ib_device doesn't include direct access to the ports (it has a list head for port_list, but that's just for the sysfs entries for this device, it doesn't hold anything we can use for this) we are limited to either A) adding a new callback or B) changing node_type to port_type, making it a larger size, and making it a port indexed array.

Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD
#7 lore raw

Re: [PATCH v5 01/27] IB/Verbs: Implement new callback query_transport()

In reply to Doug Ledford
Quoted 6 lines · Doug Ledford
Quoted 1 line · Michael Wang

Add new callback query_transport() and implement for each HW.

The more I think about it, the more I think we need to eliminate this patch entirely.

Quoted 9 lines

The problem here is that, if we follow my suggestion, then we are going to eliminate the query as an API function and replace the information it gives us with a static port attribute bitmap. If we do this patch, then reform this patch to my idea later, we introduce a very short lived API/ABI change in the kernel module interface that serves absolutely no purpose. Instead, let's do the bitmap creation first, update the drivers to properly set the bitmap, then do all of the remaining reforms you have here using that bitmap and completely skip the query_transport() API item that will no longer serve a purpose.

I really prefer to see the bitmask mechanism come along with the bits defined, at least we are not going to use transport anymore, correct?

I think there will be more discussion on bitmask stuff, not only about the definition of each bit, but also the timing to initialize it (should before each HW register the device).

That's really a different topic which we can't settle down within few versions IMHO, and I really like to staging our progress at this moment.

With these foundation, it would be really easy to expanding the topic further and let more folks join at the beginning, but if we introduce bitmask at this moments, the topic will be mixed with different purpose and become confusion...

We can do whatever the reform/discussion in next series, the topic would be clean and clear ;-)

Regards,
Michael Wang

Quoted 455 lines
Quoted 455 lines

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/device.c             |  1 +
 drivers/infiniband/core/verbs.c              |  4 +++-
 drivers/infiniband/hw/amso1100/c2_provider.c |  7 +++++++
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |  7 +++++++
 drivers/infiniband/hw/cxgb4/provider.c       |  7 +++++++
 drivers/infiniband/hw/ehca/ehca_hca.c        |  6 ++++++
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |  3 +++
 drivers/infiniband/hw/ehca/ehca_main.c       |  1 +
 drivers/infiniband/hw/ipath/ipath_verbs.c    |  7 +++++++
 drivers/infiniband/hw/mlx4/main.c            | 10 ++++++++++
 drivers/infiniband/hw/mlx5/main.c            |  7 +++++++
 drivers/infiniband/hw/mthca/mthca_provider.c |  7 +++++++
 drivers/infiniband/hw/nes/nes_verbs.c        |  6 ++++++
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |  1 +
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |  6 ++++++
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |  3 +++
 drivers/infiniband/hw/qib/qib_verbs.c        |  7 +++++++
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |  1 +
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |  6 ++++++
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |  2 ++
 include/rdma/ib_verbs.h                      |  7 ++++++-
 21 files changed, 104 insertions(+), 2 deletions(-)
drivers/infiniband/core/device.c +1 -0
index 18c1ece..a9587c4 100644
@@ -76,6 +76,7 @@ static int ib_device_check_mandatory(struct ib_device *device)
 	} mandatory_table[] = {
 		IB_MANDATORY_FUNC(query_device),
 		IB_MANDATORY_FUNC(query_port),
+		IB_MANDATORY_FUNC(query_transport),
 		IB_MANDATORY_FUNC(query_pkey),
 		IB_MANDATORY_FUNC(query_gid),
 		IB_MANDATORY_FUNC(alloc_pd),
drivers/infiniband/core/verbs.c +3 -1
index f93eb8d..626c9cf 100644
@@ -133,14 +133,16 @@ enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_
 	if (device->get_link_layer)
 		return device->get_link_layer(device, port_num);
 
-	switch (rdma_node_get_transport(device->node_type)) {
+	switch (device->query_transport(device, port_num)) {
 	case RDMA_TRANSPORT_IB:
 		return IB_LINK_LAYER_INFINIBAND;
+	case RDMA_TRANSPORT_IBOE:
 	case RDMA_TRANSPORT_IWARP:
 	case RDMA_TRANSPORT_USNIC:
 	case RDMA_TRANSPORT_USNIC_UDP:
 		return IB_LINK_LAYER_ETHERNET;
 	default:
+		BUG();
 		return IB_LINK_LAYER_UNSPECIFIED;
 	}
 }
drivers/infiniband/hw/amso1100/c2_provider.c +7 -0
index bdf3507..d46bbb0 100644
@@ -99,6 +99,12 @@ static int c2_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+c2_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static int c2_query_pkey(struct ib_device *ibdev,
 			 u8 port, u16 index, u16 * pkey)
 {
@@ -801,6 +807,7 @@ int c2_register_device(struct c2_dev *dev)
 	dev->ibdev.dma_device = &dev->pcidev->dev;
 	dev->ibdev.query_device = c2_query_device;
 	dev->ibdev.query_port = c2_query_port;
+	dev->ibdev.query_transport = c2_query_transport;
 	dev->ibdev.query_pkey = c2_query_pkey;
 	dev->ibdev.query_gid = c2_query_gid;
 	dev->ibdev.alloc_ucontext = c2_alloc_ucontext;
drivers/infiniband/hw/cxgb3/iwch_provider.c +7 -0
index 811b24a..09682e9e 100644
@@ -1232,6 +1232,12 @@ static int iwch_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+iwch_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
 			char *buf)
 {
@@ -1385,6 +1391,7 @@ int iwch_register_device(struct iwch_dev *dev)
 	dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev);
 	dev->ibdev.query_device = iwch_query_device;
 	dev->ibdev.query_port = iwch_query_port;
+	dev->ibdev.query_transport = iwch_query_transport;
 	dev->ibdev.query_pkey = iwch_query_pkey;
 	dev->ibdev.query_gid = iwch_query_gid;
 	dev->ibdev.alloc_ucontext = iwch_alloc_ucontext;
drivers/infiniband/hw/cxgb4/provider.c +7 -0
index 66bd6a2..a445e0d 100644
@@ -390,6 +390,12 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+static enum rdma_transport_type
+c4iw_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
+
 static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
 			char *buf)
 {
@@ -506,6 +512,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
 	dev->ibdev.dma_device = &(dev->rdev.lldi.pdev->dev);
 	dev->ibdev.query_device = c4iw_query_device;
 	dev->ibdev.query_port = c4iw_query_port;
+	dev->ibdev.query_transport = c4iw_query_transport;
 	dev->ibdev.query_pkey = c4iw_query_pkey;
 	dev->ibdev.query_gid = c4iw_query_gid;
 	dev->ibdev.alloc_ucontext = c4iw_alloc_ucontext;
drivers/infiniband/hw/ehca/ehca_hca.c +6 -0
index 9ed4d25..d5a34a6 100644
@@ -242,6 +242,12 @@ query_port1:
 	return ret;
 }
 
+enum rdma_transport_type
+ehca_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 int ehca_query_sma_attr(struct ehca_shca *shca,
 			u8 port, struct ehca_sma_attr *attr)
 {
drivers/infiniband/hw/ehca/ehca_iverbs.h +3 -0
index 22f79af..cec945f 100644
@@ -49,6 +49,9 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props);
 int ehca_query_port(struct ib_device *ibdev, u8 port,
 		    struct ib_port_attr *props);
 
+enum rdma_transport_type
+ehca_query_transport(struct ib_device *device, u8 port_num);
+
 int ehca_query_sma_attr(struct ehca_shca *shca, u8 port,
 			struct ehca_sma_attr *attr);
 
drivers/infiniband/hw/ehca/ehca_main.c +1 -0
index cd8d290..60e0a09 100644
@@ -467,6 +467,7 @@ static int ehca_init_device(struct ehca_shca *shca)
 	shca->ib_device.dma_device          = &shca->ofdev->dev;
 	shca->ib_device.query_device        = ehca_query_device;
 	shca->ib_device.query_port          = ehca_query_port;
+	shca->ib_device.query_transport     = ehca_query_transport;
 	shca->ib_device.query_gid           = ehca_query_gid;
 	shca->ib_device.query_pkey          = ehca_query_pkey;
 	/* shca->in_device.modify_device    = ehca_modify_device    */
drivers/infiniband/hw/ipath/ipath_verbs.c +7 -0
index 44ea939..58d36e3 100644
@@ -1638,6 +1638,12 @@ static int ipath_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+static enum rdma_transport_type
+ipath_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int ipath_modify_device(struct ib_device *device,
 			       int device_modify_mask,
 			       struct ib_device_modify *device_modify)
@@ -2140,6 +2146,7 @@ int ipath_register_ib_device(struct ipath_devdata *dd)
 	dev->query_device = ipath_query_device;
 	dev->modify_device = ipath_modify_device;
 	dev->query_port = ipath_query_port;
+	dev->query_transport = ipath_query_transport;
 	dev->modify_port = ipath_modify_port;
 	dev->query_pkey = ipath_query_pkey;
 	dev->query_gid = ipath_query_gid;
drivers/infiniband/hw/mlx4/main.c +10 -0
index b972c0b..e1424ad 100644
@@ -420,6 +420,15 @@ static int mlx4_ib_query_port(struct ib_device *ibdev, u8 port,
 	return __mlx4_ib_query_port(ibdev, port, props, 0);
 }
 
+static enum rdma_transport_type
+mlx4_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	struct mlx4_dev *dev = to_mdev(device)->dev;
+
+	return dev->caps.port_mask[port_num] == MLX4_PORT_TYPE_IB ?
+		RDMA_TRANSPORT_IB : RDMA_TRANSPORT_IBOE;
+}
+
 int __mlx4_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
 			union ib_gid *gid, int netw_view)
 {
@@ -2201,6 +2210,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
 
 	ibdev->ib_dev.query_device	= mlx4_ib_query_device;
 	ibdev->ib_dev.query_port	= mlx4_ib_query_port;
+	ibdev->ib_dev.query_transport	= mlx4_ib_query_transport;
 	ibdev->ib_dev.get_link_layer	= mlx4_ib_port_link_layer;
 	ibdev->ib_dev.query_gid		= mlx4_ib_query_gid;
 	ibdev->ib_dev.query_pkey	= mlx4_ib_query_pkey;
drivers/infiniband/hw/mlx5/main.c +7 -0
index cc4ac1e..209c796 100644
@@ -351,6 +351,12 @@ out:
 	return err;
 }
 
+static enum rdma_transport_type
+mlx5_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int mlx5_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
 			     union ib_gid *gid)
 {
@@ -1336,6 +1342,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
 
 	dev->ib_dev.query_device	= mlx5_ib_query_device;
 	dev->ib_dev.query_port		= mlx5_ib_query_port;
+	dev->ib_dev.query_transport	= mlx5_ib_query_transport;
 	dev->ib_dev.query_gid		= mlx5_ib_query_gid;
 	dev->ib_dev.query_pkey		= mlx5_ib_query_pkey;
 	dev->ib_dev.modify_device	= mlx5_ib_modify_device;
drivers/infiniband/hw/mthca/mthca_provider.c +7 -0
index 415f8e1..67ac6a4 100644
@@ -179,6 +179,12 @@ static int mthca_query_port(struct ib_device *ibdev,
 	return err;
 }
 
+static enum rdma_transport_type
+mthca_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int mthca_modify_device(struct ib_device *ibdev,
 			       int mask,
 			       struct ib_device_modify *props)
@@ -1281,6 +1287,7 @@ int mthca_register_device(struct mthca_dev *dev)
 	dev->ib_dev.dma_device           = &dev->pdev->dev;
 	dev->ib_dev.query_device         = mthca_query_device;
 	dev->ib_dev.query_port           = mthca_query_port;
+	dev->ib_dev.query_transport      = mthca_query_transport;
 	dev->ib_dev.modify_device        = mthca_modify_device;
 	dev->ib_dev.modify_port          = mthca_modify_port;
 	dev->ib_dev.query_pkey           = mthca_query_pkey;
drivers/infiniband/hw/nes/nes_verbs.c +6 -0
index c0d0296..8df5b61 100644
@@ -606,6 +606,11 @@ static int nes_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr
 	return 0;
 }
 
+static enum rdma_transport_type
+nes_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IWARP;
+}
 
 /**
  * nes_query_pkey
@@ -3879,6 +3884,7 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
 	nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev;
 	nesibdev->ibdev.query_device = nes_query_device;
 	nesibdev->ibdev.query_port = nes_query_port;
+	nesibdev->ibdev.query_transport = nes_query_transport;
 	nesibdev->ibdev.query_pkey = nes_query_pkey;
 	nesibdev->ibdev.query_gid = nes_query_gid;
 	nesibdev->ibdev.alloc_ucontext = nes_alloc_ucontext;
drivers/infiniband/hw/ocrdma/ocrdma_main.c +1 -0
index 7a2b59a..9f4d182 100644
@@ -244,6 +244,7 @@ static int ocrdma_register_device(struct ocrdma_dev *dev)
 	/* mandatory verbs. */
 	dev->ibdev.query_device = ocrdma_query_device;
 	dev->ibdev.query_port = ocrdma_query_port;
+	dev->ibdev.query_transport = ocrdma_query_transport;
 	dev->ibdev.modify_port = ocrdma_modify_port;
 	dev->ibdev.query_gid = ocrdma_query_gid;
 	dev->ibdev.get_link_layer = ocrdma_link_layer;
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +6 -0
index 8771755..73bace4 100644
@@ -187,6 +187,12 @@ int ocrdma_query_port(struct ib_device *ibdev,
 	return 0;
 }
 
+enum rdma_transport_type
+ocrdma_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IBOE;
+}
+
 int ocrdma_modify_port(struct ib_device *ibdev, u8 port, int mask,
 		       struct ib_port_modify *props)
 {
drivers/infiniband/hw/ocrdma/ocrdma_verbs.h +3 -0
index b8f7853..4a81b63 100644
@@ -41,6 +41,9 @@ int ocrdma_query_port(struct ib_device *, u8 port, struct ib_port_attr *props);
 int ocrdma_modify_port(struct ib_device *, u8 port, int mask,
 		       struct ib_port_modify *props);
 
+enum rdma_transport_type
+ocrdma_query_transport(struct ib_device *device, u8 port_num);
+
 void ocrdma_get_guid(struct ocrdma_dev *, u8 *guid);
 int ocrdma_query_gid(struct ib_device *, u8 port,
 		     int index, union ib_gid *gid);
drivers/infiniband/hw/qib/qib_verbs.c +7 -0
index 4a35998..caad665 100644
@@ -1650,6 +1650,12 @@ static int qib_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+static enum rdma_transport_type
+qib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_IB;
+}
+
 static int qib_modify_device(struct ib_device *device,
 			     int device_modify_mask,
 			     struct ib_device_modify *device_modify)
@@ -2184,6 +2190,7 @@ int qib_register_ib_device(struct qib_devdata *dd)
 	ibdev->query_device = qib_query_device;
 	ibdev->modify_device = qib_modify_device;
 	ibdev->query_port = qib_query_port;
+	ibdev->query_transport = qib_query_transport;
 	ibdev->modify_port = qib_modify_port;
 	ibdev->query_pkey = qib_query_pkey;
 	ibdev->query_gid = qib_query_gid;
drivers/infiniband/hw/usnic/usnic_ib_main.c +1 -0
index 0d0f986..03ea9f3 100644
@@ -360,6 +360,7 @@ static void *usnic_ib_device_add(struct pci_dev *dev)
 
 	us_ibdev->ib_dev.query_device = usnic_ib_query_device;
 	us_ibdev->ib_dev.query_port = usnic_ib_query_port;
+	us_ibdev->ib_dev.query_transport = usnic_ib_query_transport;
 	us_ibdev->ib_dev.query_pkey = usnic_ib_query_pkey;
 	us_ibdev->ib_dev.query_gid = usnic_ib_query_gid;
 	us_ibdev->ib_dev.get_link_layer = usnic_ib_port_link_layer;
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +6 -0
index 53bd6a2..ff9a5f7 100644
@@ -348,6 +348,12 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
 	return 0;
 }
 
+enum rdma_transport_type
+usnic_ib_query_transport(struct ib_device *device, u8 port_num)
+{
+	return RDMA_TRANSPORT_USNIC_UDP;
+}
+
 int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
 				int qp_attr_mask,
 				struct ib_qp_init_attr *qp_init_attr)
drivers/infiniband/hw/usnic/usnic_ib_verbs.h +2 -0
index bb864f5..0b1633b 100644
@@ -27,6 +27,8 @@ int usnic_ib_query_device(struct ib_device *ibdev,
 				struct ib_device_attr *props);
 int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
 				struct ib_port_attr *props);
+enum rdma_transport_type
+usnic_ib_query_transport(struct ib_device *device, u8 port_num);
 int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
 				int qp_attr_mask,
 				struct ib_qp_init_attr *qp_init_attr);
include/rdma/ib_verbs.h +4 -1
index 65994a1..d54f91e 100644
@@ -75,10 +75,13 @@ enum rdma_node_type {
 };
 
 enum rdma_transport_type {
+	/* legacy for users */
 	RDMA_TRANSPORT_IB,
 	RDMA_TRANSPORT_IWARP,
 	RDMA_TRANSPORT_USNIC,
-	RDMA_TRANSPORT_USNIC_UDP
+	RDMA_TRANSPORT_USNIC_UDP,
+	/* new transport */
+	RDMA_TRANSPORT_IBOE,
 };
 
Quoted 12 lines

include/rdma/ib_verbs.h struct ib_device { · line 1511

Quoted 10 lines
include/rdma/ib_verbs.h +2 -0
 __attribute_const__ enum rdma_transport_type
@@ -1501,6 +1504,8 @@ struct ib_device {
 	int		           (*query_port)(struct ib_device *device,
 						 u8 port_num,
 						 struct ib_port_attr *port_attr);
+	enum rdma_transport_type   (*query_transport)(struct ib_device *device,
+						      u8 port_num);
 	enum rdma_link_layer	   (*get_link_layer)(struct ib_device *device,
 						     u8 port_num);
 	int		           (*query_gid)(struct ib_device *device,

--
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 v5 2/27 IB/Verbs: Implement raw management helpers

In reply to Michael Wang

Add raw helpers:
rdma_tech_ib
rdma_tech_iboe
rdma_tech_iwarp
rdma_ib_or_iboe (transition, clean up later)
To help us detect which technology the port supported.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 include/rdma/ib_verbs.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
include/rdma/ib_verbs.h +25 -0
index d54f91e..a12e876 100644
@@ -1748,6 +1748,31 @@ int ib_query_port(struct ib_device *device,
 enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device,
 					       u8 port_num);
 
+static inline int rdma_tech_ib(struct ib_device *device, u8 port_num)
+{
+	return device->query_transport(device, port_num)
+			== RDMA_TRANSPORT_IB;
+}
+
+static inline int rdma_tech_iboe(struct ib_device *device, u8 port_num)
+{
+	return device->query_transport(device, port_num)
+			== RDMA_TRANSPORT_IBOE;
+}
+
+static inline int rdma_tech_iwarp(struct ib_device *device, u8 port_num)
+{
+	return device->query_transport(device, port_num)
+			== RDMA_TRANSPORT_IWARP;
+}
+
+static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num)
+{
+	enum rdma_transport_type tp = device->query_transport(device, port_num);
+
+	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 5 lines
2.1.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
Reviewed-by on v5 2/27
#9 lore raw

Re: [PATCH v5 02/27] IB/Verbs: Implement raw management helpers

Quoted 8 lines · Michael Wang

Add raw helpers:
rdma_tech_ib
rdma_tech_iboe
rdma_tech_iwarp
rdma_ib_or_iboe (transition, clean up later)
To help us detect which technology the port supported.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 42 lines
---
 include/rdma/ib_verbs.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
include/rdma/ib_verbs.h +25 -0
index d54f91e..a12e876 100644
@@ -1748,6 +1748,31 @@ int ib_query_port(struct ib_device *device,
 enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device,
 					       u8 port_num);
 
+static inline int rdma_tech_ib(struct ib_device *device, u8 port_num)
+{
+	return device->query_transport(device, port_num)
+			== RDMA_TRANSPORT_IB;
+}
+
+static inline int rdma_tech_iboe(struct ib_device *device, u8 port_num)
+{
+	return device->query_transport(device, port_num)
+			== RDMA_TRANSPORT_IBOE;
+}
+
+static inline int rdma_tech_iwarp(struct ib_device *device, u8 port_num)
+{
+	return device->query_transport(device, port_num)
+			== RDMA_TRANSPORT_IWARP;
+}
+
+static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num)
+{
+	enum rdma_transport_type tp = device->query_transport(device, port_num);
+
+	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.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

#10 lore raw

PATCH v5 3/27 IB/Verbs: Reform IB-core mad/agent/user_mad

In reply to Michael Wang

Use raw management helpers to reform IB-core mad/agent/user_mad.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/agent.c    |  2 +-
 drivers/infiniband/core/mad.c      | 43 +++++++++++++++++++-------------------
 drivers/infiniband/core/user_mad.c | 26 ++++++++++++++++-------
 3 files changed, 41 insertions(+), 30 deletions(-)
drivers/infiniband/core/agent.c +1 -1
index f6d2961..ffdef4d 100644
@@ -156,7 +156,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
 		goto error1;
 	}
 
-	if (rdma_port_get_link_layer(device, port_num) == IB_LINK_LAYER_INFINIBAND) {
+	if (rdma_tech_ib(device, port_num)) {
 		/* Obtain send only MAD agent for SMI QP */
 		port_priv->agent[0] = ib_register_mad_agent(device, port_num,
 							    IB_QPT_SMI, NULL, 0,
drivers/infiniband/core/mad.c +21 -22

83 lines not on this page · raw message

drivers/infiniband/core/user_mad.c +19 -7
index 928cdd2..aa8b334 100644
@@ -1273,9 +1273,7 @@ static void ib_umad_add_one(struct ib_device *device)
 {
 	struct ib_umad_device *umad_dev;
 	int s, e, i;
-
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;
 
 	if (device->node_type == RDMA_NODE_IB_SWITCH)
 		s = e = 0;
@@ -1296,21 +1294,33 @@ static void ib_umad_add_one(struct ib_device *device)
 	umad_dev->end_port   = e;
 
 	for (i = s; i <= e; ++i) {
+		if (!rdma_ib_or_iboe(device, i))
+			continue;
+
 		umad_dev->port[i - s].umad_dev = umad_dev;
 
 		if (ib_umad_init_port(device, i, umad_dev,
 				      &umad_dev->port[i - s]))
 			goto err;
+
+		count++;
 	}
 
+	if (!count)
+		goto free;
+
 	ib_set_client_data(device, &umad_client, umad_dev);
 
 	return;
 
 err:
-	while (--i >= s)
-		ib_umad_kill_port(&umad_dev->port[i - s]);
+	while (--i >= s) {
+		if (!rdma_ib_or_iboe(device, i))
+			continue;
 
+		ib_umad_kill_port(&umad_dev->port[i - s]);
+	}
+free:
 	kobject_put(&umad_dev->kobj);
 }
 
@@ -1322,8 +1332,10 @@ static void ib_umad_remove_one(struct ib_device *device)
 	if (!umad_dev)
 		return;
 
-	for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i)
-		ib_umad_kill_port(&umad_dev->port[i]);
+	for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i) {
+		if (rdma_ib_or_iboe(device, i))
+			ib_umad_kill_port(&umad_dev->port[i]);
+	}
 
 	kobject_put(&umad_dev->kobj);
 }
Signature · 1 line
2.1.0
Reviewed-by on v5 3/27
#11 lore raw

Re: [PATCH v5 03/27] IB/Verbs: Reform IB-core mad/agent/user_mad

Quoted 11 lines · Michael Wang

Use raw management helpers to reform IB-core mad/agent/user_mad.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 176 lines
---
 drivers/infiniband/core/agent.c    |  2 +-
 drivers/infiniband/core/mad.c      | 43 +++++++++++++++++++-------------------
 drivers/infiniband/core/user_mad.c | 26 ++++++++++++++++-------
 3 files changed, 41 insertions(+), 30 deletions(-)
drivers/infiniband/core/agent.c +1 -1
index f6d2961..ffdef4d 100644
@@ -156,7 +156,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
 		goto error1;
 	}
 
-	if (rdma_port_get_link_layer(device, port_num) == IB_LINK_LAYER_INFINIBAND) {
+	if (rdma_tech_ib(device, port_num)) {
 		/* Obtain send only MAD agent for SMI QP */
 		port_priv->agent[0] = ib_register_mad_agent(device, port_num,
 							    IB_QPT_SMI, NULL, 0,
drivers/infiniband/core/mad.c +21 -22
index 74c30f4..1822932 100644
@@ -2938,7 +2938,7 @@ static int ib_mad_port_open(struct ib_device *device,
 	init_mad_qp(port_priv, &port_priv->qp_info[1]);
 
 	cq_size = mad_sendq_size + mad_recvq_size;
-	has_smi = rdma_port_get_link_layer(device, port_num) == IB_LINK_LAYER_INFINIBAND;
+	has_smi = rdma_tech_ib(device, port_num);
 	if (has_smi)
 		cq_size *= 2;
 
@@ -3057,9 +3057,6 @@ static void ib_mad_init_device(struct ib_device *device)
 {
 	int start, end, i;
 
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
-
 	if (device->node_type == RDMA_NODE_IB_SWITCH) {
 		start = 0;
 		end   = 0;
@@ -3069,6 +3066,9 @@ static void ib_mad_init_device(struct ib_device *device)
 	}
 
 	for (i = start; i <= end; i++) {
+		if (!rdma_ib_or_iboe(device, i))
+			continue;
+
 		if (ib_mad_port_open(device, i)) {
 			dev_err(&device->dev, "Couldn't open port %d\n", i);
 			goto error;
@@ -3086,40 +3086,39 @@ error_agent:
 		dev_err(&device->dev, "Couldn't close port %d\n", i);
 
 error:
-	i--;
+	while (--i >= start) {
+		if (!rdma_ib_or_iboe(device, i))
+			continue;
 
-	while (i >= start) {
 		if (ib_agent_port_close(device, i))
 			dev_err(&device->dev,
 				"Couldn't close port %d for agents\n", i);
 		if (ib_mad_port_close(device, i))
 			dev_err(&device->dev, "Couldn't close port %d\n", i);
-		i--;
 	}
 }
 
 static void ib_mad_remove_device(struct ib_device *device)
 {
-	int i, num_ports, cur_port;
-
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int start, end, i;
 
 	if (device->node_type == RDMA_NODE_IB_SWITCH) {
-		num_ports = 1;
-		cur_port = 0;
+		start = 0;
+		end   = 0;
 	} else {
-		num_ports = device->phys_port_cnt;
-		cur_port = 1;
+		start = 1;
+		end   = device->phys_port_cnt;
 	}
-	for (i = 0; i < num_ports; i++, cur_port++) {
-		if (ib_agent_port_close(device, cur_port))
+
+	for (i = start; i <= end; i++) {
+		if (!rdma_ib_or_iboe(device, i))
+			continue;
+
+		if (ib_agent_port_close(device, i))
 			dev_err(&device->dev,
-				"Couldn't close port %d for agents\n",
-				cur_port);
-		if (ib_mad_port_close(device, cur_port))
-			dev_err(&device->dev, "Couldn't close port %d\n",
-				cur_port);
+				"Couldn't close port %d for agents\n", i);
+		if (ib_mad_port_close(device, i))
+			dev_err(&device->dev, "Couldn't close port %d\n", i);
 	}
 }
 
drivers/infiniband/core/user_mad.c +19 -7
index 928cdd2..aa8b334 100644
@@ -1273,9 +1273,7 @@ static void ib_umad_add_one(struct ib_device *device)
 {
 	struct ib_umad_device *umad_dev;
 	int s, e, i;
-
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;
 
 	if (device->node_type == RDMA_NODE_IB_SWITCH)
 		s = e = 0;
@@ -1296,21 +1294,33 @@ static void ib_umad_add_one(struct ib_device *device)
 	umad_dev->end_port   = e;
 
 	for (i = s; i <= e; ++i) {
+		if (!rdma_ib_or_iboe(device, i))
+			continue;
+
 		umad_dev->port[i - s].umad_dev = umad_dev;
 
 		if (ib_umad_init_port(device, i, umad_dev,
 				      &umad_dev->port[i - s]))
 			goto err;
+
+		count++;
 	}
 
+	if (!count)
+		goto free;
+
 	ib_set_client_data(device, &umad_client, umad_dev);
 
 	return;
 
 err:
-	while (--i >= s)
-		ib_umad_kill_port(&umad_dev->port[i - s]);
+	while (--i >= s) {
+		if (!rdma_ib_or_iboe(device, i))
+			continue;
 
+		ib_umad_kill_port(&umad_dev->port[i - s]);
+	}
+free:
 	kobject_put(&umad_dev->kobj);
 }
 
@@ -1322,8 +1332,10 @@ static void ib_umad_remove_one(struct ib_device *device)
 	if (!umad_dev)
 		return;
 
-	for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i)
-		ib_umad_kill_port(&umad_dev->port[i]);
+	for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i) {
+		if (rdma_ib_or_iboe(device, i))
+			ib_umad_kill_port(&umad_dev->port[i]);
+	}
 
 	kobject_put(&umad_dev->kobj);
 }
Signature · 1 line
2.1.0
#12 lore raw

PATCH v5 4/27 IB/Verbs: Reform IB-core cm

In reply to Michael Wang

Use raw management helpers to reform IB-core cm.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cm.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
drivers/infiniband/core/cm.c +17 -3
index e28a494..3c10b75 100644
@@ -3761,9 +3761,7 @@ static void cm_add_one(struct ib_device *ib_device)
 	unsigned long flags;
 	int ret;
 	u8 i;
-
-	if (rdma_node_get_transport(ib_device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;
 
 	cm_dev = kzalloc(sizeof(*cm_dev) + sizeof(*port) *
 			 ib_device->phys_port_cnt, GFP_KERNEL);
@@ -3783,6 +3781,9 @@ static void cm_add_one(struct ib_device *ib_device)
 
 	set_bit(IB_MGMT_METHOD_SEND, reg_req.method_mask);
 	for (i = 1; i <= ib_device->phys_port_cnt; i++) {
+		if (!rdma_ib_or_iboe(ib_device, i))
+			continue;
+
 		port = kzalloc(sizeof *port, GFP_KERNEL);
 		if (!port)
 			goto error1;
@@ -3809,7 +3810,13 @@ static void cm_add_one(struct ib_device *ib_device)
 		ret = ib_modify_port(ib_device, i, 0, &port_modify);
 		if (ret)
 			goto error3;
+
+		count++;
 	}
+
+	if (!count)
+		goto free;
+
 	ib_set_client_data(ib_device, &cm_client, cm_dev);
 
 	write_lock_irqsave(&cm.device_lock, flags);
@@ -3825,11 +3832,15 @@ error1:
 	port_modify.set_port_cap_mask = 0;
 	port_modify.clr_port_cap_mask = IB_PORT_CM_SUP;
 	while (--i) {
+		if (!rdma_ib_or_iboe(ib_device, i))
+			continue;
+
 		port = cm_dev->port[i-1];
 		ib_modify_port(ib_device, port->port_num, 0, &port_modify);
 		ib_unregister_mad_agent(port->mad_agent);
 		cm_remove_port_fs(port);
 	}
+free:
 	device_unregister(cm_dev->device);
 	kfree(cm_dev);
 }
@@ -3853,6 +3864,9 @@ static void cm_remove_one(struct ib_device *ib_device)
 	write_unlock_irqrestore(&cm.device_lock, flags);
 
 	for (i = 1; i <= ib_device->phys_port_cnt; i++) {
+		if (!rdma_ib_or_iboe(ib_device, i))
+			continue;
+
 		port = cm_dev->port[i-1];
 		ib_modify_port(ib_device, port->port_num, 0, &port_modify);
 		ib_unregister_mad_agent(port->mad_agent);
Signature · 5 lines
2.1.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
#13 lore raw

Re: [PATCH v5 04/27] IB/Verbs: Reform IB-core cm

Quoted 20 lines · Michael Wang

Use raw management helpers to reform IB-core cm.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cm.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
drivers/infiniband/core/cm.c +0 -0
index e28a494..3c10b75 100644

drivers/infiniband/core/cm.c static void cm_add_one(struct ib_device *ib_device) · line 3764

Quoted 7 lines
drivers/infiniband/core/cm.c +1 -3
@@ -3761,9 +3761,7 @@ static void cm_add_one(struct ib_device *ib_device)
 	unsigned long flags;
 	int ret;
 	u8 i;
-
-	if (rdma_node_get_transport(ib_device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;

Nit: Should the int count line be moved above u8 i declaration so declarations are naturally aligned ?

-- Hal

<snip...>
--
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

#14 lore raw

Re: [PATCH v5 04/27] IB/Verbs: Reform IB-core cm

Quoted 16 lines · Hal Rosenstock
Quoted 15 lines · Michael Wang

Use raw management helpers to reform IB-core cm.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cm.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
Quoted 15 lines

drivers/infiniband/core/cm.c static void cm_add_one(struct ib_device *ib_device) · line 3764

Quoted 12 lines
drivers/infiniband/core/cm.c +1 -3
index e28a494..3c10b75 100644
@@ -3761,9 +3761,7 @@ static void cm_add_one(struct ib_device *ib_device)
 	unsigned long flags;
 	int ret;
 	u8 i;
-
-	if (rdma_node_get_transport(ib_device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;

Nit: Should the int count line be moved above u8 i declaration so declarations are naturally aligned ?

Make sense, will be in next version :-)

Regards,
Michael Wang

Quoted 5 lines

-- Hal

<snip...>

Reviewed-by on v5 4/27
#15 lore raw

Re: [PATCH v5 04/27] IB/Verbs: Reform IB-core cm

In reply to Michael Wang
Quoted 11 lines · Michael Wang

Use raw management helpers to reform IB-core cm.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 71 lines
---
 drivers/infiniband/core/cm.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
drivers/infiniband/core/cm.c +17 -3
index e28a494..3c10b75 100644
@@ -3761,9 +3761,7 @@ static void cm_add_one(struct ib_device *ib_device)
 	unsigned long flags;
 	int ret;
 	u8 i;
-
-	if (rdma_node_get_transport(ib_device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;
 
 	cm_dev = kzalloc(sizeof(*cm_dev) + sizeof(*port) *
 			 ib_device->phys_port_cnt, GFP_KERNEL);
@@ -3783,6 +3781,9 @@ static void cm_add_one(struct ib_device *ib_device)
 
 	set_bit(IB_MGMT_METHOD_SEND, reg_req.method_mask);
 	for (i = 1; i <= ib_device->phys_port_cnt; i++) {
+		if (!rdma_ib_or_iboe(ib_device, i))
+			continue;
+
 		port = kzalloc(sizeof *port, GFP_KERNEL);
 		if (!port)
 			goto error1;
@@ -3809,7 +3810,13 @@ static void cm_add_one(struct ib_device *ib_device)
 		ret = ib_modify_port(ib_device, i, 0, &port_modify);
 		if (ret)
 			goto error3;
+
+		count++;
 	}
+
+	if (!count)
+		goto free;
+
 	ib_set_client_data(ib_device, &cm_client, cm_dev);
 
 	write_lock_irqsave(&cm.device_lock, flags);
@@ -3825,11 +3832,15 @@ error1:
 	port_modify.set_port_cap_mask = 0;
 	port_modify.clr_port_cap_mask = IB_PORT_CM_SUP;
 	while (--i) {
+		if (!rdma_ib_or_iboe(ib_device, i))
+			continue;
+
 		port = cm_dev->port[i-1];
 		ib_modify_port(ib_device, port->port_num, 0, &port_modify);
 		ib_unregister_mad_agent(port->mad_agent);
 		cm_remove_port_fs(port);
 	}
+free:
 	device_unregister(cm_dev->device);
 	kfree(cm_dev);
 }
@@ -3853,6 +3864,9 @@ static void cm_remove_one(struct ib_device *ib_device)
 	write_unlock_irqrestore(&cm.device_lock, flags);
 
 	for (i = 1; i <= ib_device->phys_port_cnt; i++) {
+		if (!rdma_ib_or_iboe(ib_device, i))
+			continue;
+
 		port = cm_dev->port[i-1];
 		ib_modify_port(ib_device, port->port_num, 0, &port_modify);
 		ib_unregister_mad_agent(port->mad_agent);
Signature · 1 line
2.1.0
#16 lore raw

PATCH v5 5/27 IB/Verbs: Reform IB-core sa_query

In reply to Michael Wang

Use raw management helpers to reform IB-core sa_query.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/sa_query.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)
drivers/infiniband/core/sa_query.c +17 -12
index c38f030..60dc7aa 100644
@@ -450,7 +450,7 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event
 		struct ib_sa_port *port =
 			&sa_dev->port[event->element.port_num - sa_dev->start_port];
 
-		if (rdma_port_get_link_layer(handler->device, port->port_num) != IB_LINK_LAYER_INFINIBAND)
+		if (WARN_ON(!rdma_tech_ib(handler->device, port->port_num)))
 			return;
 
 		spin_lock_irqsave(&port->ah_lock, flags);
@@ -540,7 +540,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
 	ah_attr->port_num = port_num;
 	ah_attr->static_rate = rec->rate;
 
-	force_grh = rdma_port_get_link_layer(device, port_num) == IB_LINK_LAYER_ETHERNET;
+	force_grh = rdma_tech_iboe(device, port_num);
 
 	if (rec->hop_limit > 1 || force_grh) {
 		ah_attr->ah_flags = IB_AH_GRH;
@@ -1153,9 +1153,7 @@ static void ib_sa_add_one(struct ib_device *device)
 {
 	struct ib_sa_device *sa_dev;
 	int s, e, i;
-
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;
 
 	if (device->node_type == RDMA_NODE_IB_SWITCH)
 		s = e = 0;
@@ -1175,7 +1173,7 @@ static void ib_sa_add_one(struct ib_device *device)
 
 	for (i = 0; i <= e - s; ++i) {
 		spin_lock_init(&sa_dev->port[i].ah_lock);
-		if (rdma_port_get_link_layer(device, i + 1) != IB_LINK_LAYER_INFINIBAND)
+		if (!rdma_tech_ib(device, i + 1))
 			continue;
 
 		sa_dev->port[i].sm_ah    = NULL;
@@ -1189,8 +1187,13 @@ static void ib_sa_add_one(struct ib_device *device)
 			goto err;
 
 		INIT_WORK(&sa_dev->port[i].update_task, update_sm_ah);
+
+		count++;
 	}
 
+	if (!count)
+		goto free;
+
 	ib_set_client_data(device, &sa_client, sa_dev);
 
 	/*
@@ -1204,19 +1207,21 @@ static void ib_sa_add_one(struct ib_device *device)
 	if (ib_register_event_handler(&sa_dev->event_handler))
 		goto err;
 
-	for (i = 0; i <= e - s; ++i)
-		if (rdma_port_get_link_layer(device, i + 1) == IB_LINK_LAYER_INFINIBAND)
+	for (i = 0; i <= e - s; ++i) {
+		if (rdma_tech_ib(device, i + 1))
 			update_sm_ah(&sa_dev->port[i].update_task);
+	}
 
 	return;
 
 err:
-	while (--i >= 0)
-		if (rdma_port_get_link_layer(device, i + 1) == IB_LINK_LAYER_INFINIBAND)
+	while (--i >= 0) {
+		if (rdma_tech_ib(device, i + 1))
 			ib_unregister_mad_agent(sa_dev->port[i].agent);
+	}
 
+free:
 	kfree(sa_dev);
-
 	return;
 }
 
@@ -1233,7 +1238,7 @@ static void ib_sa_remove_one(struct ib_device *device)
 	flush_workqueue(ib_wq);
 
 	for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) {
-		if (rdma_port_get_link_layer(device, i + 1) == IB_LINK_LAYER_INFINIBAND) {
+		if (rdma_tech_ib(device, i + 1)) {
 			ib_unregister_mad_agent(sa_dev->port[i].agent);
 			if (sa_dev->port[i].sm_ah)
 				kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah);
Signature · 1 line
2.1.0
Reviewed-by on v5 5/27
#17 lore raw

Re: [PATCH v5 05/27] IB/Verbs: Reform IB-core sa_query

Quoted 12 lines · Michael Wang

Use raw management helpers to reform IB-core sa_query.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 98 lines
---
 drivers/infiniband/core/sa_query.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)
drivers/infiniband/core/sa_query.c +17 -12
index c38f030..60dc7aa 100644
@@ -450,7 +450,7 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event
 		struct ib_sa_port *port =
 			&sa_dev->port[event->element.port_num - sa_dev->start_port];
 
-		if (rdma_port_get_link_layer(handler->device, port->port_num) != IB_LINK_LAYER_INFINIBAND)
+		if (WARN_ON(!rdma_tech_ib(handler->device, port->port_num)))
 			return;
 
 		spin_lock_irqsave(&port->ah_lock, flags);
@@ -540,7 +540,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
 	ah_attr->port_num = port_num;
 	ah_attr->static_rate = rec->rate;
 
-	force_grh = rdma_port_get_link_layer(device, port_num) == IB_LINK_LAYER_ETHERNET;
+	force_grh = rdma_tech_iboe(device, port_num);
 
 	if (rec->hop_limit > 1 || force_grh) {
 		ah_attr->ah_flags = IB_AH_GRH;
@@ -1153,9 +1153,7 @@ static void ib_sa_add_one(struct ib_device *device)
 {
 	struct ib_sa_device *sa_dev;
 	int s, e, i;
-
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;
 
 	if (device->node_type == RDMA_NODE_IB_SWITCH)
 		s = e = 0;
@@ -1175,7 +1173,7 @@ static void ib_sa_add_one(struct ib_device *device)
 
 	for (i = 0; i <= e - s; ++i) {
 		spin_lock_init(&sa_dev->port[i].ah_lock);
-		if (rdma_port_get_link_layer(device, i + 1) != IB_LINK_LAYER_INFINIBAND)
+		if (!rdma_tech_ib(device, i + 1))
 			continue;
 
 		sa_dev->port[i].sm_ah    = NULL;
@@ -1189,8 +1187,13 @@ static void ib_sa_add_one(struct ib_device *device)
 			goto err;
 
 		INIT_WORK(&sa_dev->port[i].update_task, update_sm_ah);
+
+		count++;
 	}
 
+	if (!count)
+		goto free;
+
 	ib_set_client_data(device, &sa_client, sa_dev);
 
 	/*
@@ -1204,19 +1207,21 @@ static void ib_sa_add_one(struct ib_device *device)
 	if (ib_register_event_handler(&sa_dev->event_handler))
 		goto err;
 
-	for (i = 0; i <= e - s; ++i)
-		if (rdma_port_get_link_layer(device, i + 1) == IB_LINK_LAYER_INFINIBAND)
+	for (i = 0; i <= e - s; ++i) {
+		if (rdma_tech_ib(device, i + 1))
 			update_sm_ah(&sa_dev->port[i].update_task);
+	}
 
 	return;
 
 err:
-	while (--i >= 0)
-		if (rdma_port_get_link_layer(device, i + 1) == IB_LINK_LAYER_INFINIBAND)
+	while (--i >= 0) {
+		if (rdma_tech_ib(device, i + 1))
 			ib_unregister_mad_agent(sa_dev->port[i].agent);
+	}
 
+free:
 	kfree(sa_dev);
-
 	return;
 }
 
@@ -1233,7 +1238,7 @@ static void ib_sa_remove_one(struct ib_device *device)
 	flush_workqueue(ib_wq);
 
 	for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) {
-		if (rdma_port_get_link_layer(device, i + 1) == IB_LINK_LAYER_INFINIBAND) {
+		if (rdma_tech_ib(device, i + 1)) {
 			ib_unregister_mad_agent(sa_dev->port[i].agent);
 			if (sa_dev->port[i].sm_ah)
 				kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah);
Signature · 1 line
2.1.0
#18 lore raw

PATCH v5 6/27 IB/Verbs: Reform IB-core multicast

In reply to Michael Wang

Use raw management helpers to reform IB-core multicast.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/multicast.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/infiniband/core/multicast.c +3 -9
index fa17b55..24d93f5 100644
@@ -780,8 +780,7 @@ static void mcast_event_handler(struct ib_event_handler *handler,
 	int index;
 
 	dev = container_of(handler, struct mcast_device, event_handler);
-	if (rdma_port_get_link_layer(dev->device, event->element.port_num) !=
-	    IB_LINK_LAYER_INFINIBAND)
+	if (WARN_ON(!rdma_tech_ib(dev->device, event->element.port_num)))
 		return;
 
 	index = event->element.port_num - dev->start_port;
@@ -808,9 +807,6 @@ static void mcast_add_one(struct ib_device *device)
 	int i;
 	int count = 0;
 
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
-
 	dev = kmalloc(sizeof *dev + device->phys_port_cnt * sizeof *port,
 		      GFP_KERNEL);
 	if (!dev)
@@ -824,8 +820,7 @@ static void mcast_add_one(struct ib_device *device)
 	}
 
 	for (i = 0; i <= dev->end_port - dev->start_port; i++) {
-		if (rdma_port_get_link_layer(device, dev->start_port + i) !=
-		    IB_LINK_LAYER_INFINIBAND)
+		if (!rdma_tech_ib(device, dev->start_port + i))
 			continue;
 		port = &dev->port[i];
 		port->dev = dev;
@@ -863,8 +858,7 @@ static void mcast_remove_one(struct ib_device *device)
 	flush_workqueue(mcast_wq);
 
 	for (i = 0; i <= dev->end_port - dev->start_port; i++) {
-		if (rdma_port_get_link_layer(device, dev->start_port + i) ==
-		    IB_LINK_LAYER_INFINIBAND) {
+		if (rdma_tech_ib(device, dev->start_port + i)) {
 			port = &dev->port[i];
 			deref_port(port);
 			wait_for_completion(&port->comp);
Signature · 5 lines
2.1.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
Reviewed-by on v5 6/27
#19 lore raw

Re: [PATCH v5 06/27] IB/Verbs: Reform IB-core multicast

Quoted 11 lines · Michael Wang

Use raw management helpers to reform IB-core multicast.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 50 lines
---
 drivers/infiniband/core/multicast.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/infiniband/core/multicast.c +3 -9
index fa17b55..24d93f5 100644
@@ -780,8 +780,7 @@ static void mcast_event_handler(struct ib_event_handler *handler,
 	int index;
 
 	dev = container_of(handler, struct mcast_device, event_handler);
-	if (rdma_port_get_link_layer(dev->device, event->element.port_num) !=
-	    IB_LINK_LAYER_INFINIBAND)
+	if (WARN_ON(!rdma_tech_ib(dev->device, event->element.port_num)))
 		return;
 
 	index = event->element.port_num - dev->start_port;
@@ -808,9 +807,6 @@ static void mcast_add_one(struct ib_device *device)
 	int i;
 	int count = 0;
 
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
-
 	dev = kmalloc(sizeof *dev + device->phys_port_cnt * sizeof *port,
 		      GFP_KERNEL);
 	if (!dev)
@@ -824,8 +820,7 @@ static void mcast_add_one(struct ib_device *device)
 	}
 
 	for (i = 0; i <= dev->end_port - dev->start_port; i++) {
-		if (rdma_port_get_link_layer(device, dev->start_port + i) !=
-		    IB_LINK_LAYER_INFINIBAND)
+		if (!rdma_tech_ib(device, dev->start_port + i))
 			continue;
 		port = &dev->port[i];
 		port->dev = dev;
@@ -863,8 +858,7 @@ static void mcast_remove_one(struct ib_device *device)
 	flush_workqueue(mcast_wq);
 
 	for (i = 0; i <= dev->end_port - dev->start_port; i++) {
-		if (rdma_port_get_link_layer(device, dev->start_port + i) ==
-		    IB_LINK_LAYER_INFINIBAND) {
+		if (rdma_tech_ib(device, dev->start_port + i)) {
 			port = &dev->port[i];
 			deref_port(port);
 			wait_for_completion(&port->comp);
Signature · 1 line
2.1.0
#20 lore raw

PATCH v5 7/27 IB/Verbs: Reform IB-ulp ipoib

In reply to Michael Wang

Use raw management helpers to reform IB-ulp ipoib.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +8 -7
index 58b5aa3..60b379d 100644
@@ -1654,9 +1654,7 @@ static void ipoib_add_one(struct ib_device *device)
 	struct net_device *dev;
 	struct ipoib_dev_priv *priv;
 	int s, e, p;
-
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;
 
 	dev_list = kmalloc(sizeof *dev_list, GFP_KERNEL);
 	if (!dev_list)
@@ -1673,15 +1671,21 @@ static void ipoib_add_one(struct ib_device *device)
 	}
 
 	for (p = s; p <= e; ++p) {
-		if (rdma_port_get_link_layer(device, p) != IB_LINK_LAYER_INFINIBAND)
+		if (!rdma_tech_ib(device, p))
 			continue;
 		dev = ipoib_add_port("ib%d", device, p);
 		if (!IS_ERR(dev)) {
 			priv = netdev_priv(dev);
 			list_add_tail(&priv->list, dev_list);
+			count++;
 		}
 	}
 
+	if (!count) {
+		kfree(dev_list);
+		return;
+	}
+
 	ib_set_client_data(device, &ipoib_client, dev_list);
 }
 
@@ -1690,9 +1694,6 @@ static void ipoib_remove_one(struct ib_device *device)
 	struct ipoib_dev_priv *priv, *tmp;
 	struct list_head *dev_list;
 
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
-
 	dev_list = ib_get_client_data(device, &ipoib_client);
 	if (!dev_list)
 		return;
Signature · 1 line
2.1.0
Reviewed-by on v5 7/27
#21 lore raw

Re: [PATCH v5 07/27] IB/Verbs: Reform IB-ulp ipoib

Quoted 11 lines · Michael Wang

Use raw management helpers to reform IB-ulp ipoib.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 54 lines
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +8 -7
index 58b5aa3..60b379d 100644
@@ -1654,9 +1654,7 @@ static void ipoib_add_one(struct ib_device *device)
 	struct net_device *dev;
 	struct ipoib_dev_priv *priv;
 	int s, e, p;
-
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
+	int count = 0;
 
 	dev_list = kmalloc(sizeof *dev_list, GFP_KERNEL);
 	if (!dev_list)
@@ -1673,15 +1671,21 @@ static void ipoib_add_one(struct ib_device *device)
 	}
 
 	for (p = s; p <= e; ++p) {
-		if (rdma_port_get_link_layer(device, p) != IB_LINK_LAYER_INFINIBAND)
+		if (!rdma_tech_ib(device, p))
 			continue;
 		dev = ipoib_add_port("ib%d", device, p);
 		if (!IS_ERR(dev)) {
 			priv = netdev_priv(dev);
 			list_add_tail(&priv->list, dev_list);
+			count++;
 		}
 	}
 
+	if (!count) {
+		kfree(dev_list);
+		return;
+	}
+
 	ib_set_client_data(device, &ipoib_client, dev_list);
 }
 
@@ -1690,9 +1694,6 @@ static void ipoib_remove_one(struct ib_device *device)
 	struct ipoib_dev_priv *priv, *tmp;
 	struct list_head *dev_list;
 
-	if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
-		return;
-
 	dev_list = ib_get_client_data(device, &ipoib_client);
 	if (!dev_list)
 		return;
Signature · 1 line
2.1.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

#22 lore raw

PATCH v5 8/27 IB/Verbs: Reform IB-ulp xprtrdma

In reply to Michael Wang

Use raw management helpers to reform IB-ulp xprtrdma.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c  |  3 +--
 net/sunrpc/xprtrdma/svc_rdma_transport.c | 45 +++++++++++++-------------------
 2 files changed, 19 insertions(+), 29 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +1 -2
index f9f13a3..a5bed5b 100644
@@ -117,8 +117,7 @@ static void rdma_build_arg_xdr(struct svc_rqst *rqstp,
 
 static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
 {
-	if (rdma_node_get_transport(xprt->sc_cm_id->device->node_type) ==
-	     RDMA_TRANSPORT_IWARP)
+	if (rdma_tech_iwarp(xprt->sc_cm_id->device, xprt->sc_cm_id->port_num))
 		return 1;
 	else
 		return min_t(int, sge_count, xprt->sc_max_sge);
net/sunrpc/xprtrdma/svc_rdma_transport.c +18 -27

60 lines not on this page · raw message

Signature · 1 line
2.1.0
Reviewed-by on v5 8/27
#23 lore raw

Re: [PATCH v5 08/27] IB/Verbs: Reform IB-ulp xprtrdma

Quoted 11 lines · Michael Wang

Use raw management helpers to reform IB-ulp xprtrdma.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 87 lines
---
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c  |  3 +--
 net/sunrpc/xprtrdma/svc_rdma_transport.c | 45 +++++++++++++-------------------
 2 files changed, 19 insertions(+), 29 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +1 -2
index f9f13a3..a5bed5b 100644
@@ -117,8 +117,7 @@ static void rdma_build_arg_xdr(struct svc_rqst *rqstp,
 
 static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
 {
-	if (rdma_node_get_transport(xprt->sc_cm_id->device->node_type) ==
-	     RDMA_TRANSPORT_IWARP)
+	if (rdma_tech_iwarp(xprt->sc_cm_id->device, xprt->sc_cm_id->port_num))
 		return 1;
 	else
 		return min_t(int, sge_count, xprt->sc_max_sge);
net/sunrpc/xprtrdma/svc_rdma_transport.c +18 -27
index f609c1c..a09b7a1 100644
@@ -851,7 +851,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
 	struct ib_qp_init_attr qp_attr;
 	struct ib_device_attr devattr;
 	int uninitialized_var(dma_mr_acc);
-	int need_dma_mr;
+	int need_dma_mr = 0;
 	int ret;
 	int i;
 
@@ -985,35 +985,26 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
 	/*
 	 * Determine if a DMA MR is required and if so, what privs are required
 	 */
-	switch (rdma_node_get_transport(newxprt->sc_cm_id->device->node_type)) {
-	case RDMA_TRANSPORT_IWARP:
-		newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_READ_W_INV;
-		if (!(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG)) {
-			need_dma_mr = 1;
-			dma_mr_acc =
-				(IB_ACCESS_LOCAL_WRITE |
-				 IB_ACCESS_REMOTE_WRITE);
-		} else if (!(devattr.device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY)) {
-			need_dma_mr = 1;
-			dma_mr_acc = IB_ACCESS_LOCAL_WRITE;
-		} else
-			need_dma_mr = 0;
-		break;
-	case RDMA_TRANSPORT_IB:
-		if (!(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG)) {
-			need_dma_mr = 1;
-			dma_mr_acc = IB_ACCESS_LOCAL_WRITE;
-		} else if (!(devattr.device_cap_flags &
-			     IB_DEVICE_LOCAL_DMA_LKEY)) {
-			need_dma_mr = 1;
-			dma_mr_acc = IB_ACCESS_LOCAL_WRITE;
-		} else
-			need_dma_mr = 0;
-		break;
-	default:
+	if (!rdma_tech_iwarp(newxprt->sc_cm_id->device,
+			     newxprt->sc_cm_id->port_num) &&
+	    !rdma_ib_or_iboe(newxprt->sc_cm_id->device,
+			     newxprt->sc_cm_id->port_num))
 		goto errout;
+
+	if (!(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG) ||
+	    !(devattr.device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY)) {
+		need_dma_mr = 1;
+		dma_mr_acc = IB_ACCESS_LOCAL_WRITE;
+		if (rdma_tech_iwarp(newxprt->sc_cm_id->device,
+				    newxprt->sc_cm_id->port_num) &&
+		    !(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG))
+			dma_mr_acc |= IB_ACCESS_REMOTE_WRITE;
 	}
 
+	if (rdma_tech_iwarp(newxprt->sc_cm_id->device,
+			    newxprt->sc_cm_id->port_num))
+		newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_READ_W_INV;
+
 	/* Create the DMA MR if needed, otherwise, use the DMA LKEY */
 	if (need_dma_mr) {
 		/* Register all of physical memory */
Signature · 1 line
2.1.0
#24 lore raw

PATCH v5 9/27 IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs

In reply to Michael Wang

Use raw management helpers to reform IB-core verbs/uverbs_cmd/sysfs.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/sysfs.c      | 8 ++------
 drivers/infiniband/core/uverbs_cmd.c | 6 ++++--
 drivers/infiniband/core/verbs.c      | 6 ++----
 3 files changed, 8 insertions(+), 12 deletions(-)
drivers/infiniband/core/sysfs.c +2 -6
index cbd0383..8570180 100644
@@ -248,14 +248,10 @@ static ssize_t phys_state_show(struct ib_port *p, struct port_attribute *unused,
 static ssize_t link_layer_show(struct ib_port *p, struct port_attribute *unused,
 			       char *buf)
 {
-	switch (rdma_port_get_link_layer(p->ibdev, p->port_num)) {
-	case IB_LINK_LAYER_INFINIBAND:
+	if (rdma_tech_ib(p->ibdev, p->port_num))
 		return sprintf(buf, "%s\n", "InfiniBand");
-	case IB_LINK_LAYER_ETHERNET:
+	else
 		return sprintf(buf, "%s\n", "Ethernet");
-	default:
-		return sprintf(buf, "%s\n", "Unknown");
-	}
 }
 
 static PORT_ATTR_RO(state);
drivers/infiniband/core/uverbs_cmd.c +4 -2
index a9f0489..5dc90aa 100644
@@ -515,8 +515,10 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
 	resp.active_width    = attr.active_width;
 	resp.active_speed    = attr.active_speed;
 	resp.phys_state      = attr.phys_state;
-	resp.link_layer      = rdma_port_get_link_layer(file->device->ib_dev,
-							cmd.port_num);
+	resp.link_layer      = rdma_tech_ib(file->device->ib_dev,
+							cmd.port_num) ?
+			       IB_LINK_LAYER_INFINIBAND :
+			       IB_LINK_LAYER_ETHERNET;
 
 	if (copy_to_user((void __user *) (unsigned long) cmd.response,
 			 &resp, sizeof resp))
drivers/infiniband/core/verbs.c +2 -4
index 626c9cf..7264860 100644
@@ -200,11 +200,9 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc,
 	u32 flow_class;
 	u16 gid_index;
 	int ret;
-	int is_eth = (rdma_port_get_link_layer(device, port_num) ==
-			IB_LINK_LAYER_ETHERNET);
 
 	memset(ah_attr, 0, sizeof *ah_attr);
-	if (is_eth) {
+	if (rdma_tech_iboe(device, port_num)) {
 		if (!(wc->wc_flags & IB_WC_GRH))
 			return -EPROTOTYPE;
 
@@ -873,7 +871,7 @@ int ib_resolve_eth_l2_attrs(struct ib_qp *qp,
 	union ib_gid  sgid;
 
 	if ((*qp_attr_mask & IB_QP_AV)  &&
-	    (rdma_port_get_link_layer(qp->device, qp_attr->ah_attr.port_num) == IB_LINK_LAYER_ETHERNET)) {
+	    (rdma_tech_iboe(qp->device, qp_attr->ah_attr.port_num))) {
 		ret = ib_query_gid(qp->device, qp_attr->ah_attr.port_num,
 				   qp_attr->ah_attr.grh.sgid_index, &sgid);
 		if (ret)
Signature · 5 lines
2.1.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
#25 lore raw

Re: [PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs

Quoted 22 lines · Michael Wang

Use raw management helpers to reform IB-core verbs/uverbs_cmd/sysfs.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/sysfs.c      | 8 ++------
 drivers/infiniband/core/uverbs_cmd.c | 6 ++++--
 drivers/infiniband/core/verbs.c      | 6 ++----
 3 files changed, 8 insertions(+), 12 deletions(-)
drivers/infiniband/core/sysfs.c +0 -0
index cbd0383..8570180 100644

drivers/infiniband/core/sysfs.c static ssize_t phys_state_show(struct ib_port *p, struct port_attribute *unused, · line 251

Quoted 6 lines
drivers/infiniband/core/sysfs.c +1 -2
@@ -248,14 +248,10 @@ static ssize_t phys_state_show(struct ib_port *p, struct port_attribute *unused,
 static ssize_t link_layer_show(struct ib_port *p, struct port_attribute *unused,
 			       char *buf)
 {
-	switch (rdma_port_get_link_layer(p->ibdev, p->port_num)) {
-	case IB_LINK_LAYER_INFINIBAND:
+	if (rdma_tech_ib(p->ibdev, p->port_num))

Is the final intention to remove Link Layer from the rdma stack entirely?

I know that the use of link layer in userspace is just as convoluted as what we are trying to fix here in the kernel. So it would be nice if we can eventually get user space cleaned up to not use link layer as it currently does.

However, standard networking tools can report the link layer. So while the current use of "link layer" via userspace software is wrong I don't think it is wrong to report this information _to_ userspace.

So unless we intend to completely hide the link layer from userspace I don't think we should be removing the rdma_port_get_link_layer call. It is still valid information even though we don't want to use it in most places.

Ira

Quoted 55 lines
drivers/infiniband/core/sysfs.c +1 -4
 		return sprintf(buf, "%s\n", "InfiniBand");
-	case IB_LINK_LAYER_ETHERNET:
+	else
 		return sprintf(buf, "%s\n", "Ethernet");
-	default:
-		return sprintf(buf, "%s\n", "Unknown");
-	}
 }
 
 static PORT_ATTR_RO(state);
drivers/infiniband/core/uverbs_cmd.c +4 -2
index a9f0489..5dc90aa 100644
@@ -515,8 +515,10 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
 	resp.active_width    = attr.active_width;
 	resp.active_speed    = attr.active_speed;
 	resp.phys_state      = attr.phys_state;
-	resp.link_layer      = rdma_port_get_link_layer(file->device->ib_dev,
-							cmd.port_num);
+	resp.link_layer      = rdma_tech_ib(file->device->ib_dev,
+							cmd.port_num) ?
+			       IB_LINK_LAYER_INFINIBAND :
+			       IB_LINK_LAYER_ETHERNET;
 
 	if (copy_to_user((void __user *) (unsigned long) cmd.response,
 			 &resp, sizeof resp))
drivers/infiniband/core/verbs.c +2 -4
index 626c9cf..7264860 100644
@@ -200,11 +200,9 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc,
 	u32 flow_class;
 	u16 gid_index;
 	int ret;
-	int is_eth = (rdma_port_get_link_layer(device, port_num) ==
-			IB_LINK_LAYER_ETHERNET);
 
 	memset(ah_attr, 0, sizeof *ah_attr);
-	if (is_eth) {
+	if (rdma_tech_iboe(device, port_num)) {
 		if (!(wc->wc_flags & IB_WC_GRH))
 			return -EPROTOTYPE;
 
@@ -873,7 +871,7 @@ int ib_resolve_eth_l2_attrs(struct ib_qp *qp,
 	union ib_gid  sgid;
 
 	if ((*qp_attr_mask & IB_QP_AV)  &&
-	    (rdma_port_get_link_layer(qp->device, qp_attr->ah_attr.port_num) == IB_LINK_LAYER_ETHERNET)) {
+	    (rdma_tech_iboe(qp->device, qp_attr->ah_attr.port_num))) {
 		ret = ib_query_gid(qp->device, qp_attr->ah_attr.port_num,
 				   qp_attr->ah_attr.grh.sgid_index, &sgid);
 		if (ret)
Signature · 1 line
2.1.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

#26 lore raw

Re: [PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs

Hi, Ira

Thanks for the review :-)

On 04/22/2015 01:19 AM, ira.weiny wrote:
[snip]

Quoted 18 lines

drivers/infiniband/core/sysfs.c static ssize_t phys_state_show(struct ib_port *p, struct port_attribute *unused, · line 251

Quoted 11 lines
drivers/infiniband/core/sysfs.c +1 -2
index cbd0383..8570180 100644
@@ -248,14 +248,10 @@ static ssize_t phys_state_show(struct ib_port *p, struct port_attribute *unused,
 static ssize_t link_layer_show(struct ib_port *p, struct port_attribute *unused,
 			       char *buf)
 {
-	switch (rdma_port_get_link_layer(p->ibdev, p->port_num)) {
-	case IB_LINK_LAYER_INFINIBAND:
+	if (rdma_tech_ib(p->ibdev, p->port_num))

Is the final intention to remove Link Layer from the rdma stack entirely?

I know that the use of link layer in userspace is just as convoluted as what we are trying to fix here in the kernel. So it would be nice if we can eventually get user space cleaned up to not use link layer as it currently does.

Quoted 7 lines

However, standard networking tools can report the link layer. So while the current use of "link layer" via userspace software is wrong I don't think it is wrong to report this information _to_ userspace.

So unless we intend to completely hide the link layer from userspace I don't think we should be removing the rdma_port_get_link_layer call. It is still valid information even though we don't want to use it in most places.

This series won't erase the rdma_port_get_link_layer(), although currently only mlx4 still using it in kernel...

link_layer_show() was supposed to report the same info to user space as usual, so user tool don't have to change anything :-)

Regards,
Michael Wang

Quoted 50 lines

Ira

Quoted 47 lines
drivers/infiniband/core/sysfs.c +1 -4
 		return sprintf(buf, "%s\n", "InfiniBand");
-	case IB_LINK_LAYER_ETHERNET:
+	else
 		return sprintf(buf, "%s\n", "Ethernet");
-	default:
-		return sprintf(buf, "%s\n", "Unknown");
-	}
 }
 
 static PORT_ATTR_RO(state);
drivers/infiniband/core/uverbs_cmd.c +4 -2
index a9f0489..5dc90aa 100644
@@ -515,8 +515,10 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
 	resp.active_width    = attr.active_width;
 	resp.active_speed    = attr.active_speed;
 	resp.phys_state      = attr.phys_state;
-	resp.link_layer      = rdma_port_get_link_layer(file->device->ib_dev,
-							cmd.port_num);
+	resp.link_layer      = rdma_tech_ib(file->device->ib_dev,
+							cmd.port_num) ?
+			       IB_LINK_LAYER_INFINIBAND :
+			       IB_LINK_LAYER_ETHERNET;
 
 	if (copy_to_user((void __user *) (unsigned long) cmd.response,
 			 &resp, sizeof resp))
drivers/infiniband/core/verbs.c +1 -3
index 626c9cf..7264860 100644
@@ -200,11 +200,9 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc,
 	u32 flow_class;
 	u16 gid_index;
 	int ret;
-	int is_eth = (rdma_port_get_link_layer(device, port_num) ==
-			IB_LINK_LAYER_ETHERNET);
 
 	memset(ah_attr, 0, sizeof *ah_attr);
-	if (is_eth) {
+	if (rdma_tech_iboe(device, port_num)) {
 		if (!(wc->wc_flags & IB_WC_GRH))
 			return -EPROTOTYPE;
 
@@ -873,7 +871,7 @@ int ib_resolve_eth_l2_attrs(struct ib_qp *qp,
 	union ib_gid  sgid;
 
Quoted 8 lines
Quoted 8 lines
drivers/infiniband/core/verbs.c +1 -1
 	if ((*qp_attr_mask & IB_QP_AV)  &&
-	    (rdma_port_get_link_layer(qp->device, qp_attr->ah_attr.port_num) == IB_LINK_LAYER_ETHERNET)) {
+	    (rdma_tech_iboe(qp->device, qp_attr->ah_attr.port_num))) {
 		ret = ib_query_gid(qp->device, qp_attr->ah_attr.port_num,
 				   qp_attr->ah_attr.grh.sgid_index, &sgid);
 		if (ret)
Signature · 1 line
2.1.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

#27 lore raw

Re: [PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs

Quoted 28 lines · Michael Wang

Hi, Ira

Thanks for the review :-)

On 04/22/2015 01:19 AM, ira.weiny wrote:
[snip]

Quoted 22 lines

drivers/infiniband/core/sysfs.c static ssize_t phys_state_show(struct ib_port *p, struct port_attribute *unused, · line 251

Quoted 11 lines
drivers/infiniband/core/sysfs.c +1 -2
index cbd0383..8570180 100644
@@ -248,14 +248,10 @@ static ssize_t phys_state_show(struct ib_port *p, struct port_attribute *unused,
 static ssize_t link_layer_show(struct ib_port *p, struct port_attribute *unused,
 			       char *buf)
 {
-	switch (rdma_port_get_link_layer(p->ibdev, p->port_num)) {
-	case IB_LINK_LAYER_INFINIBAND:
+	if (rdma_tech_ib(p->ibdev, p->port_num))

Is the final intention to remove Link Layer from the rdma stack entirely?

I know that the use of link layer in userspace is just as convoluted as what we are trying to fix here in the kernel. So it would be nice if we can eventually get user space cleaned up to not use link layer as it currently does.

However, standard networking tools can report the link layer. So while the current use of "link layer" via userspace software is wrong I don't think it is wrong to report this information _to_ userspace.

Quoted 6 lines
Quoted 3 lines

So unless we intend to completely hide the link layer from userspace I don't think we should be removing the rdma_port_get_link_layer call. It is still valid information even though we don't want to use it in most places.

This series won't erase the rdma_port_get_link_layer(), although currently only mlx4 still using it in kernel...

But this patch does not return that information to the user. So we have the drivers reporting a link layer which is no longer exposed userspace.

I think we need to separate the rdma_tech_ib (or cap_tech_ib or whatever) from reporting the link layer.

Quoted 3 lines

link_layer_show() was supposed to report the same info to user space as usual, so user tool don't have to change anything :-)

We need to expose the "cap_*" functionality to userspace which can then convert to this interface and stop relying on inferring support based on the link layer. But that is a separate issue from correctly reporting the link layer.

The link layer should be reported correctly from the drivers "get_link_layer" call.

Ira

Quoted 54 lines

Regards,
Michael Wang

Quoted 50 lines

Ira

Quoted 47 lines
drivers/infiniband/core/sysfs.c +1 -4
 		return sprintf(buf, "%s\n", "InfiniBand");
-	case IB_LINK_LAYER_ETHERNET:
+	else
 		return sprintf(buf, "%s\n", "Ethernet");
-	default:
-		return sprintf(buf, "%s\n", "Unknown");
-	}
 }
 
 static PORT_ATTR_RO(state);
drivers/infiniband/core/uverbs_cmd.c +4 -2
index a9f0489..5dc90aa 100644
@@ -515,8 +515,10 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
 	resp.active_width    = attr.active_width;
 	resp.active_speed    = attr.active_speed;
 	resp.phys_state      = attr.phys_state;
-	resp.link_layer      = rdma_port_get_link_layer(file->device->ib_dev,
-							cmd.port_num);
+	resp.link_layer      = rdma_tech_ib(file->device->ib_dev,
+							cmd.port_num) ?
+			       IB_LINK_LAYER_INFINIBAND :
+			       IB_LINK_LAYER_ETHERNET;
 
 	if (copy_to_user((void __user *) (unsigned long) cmd.response,
 			 &resp, sizeof resp))
drivers/infiniband/core/verbs.c +1 -3
index 626c9cf..7264860 100644
@@ -200,11 +200,9 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc,
 	u32 flow_class;
 	u16 gid_index;
 	int ret;
-	int is_eth = (rdma_port_get_link_layer(device, port_num) ==
-			IB_LINK_LAYER_ETHERNET);
 
 	memset(ah_attr, 0, sizeof *ah_attr);
-	if (is_eth) {
+	if (rdma_tech_iboe(device, port_num)) {
 		if (!(wc->wc_flags & IB_WC_GRH))
 			return -EPROTOTYPE;
 
@@ -873,7 +871,7 @@ int ib_resolve_eth_l2_attrs(struct ib_qp *qp,
 	union ib_gid  sgid;
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/infiniband/core/verbs.c +1 -1
 	if ((*qp_attr_mask & IB_QP_AV)  &&
-	    (rdma_port_get_link_layer(qp->device, qp_attr->ah_attr.port_num) == IB_LINK_LAYER_ETHERNET)) {
+	    (rdma_tech_iboe(qp->device, qp_attr->ah_attr.port_num))) {
 		ret = ib_query_gid(qp->device, qp_attr->ah_attr.port_num,
 				   qp_attr->ah_attr.grh.sgid_index, &sgid);
 		if (ret)
Signature · 1 line
2.1.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

#28 lore raw

Re: [PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs

On 04/22/2015 06:28 PM, ira.weiny wrote:
[snip]

Quoted 11 lines
Quoted 4 lines

link_layer_show() was supposed to report the same info to user space as usual, so user tool don't have to change anything :-)

We need to expose the "cap_*" functionality to userspace which can then convert to this interface and stop relying on inferring support based on the link layer. But that is a separate issue from correctly reporting the link layer.

The link layer should be reported correctly from the drivers "get_link_layer" call.

I get your point :-) link_layer_show() and ib_uverbs_query_port() do only need the link layer type rather then a mgmt check, modification on these two will be dropped in next version.

Regards,
Michael Wang

Quoted 65 lines

Ira

Quoted 62 lines

Regards,
Michael Wang

Quoted 58 lines

Ira

Quoted 55 lines
drivers/infiniband/core/sysfs.c +1 -4
 		return sprintf(buf, "%s\n", "InfiniBand");
-	case IB_LINK_LAYER_ETHERNET:
+	else
 		return sprintf(buf, "%s\n", "Ethernet");
-	default:
-		return sprintf(buf, "%s\n", "Unknown");
-	}
 }
 
 static PORT_ATTR_RO(state);
drivers/infiniband/core/uverbs_cmd.c +4 -2
index a9f0489..5dc90aa 100644
@@ -515,8 +515,10 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
 	resp.active_width    = attr.active_width;
 	resp.active_speed    = attr.active_speed;
 	resp.phys_state      = attr.phys_state;
-	resp.link_layer      = rdma_port_get_link_layer(file->device->ib_dev,
-							cmd.port_num);
+	resp.link_layer      = rdma_tech_ib(file->device->ib_dev,
+							cmd.port_num) ?
+			       IB_LINK_LAYER_INFINIBAND :
+			       IB_LINK_LAYER_ETHERNET;
 
 	if (copy_to_user((void __user *) (unsigned long) cmd.response,
 			 &resp, sizeof resp))
drivers/infiniband/core/verbs.c +2 -4
index 626c9cf..7264860 100644
@@ -200,11 +200,9 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc,
 	u32 flow_class;
 	u16 gid_index;
 	int ret;
-	int is_eth = (rdma_port_get_link_layer(device, port_num) ==
-			IB_LINK_LAYER_ETHERNET);
 
 	memset(ah_attr, 0, sizeof *ah_attr);
-	if (is_eth) {
+	if (rdma_tech_iboe(device, port_num)) {
 		if (!(wc->wc_flags & IB_WC_GRH))
 			return -EPROTOTYPE;
 
@@ -873,7 +871,7 @@ int ib_resolve_eth_l2_attrs(struct ib_qp *qp,
 	union ib_gid  sgid;
 
 	if ((*qp_attr_mask & IB_QP_AV)  &&
-	    (rdma_port_get_link_layer(qp->device, qp_attr->ah_attr.port_num) == IB_LINK_LAYER_ETHERNET)) {
+	    (rdma_tech_iboe(qp->device, qp_attr->ah_attr.port_num))) {
 		ret = ib_query_gid(qp->device, qp_attr->ah_attr.port_num,
 				   qp_attr->ah_attr.grh.sgid_index, &sgid);
 		if (ret)
Signature · 1 line
2.1.0
#29 lore raw

PATCH v5 10/27 IB/Verbs: Reform cm related part in IB-core cma/ucm

In reply to Michael Wang

Use raw management helpers to reform cm related part in IB-core cma/ucm.

Few checks focus on the device cm type rather than the port capability, directly pass port 1 works currently, but can't support mixing cm type device in future.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c | 81 +++++++++++++------------------------------
 drivers/infiniband/core/ucm.c |  3 +-
 2 files changed, 26 insertions(+), 58 deletions(-)
drivers/infiniband/core/cma.c +25 -56
index d570030..815e41b 100644
@@ -735,8 +735,7 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 	int ret = 0;
 
 	id_priv = container_of(id, struct rdma_id_private, id);
-	switch (rdma_node_get_transport(id_priv->id.device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		if (!id_priv->cm_id.ib || (id_priv->id.qp_type == IB_QPT_UD))
 			ret = cma_ib_init_qp_attr(id_priv, qp_attr, qp_attr_mask);
 		else
@@ -745,19 +744,15 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 
 		if (qp_attr->qp_state == IB_QPS_RTR)
 			qp_attr->rq_psn = id_priv->seq_num;
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
 		if (!id_priv->cm_id.iw) {
 			qp_attr->qp_access_flags = 0;
 			*qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS;
 		} else
 			ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr,
 						 qp_attr_mask);
-		break;
-	default:
+	} else
 		ret = -ENOSYS;
-		break;
-	}
 
 	return ret;
 }
@@ -1037,17 +1032,12 @@ void rdma_destroy_id(struct rdma_cm_id *id)
 	mutex_unlock(&id_priv->handler_mutex);
 
 	if (id_priv->cma_dev) {
-		switch (rdma_node_get_transport(id_priv->id.device->node_type)) {
-		case RDMA_TRANSPORT_IB:
+		if (rdma_ib_or_iboe(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.ib)
 				ib_destroy_cm_id(id_priv->cm_id.ib);
-			break;
-		case RDMA_TRANSPORT_IWARP:
+		} else if (rdma_tech_iwarp(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.iw)
 				iw_destroy_cm_id(id_priv->cm_id.iw);
-			break;
-		default:
-			break;
 		}
 		cma_leave_mc_groups(id_priv);
 		cma_release_dev(id_priv);
@@ -1626,7 +1616,7 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv,
 	int ret;
 
 	if (cma_family(id_priv) == AF_IB &&
-	    rdma_node_get_transport(cma_dev->device->node_type) != RDMA_TRANSPORT_IB)
+	    !rdma_ib_or_iboe(cma_dev->device, 1))
 		return;
 
 	id = rdma_create_id(cma_listen_handler, id_priv, id_priv->id.ps,
@@ -2028,7 +2018,7 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
 	mutex_lock(&lock);
 	list_for_each_entry(cur_dev, &dev_list, list) {
 		if (cma_family(id_priv) == AF_IB &&
-		    rdma_node_get_transport(cur_dev->device->node_type) != RDMA_TRANSPORT_IB)
+		    !rdma_ib_or_iboe(cur_dev->device, 1))
 			continue;
 
 		if (!cma_dev)
@@ -2060,7 +2050,7 @@ port_found:
 		goto out;
 
 	id_priv->id.route.addr.dev_addr.dev_type =
-		(rdma_port_get_link_layer(cma_dev->device, p) == IB_LINK_LAYER_INFINIBAND) ?
+		(rdma_tech_ib(cma_dev->device, p)) ?
 		ARPHRD_INFINIBAND : ARPHRD_ETHER;
 
 	rdma_addr_set_sgid(&id_priv->id.route.addr.dev_addr, &gid);
@@ -2537,18 +2527,15 @@ int rdma_listen(struct rdma_cm_id *id, int backlog)
 
 	id_priv->backlog = backlog;
 	if (id->device) {
-		switch (rdma_node_get_transport(id->device->node_type)) {
-		case RDMA_TRANSPORT_IB:
+		if (rdma_ib_or_iboe(id->device, 1)) {
 			ret = cma_ib_listen(id_priv);
 			if (ret)
 				goto err;
-			break;
-		case RDMA_TRANSPORT_IWARP:
+		} else if (rdma_tech_iwarp(id->device, 1)) {
 			ret = cma_iw_listen(id_priv, backlog);
 			if (ret)
 				goto err;
-			break;
-		default:
+		} else {
 			ret = -ENOSYS;
 			goto err;
 		}
@@ -2884,20 +2871,15 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		id_priv->srq = conn_param->srq;
 	}
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD)
 			ret = cma_resolve_ib_udp(id_priv, conn_param);
 		else
 			ret = cma_connect_ib(id_priv, conn_param);
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num))
 		ret = cma_connect_iw(id_priv, conn_param);
-		break;
-	default:
+	else
 		ret = -ENOSYS;
-		break;
-	}
 	if (ret)
 		goto err;
 
@@ -3000,8 +2982,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		id_priv->srq = conn_param->srq;
 	}
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD) {
 			if (conn_param)
 				ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS,
@@ -3017,14 +2998,10 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 			else
 				ret = cma_rep_recv(id_priv);
 		}
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num))
 		ret = cma_accept_iw(id_priv, conn_param);
-		break;
-	default:
+	else
 		ret = -ENOSYS;
-		break;
-	}
 
 	if (ret)
 		goto reject;
@@ -3068,8 +3045,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
 	if (!id_priv->cm_id.ib)
 		return -EINVAL;
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD)
 			ret = cma_send_sidr_rep(id_priv, IB_SIDR_REJECT, 0,
 						private_data, private_data_len);
@@ -3077,15 +3053,12 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
 			ret = ib_send_cm_rej(id_priv->cm_id.ib,
 					     IB_CM_REJ_CONSUMER_DEFINED, NULL,
 					     0, private_data, private_data_len);
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
 		ret = iw_cm_reject(id_priv->cm_id.iw,
 				   private_data, private_data_len);
-		break;
-	default:
+	} else
 		ret = -ENOSYS;
-		break;
-	}
+
 	return ret;
 }
 EXPORT_SYMBOL(rdma_reject);
@@ -3099,22 +3072,18 @@ int rdma_disconnect(struct rdma_cm_id *id)
 	if (!id_priv->cm_id.ib)
 		return -EINVAL;
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		ret = cma_modify_qp_err(id_priv);
 		if (ret)
 			goto out;
 		/* Initiate or respond to a disconnect. */
 		if (ib_send_cm_dreq(id_priv->cm_id.ib, NULL, 0))
 			ib_send_cm_drep(id_priv->cm_id.ib, NULL, 0);
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
 		ret = iw_cm_disconnect(id_priv->cm_id.iw, 0);
-		break;
-	default:
+	} else
 		ret = -EINVAL;
-		break;
-	}
+
 out:
 	return ret;
 }
drivers/infiniband/core/ucm.c +1 -2
index f2f6393..70e0ccb 100644
@@ -1253,8 +1253,7 @@ static void ib_ucm_add_one(struct ib_device *device)
 	dev_t base;
 	struct ib_ucm_device *ucm_dev;
 
-	if (!device->alloc_ucontext ||
-	    rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
+	if (!device->alloc_ucontext || !rdma_ib_or_iboe(device, 1))
 		return;
 
 	ucm_dev = kzalloc(sizeof *ucm_dev, GFP_KERNEL);
Signature · 5 lines
2.1.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
Reviewed-by on v5 10/27
#30 lore raw

Re: [PATCH v5 10/27] IB/Verbs: Reform cm related part in IB-core cma/ucm

Quoted 7 lines · Michael Wang

Use raw management helpers to reform cm related part in IB-core cma/ucm.

Few checks focus on the device cm type rather than the port capability, directly pass port 1 works currently, but can't support mixing cm type device in future.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 233 lines
---
 drivers/infiniband/core/cma.c | 81 +++++++++++++------------------------------
 drivers/infiniband/core/ucm.c |  3 +-
 2 files changed, 26 insertions(+), 58 deletions(-)
drivers/infiniband/core/cma.c +25 -56
index d570030..815e41b 100644
@@ -735,8 +735,7 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 	int ret = 0;
 
 	id_priv = container_of(id, struct rdma_id_private, id);
-	switch (rdma_node_get_transport(id_priv->id.device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		if (!id_priv->cm_id.ib || (id_priv->id.qp_type == IB_QPT_UD))
 			ret = cma_ib_init_qp_attr(id_priv, qp_attr, qp_attr_mask);
 		else
@@ -745,19 +744,15 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 
 		if (qp_attr->qp_state == IB_QPS_RTR)
 			qp_attr->rq_psn = id_priv->seq_num;
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
 		if (!id_priv->cm_id.iw) {
 			qp_attr->qp_access_flags = 0;
 			*qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS;
 		} else
 			ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr,
 						 qp_attr_mask);
-		break;
-	default:
+	} else
 		ret = -ENOSYS;
-		break;
-	}
 
 	return ret;
 }
@@ -1037,17 +1032,12 @@ void rdma_destroy_id(struct rdma_cm_id *id)
 	mutex_unlock(&id_priv->handler_mutex);
 
 	if (id_priv->cma_dev) {
-		switch (rdma_node_get_transport(id_priv->id.device->node_type)) {
-		case RDMA_TRANSPORT_IB:
+		if (rdma_ib_or_iboe(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.ib)
 				ib_destroy_cm_id(id_priv->cm_id.ib);
-			break;
-		case RDMA_TRANSPORT_IWARP:
+		} else if (rdma_tech_iwarp(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.iw)
 				iw_destroy_cm_id(id_priv->cm_id.iw);
-			break;
-		default:
-			break;
 		}
 		cma_leave_mc_groups(id_priv);
 		cma_release_dev(id_priv);
@@ -1626,7 +1616,7 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv,
 	int ret;
 
 	if (cma_family(id_priv) == AF_IB &&
-	    rdma_node_get_transport(cma_dev->device->node_type) != RDMA_TRANSPORT_IB)
+	    !rdma_ib_or_iboe(cma_dev->device, 1))
 		return;
 
 	id = rdma_create_id(cma_listen_handler, id_priv, id_priv->id.ps,
@@ -2028,7 +2018,7 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
 	mutex_lock(&lock);
 	list_for_each_entry(cur_dev, &dev_list, list) {
 		if (cma_family(id_priv) == AF_IB &&
-		    rdma_node_get_transport(cur_dev->device->node_type) != RDMA_TRANSPORT_IB)
+		    !rdma_ib_or_iboe(cur_dev->device, 1))
 			continue;
 
 		if (!cma_dev)
@@ -2060,7 +2050,7 @@ port_found:
 		goto out;
 
 	id_priv->id.route.addr.dev_addr.dev_type =
-		(rdma_port_get_link_layer(cma_dev->device, p) == IB_LINK_LAYER_INFINIBAND) ?
+		(rdma_tech_ib(cma_dev->device, p)) ?
 		ARPHRD_INFINIBAND : ARPHRD_ETHER;
 
 	rdma_addr_set_sgid(&id_priv->id.route.addr.dev_addr, &gid);
@@ -2537,18 +2527,15 @@ int rdma_listen(struct rdma_cm_id *id, int backlog)
 
 	id_priv->backlog = backlog;
 	if (id->device) {
-		switch (rdma_node_get_transport(id->device->node_type)) {
-		case RDMA_TRANSPORT_IB:
+		if (rdma_ib_or_iboe(id->device, 1)) {
 			ret = cma_ib_listen(id_priv);
 			if (ret)
 				goto err;
-			break;
-		case RDMA_TRANSPORT_IWARP:
+		} else if (rdma_tech_iwarp(id->device, 1)) {
 			ret = cma_iw_listen(id_priv, backlog);
 			if (ret)
 				goto err;
-			break;
-		default:
+		} else {
 			ret = -ENOSYS;
 			goto err;
 		}
@@ -2884,20 +2871,15 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		id_priv->srq = conn_param->srq;
 	}
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD)
 			ret = cma_resolve_ib_udp(id_priv, conn_param);
 		else
 			ret = cma_connect_ib(id_priv, conn_param);
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num))
 		ret = cma_connect_iw(id_priv, conn_param);
-		break;
-	default:
+	else
 		ret = -ENOSYS;
-		break;
-	}
 	if (ret)
 		goto err;
 
@@ -3000,8 +2982,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		id_priv->srq = conn_param->srq;
 	}
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD) {
 			if (conn_param)
 				ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS,
@@ -3017,14 +2998,10 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 			else
 				ret = cma_rep_recv(id_priv);
 		}
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num))
 		ret = cma_accept_iw(id_priv, conn_param);
-		break;
-	default:
+	else
 		ret = -ENOSYS;
-		break;
-	}
 
 	if (ret)
 		goto reject;
@@ -3068,8 +3045,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
 	if (!id_priv->cm_id.ib)
 		return -EINVAL;
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD)
 			ret = cma_send_sidr_rep(id_priv, IB_SIDR_REJECT, 0,
 						private_data, private_data_len);
@@ -3077,15 +3053,12 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
 			ret = ib_send_cm_rej(id_priv->cm_id.ib,
 					     IB_CM_REJ_CONSUMER_DEFINED, NULL,
 					     0, private_data, private_data_len);
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
 		ret = iw_cm_reject(id_priv->cm_id.iw,
 				   private_data, private_data_len);
-		break;
-	default:
+	} else
 		ret = -ENOSYS;
-		break;
-	}
+
 	return ret;
 }
 EXPORT_SYMBOL(rdma_reject);
@@ -3099,22 +3072,18 @@ int rdma_disconnect(struct rdma_cm_id *id)
 	if (!id_priv->cm_id.ib)
 		return -EINVAL;
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
+	if (rdma_ib_or_iboe(id->device, id->port_num)) {
 		ret = cma_modify_qp_err(id_priv);
 		if (ret)
 			goto out;
 		/* Initiate or respond to a disconnect. */
 		if (ib_send_cm_dreq(id_priv->cm_id.ib, NULL, 0))
 			ib_send_cm_drep(id_priv->cm_id.ib, NULL, 0);
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
 		ret = iw_cm_disconnect(id_priv->cm_id.iw, 0);
-		break;
-	default:
+	} else
 		ret = -EINVAL;
-		break;
-	}
+
 out:
 	return ret;
 }
drivers/infiniband/core/ucm.c +1 -2
index f2f6393..70e0ccb 100644
@@ -1253,8 +1253,7 @@ static void ib_ucm_add_one(struct ib_device *device)
 	dev_t base;
 	struct ib_ucm_device *ucm_dev;
 
-	if (!device->alloc_ucontext ||
-	    rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
+	if (!device->alloc_ucontext || !rdma_ib_or_iboe(device, 1))
 		return;
 
 	ucm_dev = kzalloc(sizeof *ucm_dev, GFP_KERNEL);
Signature · 1 line
2.1.0
#31 lore raw

PATCH v5 11/27 IB/Verbs: Reform route related part in IB-core cma

In reply to Michael Wang

Use raw management helpers to reform route related part in IB-core cma.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c  | 31 ++++++++-----------------------
 drivers/infiniband/core/ucma.c | 25 ++++++-------------------
 2 files changed, 14 insertions(+), 42 deletions(-)
drivers/infiniband/core/cma.c +8 -23
index 815e41b..fa69f34 100644
@@ -923,13 +923,9 @@ static inline int cma_user_data_offset(struct rdma_id_private *id_priv)
 
 static void cma_cancel_route(struct rdma_id_private *id_priv)
 {
-	switch (rdma_port_get_link_layer(id_priv->id.device, id_priv->id.port_num)) {
-	case IB_LINK_LAYER_INFINIBAND:
+	if (rdma_tech_ib(id_priv->id.device, id_priv->id.port_num)) {
 		if (id_priv->query)
 			ib_sa_cancel_query(id_priv->query_id, id_priv->query);
-		break;
-	default:
-		break;
 	}
 }
 
@@ -1957,26 +1953,15 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms)
 		return -EINVAL;
 
 	atomic_inc(&id_priv->refcount);
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
-		switch (rdma_port_get_link_layer(id->device, id->port_num)) {
-		case IB_LINK_LAYER_INFINIBAND:
-			ret = cma_resolve_ib_route(id_priv, timeout_ms);
-			break;
-		case IB_LINK_LAYER_ETHERNET:
-			ret = cma_resolve_iboe_route(id_priv);
-			break;
-		default:
-			ret = -ENOSYS;
-		}
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	if (rdma_tech_ib(id->device, id->port_num))
+		ret = cma_resolve_ib_route(id_priv, timeout_ms);
+	else if (rdma_tech_iboe(id->device, id->port_num))
+		ret = cma_resolve_iboe_route(id_priv);
+	else if (rdma_tech_iwarp(id->device, id->port_num))
 		ret = cma_resolve_iw_route(id_priv, timeout_ms);
-		break;
-	default:
+	else
 		ret = -ENOSYS;
-		break;
-	}
+
 	if (ret)
 		goto err;
 
drivers/infiniband/core/ucma.c +6 -19
index 45d67e9..7331c6c 100644
@@ -722,26 +722,13 @@ static ssize_t ucma_query_route(struct ucma_file *file,
 
 	resp.node_guid = (__force __u64) ctx->cm_id->device->node_guid;
 	resp.port_num = ctx->cm_id->port_num;
-	switch (rdma_node_get_transport(ctx->cm_id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
-		switch (rdma_port_get_link_layer(ctx->cm_id->device,
-			ctx->cm_id->port_num)) {
-		case IB_LINK_LAYER_INFINIBAND:
-			ucma_copy_ib_route(&resp, &ctx->cm_id->route);
-			break;
-		case IB_LINK_LAYER_ETHERNET:
-			ucma_copy_iboe_route(&resp, &ctx->cm_id->route);
-			break;
-		default:
-			break;
-		}
-		break;
-	case RDMA_TRANSPORT_IWARP:
+
+	if (rdma_tech_ib(ctx->cm_id->device, ctx->cm_id->port_num))
+		ucma_copy_ib_route(&resp, &ctx->cm_id->route);
+	else if (rdma_tech_iboe(ctx->cm_id->device, ctx->cm_id->port_num))
+		ucma_copy_iboe_route(&resp, &ctx->cm_id->route);
+	else if (rdma_tech_iwarp(ctx->cm_id->device, ctx->cm_id->port_num))
 		ucma_copy_iw_route(&resp, &ctx->cm_id->route);
-		break;
-	default:
-		break;
-	}
 
 out:
 	if (copy_to_user((void __user *)(unsigned long)cmd.response,
Signature · 5 lines
2.1.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
Reviewed-by on v5 11/27
#32 lore raw

Re: [PATCH v5 11/27] IB/Verbs: Reform route related part in IB-core cma

Quoted 11 lines · Michael Wang

Use raw management helpers to reform route related part in IB-core cma.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 97 lines
---
 drivers/infiniband/core/cma.c  | 31 ++++++++-----------------------
 drivers/infiniband/core/ucma.c | 25 ++++++-------------------
 2 files changed, 14 insertions(+), 42 deletions(-)
drivers/infiniband/core/cma.c +8 -23
index 815e41b..fa69f34 100644
@@ -923,13 +923,9 @@ static inline int cma_user_data_offset(struct rdma_id_private *id_priv)
 
 static void cma_cancel_route(struct rdma_id_private *id_priv)
 {
-	switch (rdma_port_get_link_layer(id_priv->id.device, id_priv->id.port_num)) {
-	case IB_LINK_LAYER_INFINIBAND:
+	if (rdma_tech_ib(id_priv->id.device, id_priv->id.port_num)) {
 		if (id_priv->query)
 			ib_sa_cancel_query(id_priv->query_id, id_priv->query);
-		break;
-	default:
-		break;
 	}
 }
 
@@ -1957,26 +1953,15 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms)
 		return -EINVAL;
 
 	atomic_inc(&id_priv->refcount);
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
-		switch (rdma_port_get_link_layer(id->device, id->port_num)) {
-		case IB_LINK_LAYER_INFINIBAND:
-			ret = cma_resolve_ib_route(id_priv, timeout_ms);
-			break;
-		case IB_LINK_LAYER_ETHERNET:
-			ret = cma_resolve_iboe_route(id_priv);
-			break;
-		default:
-			ret = -ENOSYS;
-		}
-		break;
-	case RDMA_TRANSPORT_IWARP:
+	if (rdma_tech_ib(id->device, id->port_num))
+		ret = cma_resolve_ib_route(id_priv, timeout_ms);
+	else if (rdma_tech_iboe(id->device, id->port_num))
+		ret = cma_resolve_iboe_route(id_priv);
+	else if (rdma_tech_iwarp(id->device, id->port_num))
 		ret = cma_resolve_iw_route(id_priv, timeout_ms);
-		break;
-	default:
+	else
 		ret = -ENOSYS;
-		break;
-	}
+
 	if (ret)
 		goto err;
 
drivers/infiniband/core/ucma.c +6 -19
index 45d67e9..7331c6c 100644
@@ -722,26 +722,13 @@ static ssize_t ucma_query_route(struct ucma_file *file,
 
 	resp.node_guid = (__force __u64) ctx->cm_id->device->node_guid;
 	resp.port_num = ctx->cm_id->port_num;
-	switch (rdma_node_get_transport(ctx->cm_id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
-		switch (rdma_port_get_link_layer(ctx->cm_id->device,
-			ctx->cm_id->port_num)) {
-		case IB_LINK_LAYER_INFINIBAND:
-			ucma_copy_ib_route(&resp, &ctx->cm_id->route);
-			break;
-		case IB_LINK_LAYER_ETHERNET:
-			ucma_copy_iboe_route(&resp, &ctx->cm_id->route);
-			break;
-		default:
-			break;
-		}
-		break;
-	case RDMA_TRANSPORT_IWARP:
+
+	if (rdma_tech_ib(ctx->cm_id->device, ctx->cm_id->port_num))
+		ucma_copy_ib_route(&resp, &ctx->cm_id->route);
+	else if (rdma_tech_iboe(ctx->cm_id->device, ctx->cm_id->port_num))
+		ucma_copy_iboe_route(&resp, &ctx->cm_id->route);
+	else if (rdma_tech_iwarp(ctx->cm_id->device, ctx->cm_id->port_num))
 		ucma_copy_iw_route(&resp, &ctx->cm_id->route);
-		break;
-	default:
-		break;
-	}
 
 out:
 	if (copy_to_user((void __user *)(unsigned long)cmd.response,
Signature · 1 line
2.1.0
#33 lore raw

PATCH v5 12/27 IB/Verbs: Reform mcast related part in IB-core cma

In reply to Michael Wang

Use raw management helpers to reform mcast related part in IB-core cma.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c | 56 ++++++++++++++-----------------------------
 1 file changed, 18 insertions(+), 38 deletions(-)
drivers/infiniband/core/cma.c +18 -38
index fa69f34..a89c246 100644
@@ -997,17 +997,12 @@ static void cma_leave_mc_groups(struct rdma_id_private *id_priv)
 		mc = container_of(id_priv->mc_list.next,
 				  struct cma_multicast, list);
 		list_del(&mc->list);
-		switch (rdma_port_get_link_layer(id_priv->cma_dev->device, id_priv->id.port_num)) {
-		case IB_LINK_LAYER_INFINIBAND:
+		if (rdma_tech_ib(id_priv->cma_dev->device,
+				      id_priv->id.port_num)) {
 			ib_sa_free_multicast(mc->multicast.ib);
 			kfree(mc);
-			break;
-		case IB_LINK_LAYER_ETHERNET:
+		} else
 			kref_put(&mc->mcref, release_mc);
-			break;
-		default:
-			break;
-		}
 	}
 }
 
@@ -3314,24 +3309,13 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
 	list_add(&mc->list, &id_priv->mc_list);
 	spin_unlock(&id_priv->lock);
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
-		switch (rdma_port_get_link_layer(id->device, id->port_num)) {
-		case IB_LINK_LAYER_INFINIBAND:
-			ret = cma_join_ib_multicast(id_priv, mc);
-			break;
-		case IB_LINK_LAYER_ETHERNET:
-			kref_init(&mc->mcref);
-			ret = cma_iboe_join_multicast(id_priv, mc);
-			break;
-		default:
-			ret = -EINVAL;
-		}
-		break;
-	default:
+	if (rdma_tech_iboe(id->device, id->port_num)) {
+		kref_init(&mc->mcref);
+		ret = cma_iboe_join_multicast(id_priv, mc);
+	} else if (rdma_tech_ib(id->device, id->port_num))
+		ret = cma_join_ib_multicast(id_priv, mc);
+	else
 		ret = -ENOSYS;
-		break;
-	}
 
 	if (ret) {
 		spin_lock_irq(&id_priv->lock);
@@ -3359,19 +3343,15 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
 				ib_detach_mcast(id->qp,
 						&mc->multicast.ib->rec.mgid,
 						be16_to_cpu(mc->multicast.ib->rec.mlid));
-			if (rdma_node_get_transport(id_priv->cma_dev->device->node_type) == RDMA_TRANSPORT_IB) {
-				switch (rdma_port_get_link_layer(id->device, id->port_num)) {
-				case IB_LINK_LAYER_INFINIBAND:
-					ib_sa_free_multicast(mc->multicast.ib);
-					kfree(mc);
-					break;
-				case IB_LINK_LAYER_ETHERNET:
-					kref_put(&mc->mcref, release_mc);
-					break;
-				default:
-					break;
-				}
-			}
+
+			BUG_ON(id_priv->cma_dev->device != id->device);
+
+			if (rdma_tech_ib(id->device, id->port_num)) {
+				ib_sa_free_multicast(mc->multicast.ib);
+				kfree(mc);
+			} else if (rdma_tech_iboe(id->device, id->port_num))
+				kref_put(&mc->mcref, release_mc);
+
 			return;
 		}
 	}
Signature · 1 line
2.1.0
Reviewed-by on v5 12/27
#34 lore raw

Re: [PATCH v5 12/27] IB/Verbs: Reform mcast related part in IB-core cma

Quoted 11 lines · Michael Wang

Use raw management helpers to reform mcast related part in IB-core cma.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 91 lines
---
 drivers/infiniband/core/cma.c | 56 ++++++++++++++-----------------------------
 1 file changed, 18 insertions(+), 38 deletions(-)
drivers/infiniband/core/cma.c +18 -38
index fa69f34..a89c246 100644
@@ -997,17 +997,12 @@ static void cma_leave_mc_groups(struct rdma_id_private *id_priv)
 		mc = container_of(id_priv->mc_list.next,
 				  struct cma_multicast, list);
 		list_del(&mc->list);
-		switch (rdma_port_get_link_layer(id_priv->cma_dev->device, id_priv->id.port_num)) {
-		case IB_LINK_LAYER_INFINIBAND:
+		if (rdma_tech_ib(id_priv->cma_dev->device,
+				      id_priv->id.port_num)) {
 			ib_sa_free_multicast(mc->multicast.ib);
 			kfree(mc);
-			break;
-		case IB_LINK_LAYER_ETHERNET:
+		} else
 			kref_put(&mc->mcref, release_mc);
-			break;
-		default:
-			break;
-		}
 	}
 }
 
@@ -3314,24 +3309,13 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
 	list_add(&mc->list, &id_priv->mc_list);
 	spin_unlock(&id_priv->lock);
 
-	switch (rdma_node_get_transport(id->device->node_type)) {
-	case RDMA_TRANSPORT_IB:
-		switch (rdma_port_get_link_layer(id->device, id->port_num)) {
-		case IB_LINK_LAYER_INFINIBAND:
-			ret = cma_join_ib_multicast(id_priv, mc);
-			break;
-		case IB_LINK_LAYER_ETHERNET:
-			kref_init(&mc->mcref);
-			ret = cma_iboe_join_multicast(id_priv, mc);
-			break;
-		default:
-			ret = -EINVAL;
-		}
-		break;
-	default:
+	if (rdma_tech_iboe(id->device, id->port_num)) {
+		kref_init(&mc->mcref);
+		ret = cma_iboe_join_multicast(id_priv, mc);
+	} else if (rdma_tech_ib(id->device, id->port_num))
+		ret = cma_join_ib_multicast(id_priv, mc);
+	else
 		ret = -ENOSYS;
-		break;
-	}
 
 	if (ret) {
 		spin_lock_irq(&id_priv->lock);
@@ -3359,19 +3343,15 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
 				ib_detach_mcast(id->qp,
 						&mc->multicast.ib->rec.mgid,
 						be16_to_cpu(mc->multicast.ib->rec.mlid));
-			if (rdma_node_get_transport(id_priv->cma_dev->device->node_type) == RDMA_TRANSPORT_IB) {
-				switch (rdma_port_get_link_layer(id->device, id->port_num)) {
-				case IB_LINK_LAYER_INFINIBAND:
-					ib_sa_free_multicast(mc->multicast.ib);
-					kfree(mc);
-					break;
-				case IB_LINK_LAYER_ETHERNET:
-					kref_put(&mc->mcref, release_mc);
-					break;
-				default:
-					break;
-				}
-			}
+
+			BUG_ON(id_priv->cma_dev->device != id->device);
+
+			if (rdma_tech_ib(id->device, id->port_num)) {
+				ib_sa_free_multicast(mc->multicast.ib);
+				kfree(mc);
+			} else if (rdma_tech_iboe(id->device, id->port_num))
+				kref_put(&mc->mcref, release_mc);
+
 			return;
 		}
 	}
Signature · 1 line
2.1.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

#35 lore raw

PATCH v5 13/27 IB/Verbs: Reserve legacy transport type in 'dev_addr'

In reply to Michael Wang

Reserve the legacy transport type for the 'transport' member of 'struct rdma_dev_addr' until we make sure this is no longer needed.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
drivers/infiniband/core/cma.c +23 -2
index ebac646..6195bf6 100644
@@ -244,14 +244,35 @@ static inline void cma_set_ip_ver(struct cma_hdr *hdr, u8 ip_ver)
 	hdr->ip_version = (ip_ver << 4) | (hdr->ip_version & 0xF);
 }
 
+static inline void cma_set_legacy_transport(struct rdma_cm_id *id)
+{
+	switch (id->device->node_type) {
+	case RDMA_NODE_IB_CA:
+	case RDMA_NODE_IB_SWITCH:
+	case RDMA_NODE_IB_ROUTER:
+		id->route.addr.dev_addr.transport = RDMA_TRANSPORT_IB;
+		break;
+	case RDMA_NODE_RNIC:
+		id->route.addr.dev_addr.transport = RDMA_TRANSPORT_IWARP;
+		break;
+	case RDMA_NODE_USNIC:
+		id->route.addr.dev_addr.transport = RDMA_TRANSPORT_USNIC;
+		break;
+	case RDMA_NODE_USNIC_UDP:
+		id->route.addr.dev_addr.transport = RDMA_TRANSPORT_USNIC_UDP;
+		break;
+	default:
+		BUG();
+	}
+}
+
 static void cma_attach_to_dev(struct rdma_id_private *id_priv,
 			      struct cma_device *cma_dev)
 {
 	atomic_inc(&cma_dev->refcount);
 	id_priv->cma_dev = cma_dev;
 	id_priv->id.device = cma_dev->device;
-	id_priv->id.route.addr.dev_addr.transport =
-		rdma_node_get_transport(cma_dev->device->node_type);
+	cma_set_legacy_transport(&id_priv->id);
 	list_add_tail(&id_priv->list, &cma_dev->id_list);
 }
 
Signature · 5 lines
2.1.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
#36 lore raw

RE: [PATCH v5 13/27] IB/Verbs: Reserve legacy transport type in 'dev_addr'

PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBsaW51eC1yZG1hLW93bmVyQHZn ZXIua2VybmVsLm9yZyBbbWFpbHRvOmxpbnV4LXJkbWEtDQo+IG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3RvX2RldihzdHJ1Y3QgcmRt YV9pZF9wcml2YXRlICppZF9wcml2LA0KPiAgCQkJICAgICAgc3RydWN0IGNtYV9kZXZpY2UgKmNt YV9kZXYpDQo+ICB7DQo+ICAJYXRvbWljX2luYygmY21hX2Rldi0+cmVmY291bnQpOw0KPiAgCWlk X3ByaXYtPmNtYV9kZXYgPSBjbWFfZGV2Ow0KPiAgCWlkX3ByaXYtPmlkLmRldmljZSA9IGNtYV9k ZXYtPmRldmljZTsNCj4gLQlpZF9wcml2LT5pZC5yb3V0ZS5hZGRyLmRldl9hZGRyLnRyYW5zcG9y dCA9DQo+IC0JCXJkbWFfbm9kZV9nZXRfdHJhbnNwb3J0KGNtYV9kZXYtPmRldmljZS0+bm9kZV90 eXBlKTsNCj4gKwljbWFfc2V0X2xlZ2FjeV90cmFuc3BvcnQoJmlkX3ByaXYtPmlkKTsNCj4gIAls aXN0X2FkZF90YWlsKCZpZF9wcml2LT5saXN0LCAmY21hX2Rldi0+aWRfbGlzdCk7ICB9DQo+IA0K PiAtLQ0KPiAyLjEuMA0KPiAtLQ0KPiBUbyB1bnN1YnNjcmliZSBmcm9tIHRoaXMgbGlzdDogc2Vu ZCB0aGUgbGluZSAidW5zdWJzY3JpYmUgbGludXgtcmRtYSIgaW4gdGhlIGJvZHkNCj4gb2YgYSBt ZXNzYWdlIHRvIG1ham9yZG9tb0B2Z2VyLmtlcm5lbC5vcmcgTW9yZSBtYWpvcmRvbW8gaW5mbyBh dA0KPiBodHRwOi8vdmdlci5rZXJuZWwub3JnL21ham9yZG9tby1pbmZvLmh0bWwNCg== --
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

#37 lore raw

Re: [PATCH v5 13/27] IB/Verbs: Reserve legacy transport type in 'dev_addr'

On 04/21/2015 07:58 AM, Devesh Sharma wrote:
[snip]

Quoted 9 lines
Quoted 9 lines
drivers/infiniband/core/cma.c +0 -0
index ebac646..6195bf6 100644
@@ -244,14 +244,35 @@ static inline void cma_set_ip_ver(struct cma_hdr
 *hdr, u8 ip_ver)
 	hdr->ip_version = (ip_ver << 4) | (hdr->ip_version & 0xF);  }
 
Quoted 9 lines

drivers/infiniband/core/cma.c static inline void cma_set_ip_ver(struct cma_hdr *hdr, u8 ip_ver) · line 253

Quoted 6 lines
drivers/infiniband/core/cma.c +6 -0
+static inline void cma_set_legacy_transport(struct rdma_cm_id *id) {
+	switch (id->device->node_type) {
+	case RDMA_NODE_IB_CA:
+	case RDMA_NODE_IB_SWITCH:
+	case RDMA_NODE_IB_ROUTER:
+		id->route.addr.dev_addr.transport = RDMA_TRANSPORT_IB;

What about IBOE transport, am I missing something here? As of today ocrdma exports node_type as RDMA_NODE_IB_CA, here transport will be set to RDMA_TRANSPORT_IB, Should it be RDMA_TRANPORT_IBOE?

This part is actually just the old method we used to get transport type, I'm not sure about the usage of this 'transport' so reserve the old way for it :-P

Actually I can't locate the place using this stuff in core layer, thus I guess it may be used by user layer or the protocol, as long as these layer using the old logical, we better don't touch anything ;-)

Regards,
Michael Wang

Quoted 30 lines
Quoted 30 lines
drivers/infiniband/core/cma.c +16 -2
+		break;
+	case RDMA_NODE_RNIC:
+		id->route.addr.dev_addr.transport =
 RDMA_TRANSPORT_IWARP;
+		break;
+	case RDMA_NODE_USNIC:
+		id->route.addr.dev_addr.transport =
 RDMA_TRANSPORT_USNIC;
+		break;
+	case RDMA_NODE_USNIC_UDP:
+		id->route.addr.dev_addr.transport =
 RDMA_TRANSPORT_USNIC_UDP;
+		break;
+	default:
+		BUG();
+	}
+}
+
 static void cma_attach_to_dev(struct rdma_id_private *id_priv,
 			      struct cma_device *cma_dev)
 {
 	atomic_inc(&cma_dev->refcount);
 	id_priv->cma_dev = cma_dev;
 	id_priv->id.device = cma_dev->device;
-	id_priv->id.route.addr.dev_addr.transport =
-		rdma_node_get_transport(cma_dev->device->node_type);
+	cma_set_legacy_transport(&id_priv->id);
 	list_add_tail(&id_priv->list, &cma_dev->id_list);  }
Quoted 6 lines
Quoted 6 lines

--
2.1.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

Reviewed-by on v5 13/27
#38 lore raw

Re: [PATCH v5 13/27] IB/Verbs: Reserve legacy transport type in 'dev_addr'

In reply to Michael Wang
Quoted 5 lines · Michael Wang

Reserve the legacy transport type for the 'transport' member of 'struct rdma_dev_addr' until we make sure this is no longer needed.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 48 lines
---
 drivers/infiniband/core/cma.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
drivers/infiniband/core/cma.c +23 -2
index ebac646..6195bf6 100644
@@ -244,14 +244,35 @@ static inline void cma_set_ip_ver(struct cma_hdr *hdr, u8 ip_ver)
 	hdr->ip_version = (ip_ver << 4) | (hdr->ip_version & 0xF);
 }
 
+static inline void cma_set_legacy_transport(struct rdma_cm_id *id)
+{
+	switch (id->device->node_type) {
+	case RDMA_NODE_IB_CA:
+	case RDMA_NODE_IB_SWITCH:
+	case RDMA_NODE_IB_ROUTER:
+		id->route.addr.dev_addr.transport = RDMA_TRANSPORT_IB;
+		break;
+	case RDMA_NODE_RNIC:
+		id->route.addr.dev_addr.transport = RDMA_TRANSPORT_IWARP;
+		break;
+	case RDMA_NODE_USNIC:
+		id->route.addr.dev_addr.transport = RDMA_TRANSPORT_USNIC;
+		break;
+	case RDMA_NODE_USNIC_UDP:
+		id->route.addr.dev_addr.transport = RDMA_TRANSPORT_USNIC_UDP;
+		break;
+	default:
+		BUG();
+	}
+}
+
 static void cma_attach_to_dev(struct rdma_id_private *id_priv,
 			      struct cma_device *cma_dev)
 {
 	atomic_inc(&cma_dev->refcount);
 	id_priv->cma_dev = cma_dev;
 	id_priv->id.device = cma_dev->device;
-	id_priv->id.route.addr.dev_addr.transport =
-		rdma_node_get_transport(cma_dev->device->node_type);
+	cma_set_legacy_transport(&id_priv->id);
 	list_add_tail(&id_priv->list, &cma_dev->id_list);
 }
 
Signature · 1 line
2.1.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

#39 lore raw

PATCH v5 14/27 IB/Verbs: Reform cma_acquire_dev()

In reply to Michael Wang

Reform cma_acquire_dev() with management helpers, introduce cma_validate_port() to make the code more clean.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c | 68 +++++++++++++++++++++++++------------------
 1 file changed, 40 insertions(+), 28 deletions(-)
drivers/infiniband/core/cma.c +40 -28
index 6195bf6..44e7bb9 100644
@@ -370,18 +370,35 @@ static int cma_translate_addr(struct sockaddr *addr, struct rdma_dev_addr *dev_a
 	return ret;
 }
 
+static inline int cma_validate_port(struct ib_device *device, u8 port,
+				      union ib_gid *gid, int dev_type)
+{
+	u8 found_port;
+	int ret = -ENODEV;
+
+	if ((dev_type == ARPHRD_INFINIBAND) && !rdma_tech_ib(device, port))
+		return ret;
+
+	if ((dev_type != ARPHRD_INFINIBAND) && rdma_tech_ib(device, port))
+		return ret;
+
+	ret = ib_find_cached_gid(device, gid, &found_port, NULL);
+	if (port != found_port)
+		return -ENODEV;
+
+	return ret;
+}
+
 static int cma_acquire_dev(struct rdma_id_private *id_priv,
 			   struct rdma_id_private *listen_id_priv)
 {
 	struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
 	struct cma_device *cma_dev;
-	union ib_gid gid, iboe_gid;
+	union ib_gid gid, iboe_gid, *gidp;
 	int ret = -ENODEV;
-	u8 port, found_port;
-	enum rdma_link_layer dev_ll = dev_addr->dev_type == ARPHRD_INFINIBAND ?
-		IB_LINK_LAYER_INFINIBAND : IB_LINK_LAYER_ETHERNET;
+	u8 port;
 
-	if (dev_ll != IB_LINK_LAYER_INFINIBAND &&
+	if (dev_addr->dev_type != ARPHRD_INFINIBAND &&
 	    id_priv->id.ps == RDMA_PS_IPOIB)
 		return -EINVAL;
 
@@ -391,41 +408,36 @@ static int cma_acquire_dev(struct rdma_id_private *id_priv,
 
 	memcpy(&gid, dev_addr->src_dev_addr +
 	       rdma_addr_gid_offset(dev_addr), sizeof gid);
-	if (listen_id_priv &&
-	    rdma_port_get_link_layer(listen_id_priv->id.device,
-				     listen_id_priv->id.port_num) == dev_ll) {
+
+	if (listen_id_priv) {
 		cma_dev = listen_id_priv->cma_dev;
 		port = listen_id_priv->id.port_num;
-		if (rdma_node_get_transport(cma_dev->device->node_type) == RDMA_TRANSPORT_IB &&
-		    rdma_port_get_link_layer(cma_dev->device, port) == IB_LINK_LAYER_ETHERNET)
-			ret = ib_find_cached_gid(cma_dev->device, &iboe_gid,
-						 &found_port, NULL);
-		else
-			ret = ib_find_cached_gid(cma_dev->device, &gid,
-						 &found_port, NULL);
+		gidp = rdma_tech_iboe(cma_dev->device, port) ?
+		       &iboe_gid : &gid;
 
-		if (!ret && (port  == found_port)) {
-			id_priv->id.port_num = found_port;
+		ret = cma_validate_port(cma_dev->device, port, gidp,
+					dev_addr->dev_type);
+		if (!ret) {
+			id_priv->id.port_num = port;
 			goto out;
 		}
 	}
+
 	list_for_each_entry(cma_dev, &dev_list, list) {
 		for (port = 1; port <= cma_dev->device->phys_port_cnt; ++port) {
 			if (listen_id_priv &&
 			    listen_id_priv->cma_dev == cma_dev &&
 			    listen_id_priv->id.port_num == port)
 				continue;
-			if (rdma_port_get_link_layer(cma_dev->device, port) == dev_ll) {
-				if (rdma_node_get_transport(cma_dev->device->node_type) == RDMA_TRANSPORT_IB &&
-				    rdma_port_get_link_layer(cma_dev->device, port) == IB_LINK_LAYER_ETHERNET)
-					ret = ib_find_cached_gid(cma_dev->device, &iboe_gid, &found_port, NULL);
-				else
-					ret = ib_find_cached_gid(cma_dev->device, &gid, &found_port, NULL);
-
-				if (!ret && (port == found_port)) {
-					id_priv->id.port_num = found_port;
-					goto out;
-				}
+
+			gidp = rdma_tech_iboe(cma_dev->device, port) ?
+			       &iboe_gid : &gid;
+
+			ret = cma_validate_port(cma_dev->device, port, gidp,
+						dev_addr->dev_type);
+			if (!ret) {
+				id_priv->id.port_num = port;
+				goto out;
 			}
 		}
 	}
Signature · 1 line
2.1.0
#40 lore raw

RE: [PATCH v5 14/27] IB/Verbs: Reform cma_acquire_dev()

TG9va3MgZ29vZCwgSSB3b3VsZCBsaWtlIHRvIHRlc3Qgd2l0aCBvY3JkbWEgYmVmb3JlIGNvbmZp cm1pbmcuDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogbGludXgtcmRt YS1vd25lckB2Z2VyLmtlcm5lbC5vcmcgW21haWx0bzpsaW51eC1yZG1hLQ0KPiBvd25lckB2Z2Vy Lmtlcm5lbC5vcmddIE9uIEJlaGFsZiBPZiBNaWNoYWVsIFdhbmcNCj4gU2VudDogTW9uZGF5LCBB cHJpbCAyMCwgMjAxNSAyOjA4IFBNDQo+IFRvOiBSb2xhbmQgRHJlaWVyOyBTZWFuIEhlZnR5OyBs aW51eC1yZG1hQHZnZXIua2VybmVsLm9yZzsgbGludXgtDQo+IGtlcm5lbEB2Z2VyLmtlcm5lbC5v cmc7IGhhbEBkZXYubWVsbGFub3guY28uaWwNCj4gQ2M6IE1pY2hhZWwgV2FuZzsgVG9tIFR1Y2tl cjsgU3RldmUgV2lzZTsg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GluZSAidW5zdWJzY3JpYmUgbGludXgtcmRt YSIgaW4gdGhlIGJvZHkNCj4gb2YgYSBtZXNzYWdlIHRvIG1ham9yZG9tb0B2Z2VyLmtlcm5lbC5v cmcgTW9yZSBtYWpvcmRvbW8gaW5mbyBhdA0KPiBodHRwOi8vdmdlci5rZXJuZWwub3JnL21ham9y ZG9tby1pbmZvLmh0bWwNCg==
--
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

#41 lore raw

Re: [PATCH v5 14/27] IB/Verbs: Reform cma_acquire_dev()

Quoted 1 line · Devesh Sharma

Looks good, I would like to test with ocrdma before confirming.

That's great :-) Any testing would be really helpful, please let us know if there is some thing broken.

Regards,
Michael Wang

Quoted 150 lines
Quoted 150 lines

-----Original Message-----
From: [email protected] [mailto:linux-rdma- [email protected]] On Behalf Of Michael Wang
Sent: Monday, April 20, 2015 2:08 PM
To: Roland Dreier; Sean Hefty; [email protected]; linux- [email protected]; [email protected]
Cc: Michael Wang; Tom Tucker; Steve Wise; Hoang-Nam Nguyen; Christoph Raisch; Mike Marciniszyn; Eli Cohen; Faisal Latif; Jack Morgenstein; Or Gerlitz; Haggai Eran; Ira Weiny; Tom Talpey; Jason Gunthorpe; Doug Ledford
Subject: [PATCH v5 14/27] IB/Verbs: Reform cma_acquire_dev()

Reform cma_acquire_dev() with management helpers, introduce cma_validate_port() to make the code more clean.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c | 68 +++++++++++++++++++++++++----------------
--
 1 file changed, 40 insertions(+), 28 deletions(-)
drivers/infiniband/core/cma.c +0 -0
index 6195bf6..44e7bb9 100644
@@ -370,18 +370,35 @@ static int cma_translate_addr(struct sockaddr *addr,

struct rdma_dev_addr *dev_a

drivers/infiniband/core/cma.c +6 -0
 	return ret;
 }
 
+static inline int cma_validate_port(struct ib_device *device, u8 port,
+				      union ib_gid *gid, int dev_type) {
+	u8 found_port;
+	int ret = -ENODEV;
+
+	if ((dev_type == ARPHRD_INFINIBAND) && !rdma_tech_ib(device,

port))

drivers/infiniband/core/cma.c +13 -3
+		return ret;
+
+	if ((dev_type != ARPHRD_INFINIBAND) && rdma_tech_ib(device, port))
+		return ret;
+
+	ret = ib_find_cached_gid(device, gid, &found_port, NULL);
+	if (port != found_port)
+		return -ENODEV;
+
+	return ret;
+}
+
 static int cma_acquire_dev(struct rdma_id_private *id_priv,
 			   struct rdma_id_private *listen_id_priv)  {
 	struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
 	struct cma_device *cma_dev;
-	union ib_gid gid, iboe_gid;
+	union ib_gid gid, iboe_gid, *gidp;
 	int ret = -ENODEV;
-	u8 port, found_port;
-	enum rdma_link_layer dev_ll = dev_addr->dev_type ==

ARPHRD_INFINIBAND ?

drivers/infiniband/core/cma.c +4 -6
-		IB_LINK_LAYER_INFINIBAND : IB_LINK_LAYER_ETHERNET;
+	u8 port;
 
-	if (dev_ll != IB_LINK_LAYER_INFINIBAND &&
+	if (dev_addr->dev_type != ARPHRD_INFINIBAND &&
 	    id_priv->id.ps == RDMA_PS_IPOIB)
 		return -EINVAL;
@@ -391,41 +408,36 @@ static int cma_acquire_dev(struct rdma_id_private
 *id_priv,
 
 	memcpy(&gid, dev_addr->src_dev_addr +
 	       rdma_addr_gid_offset(dev_addr), sizeof gid);
-	if (listen_id_priv &&
-	    rdma_port_get_link_layer(listen_id_priv->id.device,
-				     listen_id_priv->id.port_num) == dev_ll) {
+
+	if (listen_id_priv) {
 		cma_dev = listen_id_priv->cma_dev;
 		port = listen_id_priv->id.port_num;
-		if (rdma_node_get_transport(cma_dev->device->node_type)

== RDMA_TRANSPORT_IB &&

drivers/infiniband/core/cma.c +0 -1
-		    rdma_port_get_link_layer(cma_dev->device, port) ==

IB_LINK_LAYER_ETHERNET)

drivers/infiniband/core/cma.c +7 -7
-			ret = ib_find_cached_gid(cma_dev->device, &iboe_gid,
-						 &found_port, NULL);
-		else
-			ret = ib_find_cached_gid(cma_dev->device, &gid,
-						 &found_port, NULL);
+		gidp = rdma_tech_iboe(cma_dev->device, port) ?
+		       &iboe_gid : &gid;
 
-		if (!ret && (port  == found_port)) {
-			id_priv->id.port_num = found_port;
+		ret = cma_validate_port(cma_dev->device, port, gidp,
+					dev_addr->dev_type);
+		if (!ret) {
+			id_priv->id.port_num = port;
 			goto out;
 		}
 	}
+
 	list_for_each_entry(cma_dev, &dev_list, list) {
 		for (port = 1; port <= cma_dev->device->phys_port_cnt; ++port)

{

drivers/infiniband/core/cma.c +0 -1
 			if (listen_id_priv &&
 			    listen_id_priv->cma_dev == cma_dev &&
 			    listen_id_priv->id.port_num == port)
 				continue;
-			if (rdma_port_get_link_layer(cma_dev->device, port)

== dev_ll) {

drivers/infiniband/core/cma.c +0 -1
-				if (rdma_node_get_transport(cma_dev-
Quoted 1 line

device->node_type) == RDMA_TRANSPORT_IB &&

drivers/infiniband/core/cma.c +0 -1
-				    rdma_port_get_link_layer(cma_dev-
Quoted 1 line

device, port) == IB_LINK_LAYER_ETHERNET)

drivers/infiniband/core/cma.c +0 -1
-					ret = ib_find_cached_gid(cma_dev-
Quoted 1 line

device, &iboe_gid, &found_port, NULL);

drivers/infiniband/core/cma.c +0 -2
-				else
-					ret = ib_find_cached_gid(cma_dev-
Quoted 1 line

device, &gid, &found_port, NULL);

drivers/infiniband/core/cma.c +9 -6
-
-				if (!ret && (port == found_port)) {
-					id_priv->id.port_num = found_port;
-					goto out;
-				}
+
+			gidp = rdma_tech_iboe(cma_dev->device, port) ?
+			       &iboe_gid : &gid;
+
+			ret = cma_validate_port(cma_dev->device, port, gidp,
+						dev_addr->dev_type);
+			if (!ret) {
+				id_priv->id.port_num = port;
+				goto out;
 			}
 		}
 	}
--

2.1.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

Reviewed-by on v5 14/27
#42 lore raw

Re: [PATCH v5 14/27] IB/Verbs: Reform cma_acquire_dev()

In reply to Michael Wang
Quoted 4 lines · Michael Wang

Reform cma_acquire_dev() with management helpers, introduce cma_validate_port() to make the code more clean.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 111 lines
---
 drivers/infiniband/core/cma.c | 68 +++++++++++++++++++++++++------------------
 1 file changed, 40 insertions(+), 28 deletions(-)
drivers/infiniband/core/cma.c +40 -28
index 6195bf6..44e7bb9 100644
@@ -370,18 +370,35 @@ static int cma_translate_addr(struct sockaddr *addr, struct rdma_dev_addr *dev_a
 	return ret;
 }
 
+static inline int cma_validate_port(struct ib_device *device, u8 port,
+				      union ib_gid *gid, int dev_type)
+{
+	u8 found_port;
+	int ret = -ENODEV;
+
+	if ((dev_type == ARPHRD_INFINIBAND) && !rdma_tech_ib(device, port))
+		return ret;
+
+	if ((dev_type != ARPHRD_INFINIBAND) && rdma_tech_ib(device, port))
+		return ret;
+
+	ret = ib_find_cached_gid(device, gid, &found_port, NULL);
+	if (port != found_port)
+		return -ENODEV;
+
+	return ret;
+}
+
 static int cma_acquire_dev(struct rdma_id_private *id_priv,
 			   struct rdma_id_private *listen_id_priv)
 {
 	struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
 	struct cma_device *cma_dev;
-	union ib_gid gid, iboe_gid;
+	union ib_gid gid, iboe_gid, *gidp;
 	int ret = -ENODEV;
-	u8 port, found_port;
-	enum rdma_link_layer dev_ll = dev_addr->dev_type == ARPHRD_INFINIBAND ?
-		IB_LINK_LAYER_INFINIBAND : IB_LINK_LAYER_ETHERNET;
+	u8 port;
 
-	if (dev_ll != IB_LINK_LAYER_INFINIBAND &&
+	if (dev_addr->dev_type != ARPHRD_INFINIBAND &&
 	    id_priv->id.ps == RDMA_PS_IPOIB)
 		return -EINVAL;
 
@@ -391,41 +408,36 @@ static int cma_acquire_dev(struct rdma_id_private *id_priv,
 
 	memcpy(&gid, dev_addr->src_dev_addr +
 	       rdma_addr_gid_offset(dev_addr), sizeof gid);
-	if (listen_id_priv &&
-	    rdma_port_get_link_layer(listen_id_priv->id.device,
-				     listen_id_priv->id.port_num) == dev_ll) {
+
+	if (listen_id_priv) {
 		cma_dev = listen_id_priv->cma_dev;
 		port = listen_id_priv->id.port_num;
-		if (rdma_node_get_transport(cma_dev->device->node_type) == RDMA_TRANSPORT_IB &&
-		    rdma_port_get_link_layer(cma_dev->device, port) == IB_LINK_LAYER_ETHERNET)
-			ret = ib_find_cached_gid(cma_dev->device, &iboe_gid,
-						 &found_port, NULL);
-		else
-			ret = ib_find_cached_gid(cma_dev->device, &gid,
-						 &found_port, NULL);
+		gidp = rdma_tech_iboe(cma_dev->device, port) ?
+		       &iboe_gid : &gid;
 
-		if (!ret && (port  == found_port)) {
-			id_priv->id.port_num = found_port;
+		ret = cma_validate_port(cma_dev->device, port, gidp,
+					dev_addr->dev_type);
+		if (!ret) {
+			id_priv->id.port_num = port;
 			goto out;
 		}
 	}
+
 	list_for_each_entry(cma_dev, &dev_list, list) {
 		for (port = 1; port <= cma_dev->device->phys_port_cnt; ++port) {
 			if (listen_id_priv &&
 			    listen_id_priv->cma_dev == cma_dev &&
 			    listen_id_priv->id.port_num == port)
 				continue;
-			if (rdma_port_get_link_layer(cma_dev->device, port) == dev_ll) {
-				if (rdma_node_get_transport(cma_dev->device->node_type) == RDMA_TRANSPORT_IB &&
-				    rdma_port_get_link_layer(cma_dev->device, port) == IB_LINK_LAYER_ETHERNET)
-					ret = ib_find_cached_gid(cma_dev->device, &iboe_gid, &found_port, NULL);
-				else
-					ret = ib_find_cached_gid(cma_dev->device, &gid, &found_port, NULL);
-
-				if (!ret && (port == found_port)) {
-					id_priv->id.port_num = found_port;
-					goto out;
-				}
+
+			gidp = rdma_tech_iboe(cma_dev->device, port) ?
+			       &iboe_gid : &gid;
+
+			ret = cma_validate_port(cma_dev->device, port, gidp,
+						dev_addr->dev_type);
+			if (!ret) {
+				id_priv->id.port_num = port;
+				goto out;
 			}
 		}
 	}
Signature · 1 line
2.1.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

#43 lore raw

PATCH v5 15/27 IB/Verbs: Reform rest part in IB-core cma

In reply to Michael Wang

Use raw management helpers to reform rest part in IB-core cma.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/infiniband/core/cma.c +9 -11
index 44e7bb9..ec64b97 100644
@@ -468,10 +468,10 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
 	pkey = ntohs(addr->sib_pkey);
 
 	list_for_each_entry(cur_dev, &dev_list, list) {
-		if (rdma_node_get_transport(cur_dev->device->node_type) != RDMA_TRANSPORT_IB)
-			continue;
-
 		for (p = 1; p <= cur_dev->device->phys_port_cnt; ++p) {
+			if (!rdma_ib_or_iboe(cur_dev->device, p))
+				continue;
+
 			if (ib_find_cached_pkey(cur_dev->device, p, pkey, &index))
 				continue;
 
@@ -666,10 +666,9 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv,
 	if (ret)
 		goto out;
 
-	if (rdma_node_get_transport(id_priv->cma_dev->device->node_type)
-	    == RDMA_TRANSPORT_IB &&
-	    rdma_port_get_link_layer(id_priv->id.device, id_priv->id.port_num)
-	    == IB_LINK_LAYER_ETHERNET) {
+	BUG_ON(id_priv->cma_dev->device != id_priv->id.device);
+
+	if (rdma_tech_iboe(id_priv->id.device, id_priv->id.port_num)) {
 		ret = rdma_addr_find_smac_by_sgid(&sgid, qp_attr.smac, NULL);
 
 		if (ret)
@@ -733,11 +732,10 @@ static int cma_ib_init_qp_attr(struct rdma_id_private *id_priv,
 	int ret;
 	u16 pkey;
 
-	if (rdma_port_get_link_layer(id_priv->id.device, id_priv->id.port_num) ==
-	    IB_LINK_LAYER_INFINIBAND)
-		pkey = ib_addr_get_pkey(dev_addr);
-	else
+	if (rdma_tech_iboe(id_priv->id.device, id_priv->id.port_num))
 		pkey = 0xffff;
+	else
+		pkey = ib_addr_get_pkey(dev_addr);
 
 	ret = ib_find_cached_pkey(id_priv->id.device, id_priv->id.port_num,
 				  pkey, &qp_attr->pkey_index);
Signature · 5 lines
2.1.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
Reviewed-by on v5 15/27
#44 lore raw

Re: [PATCH v5 15/27] IB/Verbs: Reform rest part in IB-core cma

Quoted 11 lines · Michael Wang

Use raw management helpers to reform rest part in IB-core cma.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 53 lines
---
 drivers/infiniband/core/cma.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/infiniband/core/cma.c +9 -11
index 44e7bb9..ec64b97 100644
@@ -468,10 +468,10 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
 	pkey = ntohs(addr->sib_pkey);
 
 	list_for_each_entry(cur_dev, &dev_list, list) {
-		if (rdma_node_get_transport(cur_dev->device->node_type) != RDMA_TRANSPORT_IB)
-			continue;
-
 		for (p = 1; p <= cur_dev->device->phys_port_cnt; ++p) {
+			if (!rdma_ib_or_iboe(cur_dev->device, p))
+				continue;
+
 			if (ib_find_cached_pkey(cur_dev->device, p, pkey, &index))
 				continue;
 
@@ -666,10 +666,9 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv,
 	if (ret)
 		goto out;
 
-	if (rdma_node_get_transport(id_priv->cma_dev->device->node_type)
-	    == RDMA_TRANSPORT_IB &&
-	    rdma_port_get_link_layer(id_priv->id.device, id_priv->id.port_num)
-	    == IB_LINK_LAYER_ETHERNET) {
+	BUG_ON(id_priv->cma_dev->device != id_priv->id.device);
+
+	if (rdma_tech_iboe(id_priv->id.device, id_priv->id.port_num)) {
 		ret = rdma_addr_find_smac_by_sgid(&sgid, qp_attr.smac, NULL);
 
 		if (ret)
@@ -733,11 +732,10 @@ static int cma_ib_init_qp_attr(struct rdma_id_private *id_priv,
 	int ret;
 	u16 pkey;
 
-	if (rdma_port_get_link_layer(id_priv->id.device, id_priv->id.port_num) ==
-	    IB_LINK_LAYER_INFINIBAND)
-		pkey = ib_addr_get_pkey(dev_addr);
-	else
+	if (rdma_tech_iboe(id_priv->id.device, id_priv->id.port_num))
 		pkey = 0xffff;
+	else
+		pkey = ib_addr_get_pkey(dev_addr);
 
 	ret = ib_find_cached_pkey(id_priv->id.device, id_priv->id.port_num,
 				  pkey, &qp_attr->pkey_index);
Signature · 1 line
2.1.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

#45 lore raw

PATCH v5 16/27 IB/Verbs: Use management helper cap_ib_mad()

In reply to Michael Wang

Introduce helper cap_ib_mad() to help us check if the port of an IB device support Infiniband Management Datagrams.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/mad.c      |  6 +++---
 drivers/infiniband/core/user_mad.c |  6 +++---
 include/rdma/ib_verbs.h            | 15 +++++++++++++++
 3 files changed, 21 insertions(+), 6 deletions(-)
drivers/infiniband/core/mad.c +3 -3
index 1822932..4315aeb 100644
@@ -3066,7 +3066,7 @@ static void ib_mad_init_device(struct ib_device *device)
 	}
 
 	for (i = start; i <= end; i++) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		if (ib_mad_port_open(device, i)) {
@@ -3087,7 +3087,7 @@ error_agent:
 
 error:
 	while (--i >= start) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		if (ib_agent_port_close(device, i))
@@ -3111,7 +3111,7 @@ static void ib_mad_remove_device(struct ib_device *device)
 	}
 
 	for (i = start; i <= end; i++) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		if (ib_agent_port_close(device, i))
drivers/infiniband/core/user_mad.c +3 -3
index 71fc8ba..b52884b 100644
@@ -1294,7 +1294,7 @@ static void ib_umad_add_one(struct ib_device *device)
 	umad_dev->end_port   = e;
 
 	for (i = s; i <= e; ++i) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		umad_dev->port[i - s].umad_dev = umad_dev;
@@ -1317,7 +1317,7 @@ static void ib_umad_add_one(struct ib_device *device)
 
 err:
 	while (--i >= s) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		ib_umad_kill_port(&umad_dev->port[i - s]);
@@ -1335,7 +1335,7 @@ static void ib_umad_remove_one(struct ib_device *device)
 		return;
 
 	for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i) {
-		if (rdma_ib_or_iboe(device, i))
+		if (cap_ib_mad(device, i))
 			ib_umad_kill_port(&umad_dev->port[i]);
 	}
 
include/rdma/ib_verbs.h +15 -0
index a12e876..624e963 100644
@@ -1773,6 +1773,21 @@ static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num)
 	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
 }
 
+/**
+ * cap_ib_mad - Check if the port of device has the capability Infiniband
+ * Management Datagrams.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Management Datagrams.
+ */
+static inline int cap_ib_mad(struct ib_device *device, u8 port_num)
+{
+	return rdma_ib_or_iboe(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.0
Reviewed-by on v5 16/27
#46 lore raw

Re: [PATCH v5 16/27] IB/Verbs: Use management helper cap_ib_mad()

Quoted 4 lines · Michael Wang

Introduce helper cap_ib_mad() to help us check if the port of an IB device support Infiniband Management Datagrams.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 96 lines
---
 drivers/infiniband/core/mad.c      |  6 +++---
 drivers/infiniband/core/user_mad.c |  6 +++---
 include/rdma/ib_verbs.h            | 15 +++++++++++++++
 3 files changed, 21 insertions(+), 6 deletions(-)
drivers/infiniband/core/mad.c +3 -3
index 1822932..4315aeb 100644
@@ -3066,7 +3066,7 @@ static void ib_mad_init_device(struct ib_device *device)
 	}
 
 	for (i = start; i <= end; i++) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		if (ib_mad_port_open(device, i)) {
@@ -3087,7 +3087,7 @@ error_agent:
 
 error:
 	while (--i >= start) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		if (ib_agent_port_close(device, i))
@@ -3111,7 +3111,7 @@ static void ib_mad_remove_device(struct ib_device *device)
 	}
 
 	for (i = start; i <= end; i++) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		if (ib_agent_port_close(device, i))
drivers/infiniband/core/user_mad.c +3 -3
index 71fc8ba..b52884b 100644
@@ -1294,7 +1294,7 @@ static void ib_umad_add_one(struct ib_device *device)
 	umad_dev->end_port   = e;
 
 	for (i = s; i <= e; ++i) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		umad_dev->port[i - s].umad_dev = umad_dev;
@@ -1317,7 +1317,7 @@ static void ib_umad_add_one(struct ib_device *device)
 
 err:
 	while (--i >= s) {
-		if (!rdma_ib_or_iboe(device, i))
+		if (!cap_ib_mad(device, i))
 			continue;
 
 		ib_umad_kill_port(&umad_dev->port[i - s]);
@@ -1335,7 +1335,7 @@ static void ib_umad_remove_one(struct ib_device *device)
 		return;
 
 	for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i) {
-		if (rdma_ib_or_iboe(device, i))
+		if (cap_ib_mad(device, i))
 			ib_umad_kill_port(&umad_dev->port[i]);
 	}
 
include/rdma/ib_verbs.h +15 -0
index a12e876..624e963 100644
@@ -1773,6 +1773,21 @@ static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num)
 	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
 }
 
+/**
+ * cap_ib_mad - Check if the port of device has the capability Infiniband
+ * Management Datagrams.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Management Datagrams.
+ */
+static inline int cap_ib_mad(struct ib_device *device, u8 port_num)
+{
+	return rdma_ib_or_iboe(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.0
#47 lore raw

PATCH v5 17/27 IB/Verbs: Use management helper cap_ib_smi()

In reply to Michael Wang

Introduce helper cap_ib_smi() to help us check if the port of an IB device support Infiniband Subnet Management Interface.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/agent.c |  2 +-
 drivers/infiniband/core/mad.c   |  2 +-
 include/rdma/ib_verbs.h         | 15 +++++++++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)
drivers/infiniband/core/agent.c +1 -1
index ffdef4d..61471ee 100644
@@ -156,7 +156,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
 		goto error1;
 	}
 
-	if (rdma_tech_ib(device, port_num)) {
+	if (cap_ib_smi(device, port_num)) {
 		/* Obtain send only MAD agent for SMI QP */
 		port_priv->agent[0] = ib_register_mad_agent(device, port_num,
 							    IB_QPT_SMI, NULL, 0,
drivers/infiniband/core/mad.c +1 -1
index 4315aeb..ee3a05e 100644
@@ -2938,7 +2938,7 @@ static int ib_mad_port_open(struct ib_device *device,
 	init_mad_qp(port_priv, &port_priv->qp_info[1]);
 
 	cq_size = mad_sendq_size + mad_recvq_size;
-	has_smi = rdma_tech_ib(device, port_num);
+	has_smi = cap_ib_smi(device, port_num);
 	if (has_smi)
 		cq_size *= 2;
 
include/rdma/ib_verbs.h +15 -0
index 624e963..873b9a6 100644
@@ -1788,6 +1788,21 @@ static inline int cap_ib_mad(struct ib_device *device, u8 port_num)
 	return rdma_ib_or_iboe(device, port_num);
 }
 
+/**
+ * cap_ib_smi - Check if the port of device has the capability Infiniband
+ * Subnet Management Interface.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Subnet Management Interface.
+ */
+static inline int cap_ib_smi(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_ib(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 5 lines
2.1.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
Reviewed-by on v5 17/27
#48 lore raw

Re: [PATCH v5 17/27] IB/Verbs: Use management helper cap_ib_smi()

Quoted 4 lines · Michael Wang

Introduce helper cap_ib_smi() to help us check if the port of an IB device support Infiniband Subnet Management Interface.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 60 lines
---
 drivers/infiniband/core/agent.c |  2 +-
 drivers/infiniband/core/mad.c   |  2 +-
 include/rdma/ib_verbs.h         | 15 +++++++++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)
drivers/infiniband/core/agent.c +1 -1
index ffdef4d..61471ee 100644
@@ -156,7 +156,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
 		goto error1;
 	}
 
-	if (rdma_tech_ib(device, port_num)) {
+	if (cap_ib_smi(device, port_num)) {
 		/* Obtain send only MAD agent for SMI QP */
 		port_priv->agent[0] = ib_register_mad_agent(device, port_num,
 							    IB_QPT_SMI, NULL, 0,
drivers/infiniband/core/mad.c +1 -1
index 4315aeb..ee3a05e 100644
@@ -2938,7 +2938,7 @@ static int ib_mad_port_open(struct ib_device *device,
 	init_mad_qp(port_priv, &port_priv->qp_info[1]);
 
 	cq_size = mad_sendq_size + mad_recvq_size;
-	has_smi = rdma_tech_ib(device, port_num);
+	has_smi = cap_ib_smi(device, port_num);
 	if (has_smi)
 		cq_size *= 2;
 
include/rdma/ib_verbs.h +15 -0
index 624e963..873b9a6 100644
@@ -1788,6 +1788,21 @@ static inline int cap_ib_mad(struct ib_device *device, u8 port_num)
 	return rdma_ib_or_iboe(device, port_num);
 }
 
+/**
+ * cap_ib_smi - Check if the port of device has the capability Infiniband
+ * Subnet Management Interface.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Subnet Management Interface.
+ */
+static inline int cap_ib_smi(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_ib(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.0
#49 lore raw

PATCH v5 18/27 IB/Verbs: Use management helper cap_ib_cm()

In reply to Michael Wang

Introduce helper cap_ib_cm() to help us check if the port of an IB device support Infiniband Communication Manager.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cm.c  |  6 +++---
 drivers/infiniband/core/cma.c | 19 +++++++++----------
 drivers/infiniband/core/ucm.c |  2 +-
 include/rdma/ib_verbs.h       | 15 +++++++++++++++
 4 files changed, 28 insertions(+), 14 deletions(-)
drivers/infiniband/core/cm.c +3 -3
index 3c10b75..eae4c9f 100644
@@ -3781,7 +3781,7 @@ static void cm_add_one(struct ib_device *ib_device)
 
 	set_bit(IB_MGMT_METHOD_SEND, reg_req.method_mask);
 	for (i = 1; i <= ib_device->phys_port_cnt; i++) {
-		if (!rdma_ib_or_iboe(ib_device, i))
+		if (!cap_ib_cm(ib_device, i))
 			continue;
 
 		port = kzalloc(sizeof *port, GFP_KERNEL);
@@ -3832,7 +3832,7 @@ error1:
 	port_modify.set_port_cap_mask = 0;
 	port_modify.clr_port_cap_mask = IB_PORT_CM_SUP;
 	while (--i) {
-		if (!rdma_ib_or_iboe(ib_device, i))
+		if (!cap_ib_cm(ib_device, i))
 			continue;
 
 		port = cm_dev->port[i-1];
@@ -3864,7 +3864,7 @@ static void cm_remove_one(struct ib_device *ib_device)
 	write_unlock_irqrestore(&cm.device_lock, flags);
 
 	for (i = 1; i <= ib_device->phys_port_cnt; i++) {
-		if (!rdma_ib_or_iboe(ib_device, i))
+		if (!cap_ib_cm(ib_device, i))
 			continue;
 
 		port = cm_dev->port[i-1];
drivers/infiniband/core/cma.c +9 -10
index ec64b97..ff59dbc 100644
@@ -766,7 +766,7 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 	int ret = 0;
 
 	id_priv = container_of(id, struct rdma_id_private, id);
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		if (!id_priv->cm_id.ib || (id_priv->id.qp_type == IB_QPT_UD))
 			ret = cma_ib_init_qp_attr(id_priv, qp_attr, qp_attr_mask);
 		else
@@ -1054,7 +1054,7 @@ void rdma_destroy_id(struct rdma_cm_id *id)
 	mutex_unlock(&id_priv->handler_mutex);
 
 	if (id_priv->cma_dev) {
-		if (rdma_ib_or_iboe(id_priv->id.device, 1)) {
+		if (cap_ib_cm(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.ib)
 				ib_destroy_cm_id(id_priv->cm_id.ib);
 		} else if (rdma_tech_iwarp(id_priv->id.device, 1)) {
@@ -1637,8 +1637,7 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv,
 	struct rdma_cm_id *id;
 	int ret;
 
-	if (cma_family(id_priv) == AF_IB &&
-	    !rdma_ib_or_iboe(cma_dev->device, 1))
+	if (cma_family(id_priv) == AF_IB && !cap_ib_cm(cma_dev->device, 1))
 		return;
 
 	id = rdma_create_id(cma_listen_handler, id_priv, id_priv->id.ps,
@@ -2029,7 +2028,7 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
 	mutex_lock(&lock);
 	list_for_each_entry(cur_dev, &dev_list, list) {
 		if (cma_family(id_priv) == AF_IB &&
-		    !rdma_ib_or_iboe(cur_dev->device, 1))
+		    !cap_ib_cm(cur_dev->device, 1))
 			continue;
 
 		if (!cma_dev)
@@ -2538,7 +2537,7 @@ int rdma_listen(struct rdma_cm_id *id, int backlog)
 
 	id_priv->backlog = backlog;
 	if (id->device) {
-		if (rdma_ib_or_iboe(id->device, 1)) {
+		if (cap_ib_cm(id->device, 1)) {
 			ret = cma_ib_listen(id_priv);
 			if (ret)
 				goto err;
@@ -2882,7 +2881,7 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		id_priv->srq = conn_param->srq;
 	}
 
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD)
 			ret = cma_resolve_ib_udp(id_priv, conn_param);
 		else
@@ -2993,7 +2992,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		id_priv->srq = conn_param->srq;
 	}
 
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD) {
 			if (conn_param)
 				ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS,
@@ -3056,7 +3055,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
 	if (!id_priv->cm_id.ib)
 		return -EINVAL;
 
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD)
 			ret = cma_send_sidr_rep(id_priv, IB_SIDR_REJECT, 0,
 						private_data, private_data_len);
@@ -3083,7 +3082,7 @@ int rdma_disconnect(struct rdma_cm_id *id)
 	if (!id_priv->cm_id.ib)
 		return -EINVAL;
 
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		ret = cma_modify_qp_err(id_priv);
 		if (ret)
 			goto out;
drivers/infiniband/core/ucm.c +1 -1
index 70e0ccb..f7290c8 100644
@@ -1253,7 +1253,7 @@ static void ib_ucm_add_one(struct ib_device *device)
 	dev_t base;
 	struct ib_ucm_device *ucm_dev;
 
-	if (!device->alloc_ucontext || !rdma_ib_or_iboe(device, 1))
+	if (!device->alloc_ucontext || !cap_ib_cm(device, 1))
 		return;
 
 	ucm_dev = kzalloc(sizeof *ucm_dev, GFP_KERNEL);
include/rdma/ib_verbs.h +15 -0
index 873b9a6..6805e3e 100644
@@ -1803,6 +1803,21 @@ static inline int cap_ib_smi(struct ib_device *device, u8 port_num)
 	return rdma_tech_ib(device, port_num);
 }
 
+/**
+ * cap_ib_cm - Check if the port of device has the capability Infiniband
+ * Communication Manager.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Communication Manager.
+ */
+static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
+{
+	return rdma_ib_or_iboe(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.0
Reviewed-by on v5 18/27
#50 lore raw

Re: [PATCH v5 18/27] IB/Verbs: Use management helper cap_ib_cm()

Quoted 4 lines · Michael Wang

Introduce helper cap_ib_cm() to help us check if the port of an IB device support Infiniband Communication Manager.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 165 lines
---
 drivers/infiniband/core/cm.c  |  6 +++---
 drivers/infiniband/core/cma.c | 19 +++++++++----------
 drivers/infiniband/core/ucm.c |  2 +-
 include/rdma/ib_verbs.h       | 15 +++++++++++++++
 4 files changed, 28 insertions(+), 14 deletions(-)
drivers/infiniband/core/cm.c +3 -3
index 3c10b75..eae4c9f 100644
@@ -3781,7 +3781,7 @@ static void cm_add_one(struct ib_device *ib_device)
 
 	set_bit(IB_MGMT_METHOD_SEND, reg_req.method_mask);
 	for (i = 1; i <= ib_device->phys_port_cnt; i++) {
-		if (!rdma_ib_or_iboe(ib_device, i))
+		if (!cap_ib_cm(ib_device, i))
 			continue;
 
 		port = kzalloc(sizeof *port, GFP_KERNEL);
@@ -3832,7 +3832,7 @@ error1:
 	port_modify.set_port_cap_mask = 0;
 	port_modify.clr_port_cap_mask = IB_PORT_CM_SUP;
 	while (--i) {
-		if (!rdma_ib_or_iboe(ib_device, i))
+		if (!cap_ib_cm(ib_device, i))
 			continue;
 
 		port = cm_dev->port[i-1];
@@ -3864,7 +3864,7 @@ static void cm_remove_one(struct ib_device *ib_device)
 	write_unlock_irqrestore(&cm.device_lock, flags);
 
 	for (i = 1; i <= ib_device->phys_port_cnt; i++) {
-		if (!rdma_ib_or_iboe(ib_device, i))
+		if (!cap_ib_cm(ib_device, i))
 			continue;
 
 		port = cm_dev->port[i-1];
drivers/infiniband/core/cma.c +9 -10
index ec64b97..ff59dbc 100644
@@ -766,7 +766,7 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 	int ret = 0;
 
 	id_priv = container_of(id, struct rdma_id_private, id);
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		if (!id_priv->cm_id.ib || (id_priv->id.qp_type == IB_QPT_UD))
 			ret = cma_ib_init_qp_attr(id_priv, qp_attr, qp_attr_mask);
 		else
@@ -1054,7 +1054,7 @@ void rdma_destroy_id(struct rdma_cm_id *id)
 	mutex_unlock(&id_priv->handler_mutex);
 
 	if (id_priv->cma_dev) {
-		if (rdma_ib_or_iboe(id_priv->id.device, 1)) {
+		if (cap_ib_cm(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.ib)
 				ib_destroy_cm_id(id_priv->cm_id.ib);
 		} else if (rdma_tech_iwarp(id_priv->id.device, 1)) {
@@ -1637,8 +1637,7 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv,
 	struct rdma_cm_id *id;
 	int ret;
 
-	if (cma_family(id_priv) == AF_IB &&
-	    !rdma_ib_or_iboe(cma_dev->device, 1))
+	if (cma_family(id_priv) == AF_IB && !cap_ib_cm(cma_dev->device, 1))
 		return;
 
 	id = rdma_create_id(cma_listen_handler, id_priv, id_priv->id.ps,
@@ -2029,7 +2028,7 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
 	mutex_lock(&lock);
 	list_for_each_entry(cur_dev, &dev_list, list) {
 		if (cma_family(id_priv) == AF_IB &&
-		    !rdma_ib_or_iboe(cur_dev->device, 1))
+		    !cap_ib_cm(cur_dev->device, 1))
 			continue;
 
 		if (!cma_dev)
@@ -2538,7 +2537,7 @@ int rdma_listen(struct rdma_cm_id *id, int backlog)
 
 	id_priv->backlog = backlog;
 	if (id->device) {
-		if (rdma_ib_or_iboe(id->device, 1)) {
+		if (cap_ib_cm(id->device, 1)) {
 			ret = cma_ib_listen(id_priv);
 			if (ret)
 				goto err;
@@ -2882,7 +2881,7 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		id_priv->srq = conn_param->srq;
 	}
 
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD)
 			ret = cma_resolve_ib_udp(id_priv, conn_param);
 		else
@@ -2993,7 +2992,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		id_priv->srq = conn_param->srq;
 	}
 
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD) {
 			if (conn_param)
 				ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS,
@@ -3056,7 +3055,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
 	if (!id_priv->cm_id.ib)
 		return -EINVAL;
 
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		if (id->qp_type == IB_QPT_UD)
 			ret = cma_send_sidr_rep(id_priv, IB_SIDR_REJECT, 0,
 						private_data, private_data_len);
@@ -3083,7 +3082,7 @@ int rdma_disconnect(struct rdma_cm_id *id)
 	if (!id_priv->cm_id.ib)
 		return -EINVAL;
 
-	if (rdma_ib_or_iboe(id->device, id->port_num)) {
+	if (cap_ib_cm(id->device, id->port_num)) {
 		ret = cma_modify_qp_err(id_priv);
 		if (ret)
 			goto out;
drivers/infiniband/core/ucm.c +1 -1
index 70e0ccb..f7290c8 100644
@@ -1253,7 +1253,7 @@ static void ib_ucm_add_one(struct ib_device *device)
 	dev_t base;
 	struct ib_ucm_device *ucm_dev;
 
-	if (!device->alloc_ucontext || !rdma_ib_or_iboe(device, 1))
+	if (!device->alloc_ucontext || !cap_ib_cm(device, 1))
 		return;
 
 	ucm_dev = kzalloc(sizeof *ucm_dev, GFP_KERNEL);
include/rdma/ib_verbs.h +15 -0
index 873b9a6..6805e3e 100644
@@ -1803,6 +1803,21 @@ static inline int cap_ib_smi(struct ib_device *device, u8 port_num)
 	return rdma_tech_ib(device, port_num);
 }
 
+/**
+ * cap_ib_cm - Check if the port of device has the capability Infiniband
+ * Communication Manager.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Communication Manager.
+ */
+static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
+{
+	return rdma_ib_or_iboe(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.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

#51 lore raw

PATCH v5 19/27 IB/Verbs: Use management helper cap_iw_cm()

In reply to Michael Wang

Introduce helper cap_iw_cm() to help us check if the port of an IB device support IWARP Communication Manager.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c | 14 +++++++-------
 include/rdma/ib_verbs.h       | 15 +++++++++++++++
 2 files changed, 22 insertions(+), 7 deletions(-)
drivers/infiniband/core/cma.c +7 -7
index ff59dbc..dd37b4a 100644
@@ -775,7 +775,7 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 
 		if (qp_attr->qp_state == IB_QPS_RTR)
 			qp_attr->rq_psn = id_priv->seq_num;
-	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
+	} else if (cap_iw_cm(id->device, id->port_num)) {
 		if (!id_priv->cm_id.iw) {
 			qp_attr->qp_access_flags = 0;
 			*qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS;
@@ -1057,7 +1057,7 @@ void rdma_destroy_id(struct rdma_cm_id *id)
 		if (cap_ib_cm(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.ib)
 				ib_destroy_cm_id(id_priv->cm_id.ib);
-		} else if (rdma_tech_iwarp(id_priv->id.device, 1)) {
+		} else if (cap_iw_cm(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.iw)
 				iw_destroy_cm_id(id_priv->cm_id.iw);
 		}
@@ -2541,7 +2541,7 @@ int rdma_listen(struct rdma_cm_id *id, int backlog)
 			ret = cma_ib_listen(id_priv);
 			if (ret)
 				goto err;
-		} else if (rdma_tech_iwarp(id->device, 1)) {
+		} else if (cap_iw_cm(id->device, 1)) {
 			ret = cma_iw_listen(id_priv, backlog);
 			if (ret)
 				goto err;
@@ -2886,7 +2886,7 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 			ret = cma_resolve_ib_udp(id_priv, conn_param);
 		else
 			ret = cma_connect_ib(id_priv, conn_param);
-	} else if (rdma_tech_iwarp(id->device, id->port_num))
+	} else if (cap_iw_cm(id->device, id->port_num))
 		ret = cma_connect_iw(id_priv, conn_param);
 	else
 		ret = -ENOSYS;
@@ -3008,7 +3008,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 			else
 				ret = cma_rep_recv(id_priv);
 		}
-	} else if (rdma_tech_iwarp(id->device, id->port_num))
+	} else if (cap_iw_cm(id->device, id->port_num))
 		ret = cma_accept_iw(id_priv, conn_param);
 	else
 		ret = -ENOSYS;
@@ -3063,7 +3063,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
 			ret = ib_send_cm_rej(id_priv->cm_id.ib,
 					     IB_CM_REJ_CONSUMER_DEFINED, NULL,
 					     0, private_data, private_data_len);
-	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
+	} else if (cap_iw_cm(id->device, id->port_num)) {
 		ret = iw_cm_reject(id_priv->cm_id.iw,
 				   private_data, private_data_len);
 	} else
@@ -3089,7 +3089,7 @@ int rdma_disconnect(struct rdma_cm_id *id)
 		/* Initiate or respond to a disconnect. */
 		if (ib_send_cm_dreq(id_priv->cm_id.ib, NULL, 0))
 			ib_send_cm_drep(id_priv->cm_id.ib, NULL, 0);
-	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
+	} else if (cap_iw_cm(id->device, id->port_num)) {
 		ret = iw_cm_disconnect(id_priv->cm_id.iw, 0);
 	} else
 		ret = -EINVAL;
include/rdma/ib_verbs.h +15 -0
index 6805e3e..e4999f6 100644
@@ -1818,6 +1818,21 @@ static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
 	return rdma_ib_or_iboe(device, port_num);
 }
 
+/**
+ * cap_iw_cm - Check if the port of device has the capability IWARP
+ * Communication Manager.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support IWARP
+ * Communication Manager.
+ */
+static inline int cap_iw_cm(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_iwarp(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.0
#52 lore raw

Re: [PATCH v5 19/27] IB/Verbs: Use management helper cap_iw_cm()

Quoted 99 lines · Michael Wang

Introduce helper cap_iw_cm() to help us check if the port of an IB device support IWARP Communication Manager.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
  drivers/infiniband/core/cma.c | 14 +++++++-------
  include/rdma/ib_verbs.h       | 15 +++++++++++++++
  2 files changed, 22 insertions(+), 7 deletions(-)
drivers/infiniband/core/cma.c +7 -7
index ff59dbc..dd37b4a 100644
@@ -775,7 +775,7 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 
  		if (qp_attr->qp_state == IB_QPS_RTR)
  			qp_attr->rq_psn = id_priv->seq_num;
-	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
+	} else if (cap_iw_cm(id->device, id->port_num)) {
  		if (!id_priv->cm_id.iw) {
  			qp_attr->qp_access_flags = 0;
  			*qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS;
@@ -1057,7 +1057,7 @@ void rdma_destroy_id(struct rdma_cm_id *id)
  		if (cap_ib_cm(id_priv->id.device, 1)) {
  			if (id_priv->cm_id.ib)
  				ib_destroy_cm_id(id_priv->cm_id.ib);
-		} else if (rdma_tech_iwarp(id_priv->id.device, 1)) {
+		} else if (cap_iw_cm(id_priv->id.device, 1)) {
  			if (id_priv->cm_id.iw)
  				iw_destroy_cm_id(id_priv->cm_id.iw);
  		}
@@ -2541,7 +2541,7 @@ int rdma_listen(struct rdma_cm_id *id, int backlog)
  			ret = cma_ib_listen(id_priv);
  			if (ret)
  				goto err;
-		} else if (rdma_tech_iwarp(id->device, 1)) {
+		} else if (cap_iw_cm(id->device, 1)) {
  			ret = cma_iw_listen(id_priv, backlog);
  			if (ret)
  				goto err;
@@ -2886,7 +2886,7 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
  			ret = cma_resolve_ib_udp(id_priv, conn_param);
  		else
  			ret = cma_connect_ib(id_priv, conn_param);
-	} else if (rdma_tech_iwarp(id->device, id->port_num))
+	} else if (cap_iw_cm(id->device, id->port_num))
  		ret = cma_connect_iw(id_priv, conn_param);
  	else
  		ret = -ENOSYS;
@@ -3008,7 +3008,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
  			else
  				ret = cma_rep_recv(id_priv);
  		}
-	} else if (rdma_tech_iwarp(id->device, id->port_num))
+	} else if (cap_iw_cm(id->device, id->port_num))
  		ret = cma_accept_iw(id_priv, conn_param);
  	else
  		ret = -ENOSYS;
@@ -3063,7 +3063,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
  			ret = ib_send_cm_rej(id_priv->cm_id.ib,
  					     IB_CM_REJ_CONSUMER_DEFINED, NULL,
  					     0, private_data, private_data_len);
-	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
+	} else if (cap_iw_cm(id->device, id->port_num)) {
  		ret = iw_cm_reject(id_priv->cm_id.iw,
  				   private_data, private_data_len);
  	} else
@@ -3089,7 +3089,7 @@ int rdma_disconnect(struct rdma_cm_id *id)
  		/* Initiate or respond to a disconnect. */
  		if (ib_send_cm_dreq(id_priv->cm_id.ib, NULL, 0))
  			ib_send_cm_drep(id_priv->cm_id.ib, NULL, 0);
-	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
+	} else if (cap_iw_cm(id->device, id->port_num)) {
  		ret = iw_cm_disconnect(id_priv->cm_id.iw, 0);
  	} else
  		ret = -EINVAL;
include/rdma/ib_verbs.h +8 -0
index 6805e3e..e4999f6 100644
@@ -1818,6 +1818,21 @@ static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
  	return rdma_ib_or_iboe(device, port_num);
  }
 
+/**
+ * cap_iw_cm - Check if the port of device has the capability IWARP
+ * Communication Manager.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support IWARP

include/rdma/ib_verbs.h static inline int cap_ib_cm(struct ib_device *device, u8 port_num) · line 1838

Quoted 10 lines
include/rdma/ib_verbs.h +7 -0
+ * Communication Manager.
+ */
+static inline int cap_iw_cm(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_iwarp(device, port_num);
+}
+
  int ib_query_gid(struct ib_device *device,
  		 u8 port_num, int index, union ib_gid *gid);
 

iWARP devices _must_ support the IWCM so cap_iw_cm() is not really useful.

--
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

#53 lore raw

Re: [PATCH v5 19/27] IB/Verbs: Use management helper cap_iw_cm()

Quoted 1 line · Steve Wise

On 4/20/2015 3:40 AM, Michael Wang wrote:

[snip]

Quoted 19 lines
Quoted 19 lines
include/rdma/ib_verbs.h +11 -0
index 6805e3e..e4999f6 100644
@@ -1818,6 +1818,21 @@ static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
      return rdma_ib_or_iboe(device, port_num);
  }
  +/**
+ * cap_iw_cm - Check if the port of device has the capability IWARP
+ * Communication Manager.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support IWARP
+ * Communication Manager.
+ */
+static inline int cap_iw_cm(struct ib_device *device, u8 port_num)
+{
Quoted 8 lines

include/rdma/ib_verbs.h static inline int cap_ib_cm(struct ib_device *device, u8 port_num) · line 1838

Quoted 6 lines
include/rdma/ib_verbs.h +3 -0
+    return rdma_tech_iwarp(device, port_num);
+}
+
  int ib_query_gid(struct ib_device *device,
           u8 port_num, int index, union ib_gid *gid);
 

iWARP devices _must_ support the IWCM so cap_iw_cm() is not really useful.

Sean suggested to add this helper paired with cap_ib_cm(), may be there are some consideration on maintainability?

Me too also prefer this way to make the code more readable ;-)

Regards,
Michael Wang

Quoted 2 lines
#54 lore raw

Re: [PATCH v5 19/27] IB/Verbs: Use management helper cap_iw_cm()

Quoted 29 lines · Michael Wang
Quoted 1 line · Steve Wise

On 4/20/2015 3:40 AM, Michael Wang wrote:

[snip]

Quoted 18 lines
Quoted 18 lines
include/rdma/ib_verbs.h +10 -0
index 6805e3e..e4999f6 100644
@@ -1818,6 +1818,21 @@ static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
       return rdma_ib_or_iboe(device, port_num);
   }
   +/**
+ * cap_iw_cm - Check if the port of device has the capability IWARP
+ * Communication Manager.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support IWARP
+ * Communication Manager.
+ */
+static inline int cap_iw_cm(struct ib_device *device, u8 port_num)
Quoted 8 lines

include/rdma/ib_verbs.h static inline int cap_ib_cm(struct ib_device *device, u8 port_num) · line 1838

Quoted 7 lines
include/rdma/ib_verbs.h +4 -0
+{
+    return rdma_tech_iwarp(device, port_num);
+}
+
   int ib_query_gid(struct ib_device *device,
            u8 port_num, int index, union ib_gid *gid);
 

iWARP devices _must_ support the IWCM so cap_iw_cm() is not really useful.

Quoted 4 lines

Sean suggested to add this helper paired with cap_ib_cm(), may be there are some consideration on maintainability?

Me too also prefer this way to make the code more readable ;-)

It's more consistent, but not necessarily more readable -- if by readability we mean understanding.

If the reader knows how the transports work, then the reader would be confused by the addition of a check that is always true. For the reader that doesn't know, the addition of the check implies that the support is optional, which it is not.

Tom

Quoted 8 lines

Regards,
Michael Wang

Quoted 1 line

--
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

#55 lore raw

Re: [PATCH v5 19/27] IB/Verbs: Use management helper cap_iw_cm()

Quoted 33 lines · Tom Tucker
Quoted 27 lines · Michael Wang
Quoted 1 line · Steve Wise

On 4/20/2015 3:40 AM, Michael Wang wrote:

[snip]

Quoted 16 lines
Quoted 16 lines
include/rdma/ib_verbs.h +10 -0
index 6805e3e..e4999f6 100644
+++ b/include/rdma/ib_verbs.h
@@ -1818,6 +1818,21 @@ static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
      return rdma_ib_or_iboe(device, port_num);
  }
  +/**
+ * cap_iw_cm - Check if the port of device has the capability IWARP
+ * Communication Manager.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support IWARP
+ * Communication Manager.
+ */
Quoted 8 lines

include/rdma/ib_verbs.h static inline int cap_ib_cm(struct ib_device *device, u8 port_num) · line 1837

Quoted 7 lines
include/rdma/ib_verbs.h +5 -0
+static inline int cap_iw_cm(struct ib_device *device, u8 port_num)
+{
+    return rdma_tech_iwarp(device, port_num);
+}
+
  int ib_query_gid(struct ib_device *device,
           u8 port_num, int index, union ib_gid *gid);

iWARP devices _must_ support the IWCM so cap_iw_cm() is not really useful.

Quoted 4 lines

Sean suggested to add this helper paired with cap_ib_cm(), may be there are some consideration on maintainability?

Me too also prefer this way to make the code more readable ;-)

Quoted 7 lines

It's more consistent, but not necessarily more readable -- if by readability we mean understanding.

If the reader knows how the transports work, then the reader would be confused by the addition of a check that is always true. For the reader that doesn't know, the addition of the check implies that the support is optional, which it is not.

No, it says this code is concerned with the unique parts of iWarp related to CM, not the other unique parts of iWarp. The check isn't aways true, it is just always true on iWarp devices.

That became the problem with the old way of just saying 'is iWarp' (and others). There are too many differences, the why became lost in many places.

There are now too many standards, and several do not have public docs, to keep relying on a mess of 'is standard' tests.

Jason
--
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

#56 lore raw

Re: [PATCH v5 19/27] IB/Verbs: Use management helper cap_iw_cm()

Quoted 44 lines · Jason Gunthorpe
Quoted 31 lines · Tom Tucker
Quoted 30 lines · Michael Wang
Quoted 1 line · Steve Wise

On 4/20/2015 3:40 AM, Michael Wang wrote:

[snip]

Quoted 16 lines
Quoted 16 lines
include/rdma/ib_verbs.h +10 -0
index 6805e3e..e4999f6 100644
+++ b/include/rdma/ib_verbs.h
@@ -1818,6 +1818,21 @@ static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
       return rdma_ib_or_iboe(device, port_num);
   }
   +/**
+ * cap_iw_cm - Check if the port of device has the capability IWARP
+ * Communication Manager.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support IWARP
+ * Communication Manager.
+ */
Quoted 8 lines

include/rdma/ib_verbs.h static inline int cap_ib_cm(struct ib_device *device, u8 port_num) · line 1837

Quoted 7 lines
include/rdma/ib_verbs.h +5 -0
+static inline int cap_iw_cm(struct ib_device *device, u8 port_num)
+{
+    return rdma_tech_iwarp(device, port_num);
+}
+
   int ib_query_gid(struct ib_device *device,
            u8 port_num, int index, union ib_gid *gid);

iWARP devices _must_ support the IWCM so cap_iw_cm() is not really useful.

Sean suggested to add this helper paired with cap_ib_cm(), may be there are some consideration on maintainability?

Quoted 8 lines
Quoted 1 line

Me too also prefer this way to make the code more readable ;-)

It's more consistent, but not necessarily more readable -- if by readability we mean understanding.

If the reader knows how the transports work, then the reader would be confused by the addition of a check that is always true. For the reader that doesn't know, the addition of the check implies that the support is optional, which it is not.

No, it says this code is concerned with the unique parts of iWarp related to CM, not the other unique parts of iWarp. The check isn't aways true, it is just always true on iWarp devices.

Quoted 6 lines

That became the problem with the old way of just saying 'is iWarp' (and others). There are too many differences, the why became lost in many places.

There are now too many standards, and several do not have public docs, to keep relying on a mess of 'is standard' tests.

You're right Jason, this gets called with the device handle so it's only true for iwarp.

Quoted 5 lines

Jason
--
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

#57 lore raw

Re: [PATCH v5 19/27] IB/Verbs: Use management helper cap_iw_cm()

In reply to Tom Tucker

On 04/20/2015 05:51 PM, Tom Tucker wrote:
[snip]

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

int ib_query_gid(struct ib_device *device,

            u8 port_num, int index, union ib_gid *gid);

iWARP devices _must_ support the IWCM so cap_iw_cm() is not really useful.

Quoted 8 lines
Quoted 4 lines

Sean suggested to add this helper paired with cap_ib_cm(), may be there are some consideration on maintainability?

Me too also prefer this way to make the code more readable ;-)

It's more consistent, but not necessarily more readable -- if by readability we mean understanding.

If the reader knows how the transports work, then the reader would be confused by the addition of a check that is always true. For the reader that doesn't know, the addition of the check implies that the support is optional, which it is not.

The purpose is to make sure folks understand what we really want to check when they reviewing the code :-) and prepared for the further reform which may not rely on technology type any more, for example the device could tell core layer directly what management it required with a bitmask :-)

Regards,
Michael Wang

Quoted 12 lines

Tom

Quoted 8 lines

Regards,
Michael Wang

Quoted 1 line
Signature · 3 lines
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

#58 lore raw

Re: [PATCH v5 19/27] IB/Verbs: Use management helper cap_iw_cm()

Quoted 10 lines · Michael Wang

On 04/20/2015 05:51 PM, Tom Tucker wrote:
[snip]

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

int ib_query_gid(struct ib_device *device,
u8 port_num, int index, union ib_gid *gid);

iWARP devices _must_ support the IWCM so cap_iw_cm() is not really useful.

Sean suggested to add this helper paired with cap_ib_cm(), may be there are some consideration on maintainability?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Me too also prefer this way to make the code more readable ;-)

It's more consistent, but not necessarily more readable -- if by readability we mean understanding.

If the reader knows how the transports work, then the reader would be confused by the addition of a check that is always true. For the reader that doesn't know, the addition of the check implies that the support is optional, which it is not.

The purpose is to make sure folks understand what we really want to check when they reviewing the code :-) and prepared for the further reform which may not rely on technology type any more, for example the device could tell core layer directly what management it required with a bitmask :-)

Hi Michael,

Thanks for the reply, but my premise was just wrong...I need to review the whole patch, not just a snippet.

Thanks,
Tom

Quoted 8 lines

Regards,
Michael Wang

Quoted 5 lines

Tom

Quoted 3 lines

Regards,
Michael Wang

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Signature · 3 lines
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

--
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

Reviewed-by on v5 19/27
#59 lore raw

Re: [PATCH v5 19/27] IB/Verbs: Use management helper cap_iw_cm()

In reply to Michael Wang
Quoted 4 lines · Michael Wang

Introduce helper cap_iw_cm() to help us check if the port of an IB device support IWARP Communication Manager.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 100 lines
---
 drivers/infiniband/core/cma.c | 14 +++++++-------
 include/rdma/ib_verbs.h       | 15 +++++++++++++++
 2 files changed, 22 insertions(+), 7 deletions(-)
drivers/infiniband/core/cma.c +7 -7
index ff59dbc..dd37b4a 100644
@@ -775,7 +775,7 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 
 		if (qp_attr->qp_state == IB_QPS_RTR)
 			qp_attr->rq_psn = id_priv->seq_num;
-	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
+	} else if (cap_iw_cm(id->device, id->port_num)) {
 		if (!id_priv->cm_id.iw) {
 			qp_attr->qp_access_flags = 0;
 			*qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS;
@@ -1057,7 +1057,7 @@ void rdma_destroy_id(struct rdma_cm_id *id)
 		if (cap_ib_cm(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.ib)
 				ib_destroy_cm_id(id_priv->cm_id.ib);
-		} else if (rdma_tech_iwarp(id_priv->id.device, 1)) {
+		} else if (cap_iw_cm(id_priv->id.device, 1)) {
 			if (id_priv->cm_id.iw)
 				iw_destroy_cm_id(id_priv->cm_id.iw);
 		}
@@ -2541,7 +2541,7 @@ int rdma_listen(struct rdma_cm_id *id, int backlog)
 			ret = cma_ib_listen(id_priv);
 			if (ret)
 				goto err;
-		} else if (rdma_tech_iwarp(id->device, 1)) {
+		} else if (cap_iw_cm(id->device, 1)) {
 			ret = cma_iw_listen(id_priv, backlog);
 			if (ret)
 				goto err;
@@ -2886,7 +2886,7 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 			ret = cma_resolve_ib_udp(id_priv, conn_param);
 		else
 			ret = cma_connect_ib(id_priv, conn_param);
-	} else if (rdma_tech_iwarp(id->device, id->port_num))
+	} else if (cap_iw_cm(id->device, id->port_num))
 		ret = cma_connect_iw(id_priv, conn_param);
 	else
 		ret = -ENOSYS;
@@ -3008,7 +3008,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 			else
 				ret = cma_rep_recv(id_priv);
 		}
-	} else if (rdma_tech_iwarp(id->device, id->port_num))
+	} else if (cap_iw_cm(id->device, id->port_num))
 		ret = cma_accept_iw(id_priv, conn_param);
 	else
 		ret = -ENOSYS;
@@ -3063,7 +3063,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
 			ret = ib_send_cm_rej(id_priv->cm_id.ib,
 					     IB_CM_REJ_CONSUMER_DEFINED, NULL,
 					     0, private_data, private_data_len);
-	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
+	} else if (cap_iw_cm(id->device, id->port_num)) {
 		ret = iw_cm_reject(id_priv->cm_id.iw,
 				   private_data, private_data_len);
 	} else
@@ -3089,7 +3089,7 @@ int rdma_disconnect(struct rdma_cm_id *id)
 		/* Initiate or respond to a disconnect. */
 		if (ib_send_cm_dreq(id_priv->cm_id.ib, NULL, 0))
 			ib_send_cm_drep(id_priv->cm_id.ib, NULL, 0);
-	} else if (rdma_tech_iwarp(id->device, id->port_num)) {
+	} else if (cap_iw_cm(id->device, id->port_num)) {
 		ret = iw_cm_disconnect(id_priv->cm_id.iw, 0);
 	} else
 		ret = -EINVAL;
include/rdma/ib_verbs.h +15 -0
index 6805e3e..e4999f6 100644
@@ -1818,6 +1818,21 @@ static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
 	return rdma_ib_or_iboe(device, port_num);
 }
 
+/**
+ * cap_iw_cm - Check if the port of device has the capability IWARP
+ * Communication Manager.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support IWARP
+ * Communication Manager.
+ */
+static inline int cap_iw_cm(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_iwarp(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.0
#60 lore raw

PATCH v5 20/27 IB/Verbs: Use management helper cap_ib_sa()

In reply to Michael Wang

Introduce helper cap_ib_sa() to help us check if the port of an IB device support Infiniband Subnet Administration.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c      |  4 ++--
 drivers/infiniband/core/sa_query.c | 10 +++++-----
 drivers/infiniband/core/ucma.c     |  2 +-
 include/rdma/ib_verbs.h            | 15 +++++++++++++++
 4 files changed, 23 insertions(+), 8 deletions(-)
drivers/infiniband/core/cma.c +2 -2
index dd37b4a..b92f81b 100644
@@ -954,7 +954,7 @@ static inline int cma_user_data_offset(struct rdma_id_private *id_priv)
 
 static void cma_cancel_route(struct rdma_id_private *id_priv)
 {
-	if (rdma_tech_ib(id_priv->id.device, id_priv->id.port_num)) {
+	if (cap_ib_sa(id_priv->id.device, id_priv->id.port_num)) {
 		if (id_priv->query)
 			ib_sa_cancel_query(id_priv->query_id, id_priv->query);
 	}
@@ -1978,7 +1978,7 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms)
 		return -EINVAL;
 
 	atomic_inc(&id_priv->refcount);
-	if (rdma_tech_ib(id->device, id->port_num))
+	if (cap_ib_sa(id->device, id->port_num))
 		ret = cma_resolve_ib_route(id_priv, timeout_ms);
 	else if (rdma_tech_iboe(id->device, id->port_num))
 		ret = cma_resolve_iboe_route(id_priv);
drivers/infiniband/core/sa_query.c +5 -5
index 60dc7aa..f14a66f 100644
@@ -450,7 +450,7 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event
 		struct ib_sa_port *port =
 			&sa_dev->port[event->element.port_num - sa_dev->start_port];
 
-		if (WARN_ON(!rdma_tech_ib(handler->device, port->port_num)))
+		if (WARN_ON(!cap_ib_sa(handler->device, port->port_num)))
 			return;
 
 		spin_lock_irqsave(&port->ah_lock, flags);
@@ -1173,7 +1173,7 @@ static void ib_sa_add_one(struct ib_device *device)
 
 	for (i = 0; i <= e - s; ++i) {
 		spin_lock_init(&sa_dev->port[i].ah_lock);
-		if (!rdma_tech_ib(device, i + 1))
+		if (!cap_ib_sa(device, i + 1))
 			continue;
 
 		sa_dev->port[i].sm_ah    = NULL;
@@ -1208,7 +1208,7 @@ static void ib_sa_add_one(struct ib_device *device)
 		goto err;
 
 	for (i = 0; i <= e - s; ++i) {
-		if (rdma_tech_ib(device, i + 1))
+		if (cap_ib_sa(device, i + 1))
 			update_sm_ah(&sa_dev->port[i].update_task);
 	}
 
@@ -1216,7 +1216,7 @@ static void ib_sa_add_one(struct ib_device *device)
 
 err:
 	while (--i >= 0) {
-		if (rdma_tech_ib(device, i + 1))
+		if (cap_ib_sa(device, i + 1))
 			ib_unregister_mad_agent(sa_dev->port[i].agent);
 	}
 
@@ -1238,7 +1238,7 @@ static void ib_sa_remove_one(struct ib_device *device)
 	flush_workqueue(ib_wq);
 
 	for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) {
-		if (rdma_tech_ib(device, i + 1)) {
+		if (cap_ib_sa(device, i + 1)) {
 			ib_unregister_mad_agent(sa_dev->port[i].agent);
 			if (sa_dev->port[i].sm_ah)
 				kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah);
drivers/infiniband/core/ucma.c +1 -1
index 7331c6c..bed7957 100644
@@ -723,7 +723,7 @@ static ssize_t ucma_query_route(struct ucma_file *file,
 	resp.node_guid = (__force __u64) ctx->cm_id->device->node_guid;
 	resp.port_num = ctx->cm_id->port_num;
 
-	if (rdma_tech_ib(ctx->cm_id->device, ctx->cm_id->port_num))
+	if (cap_ib_sa(ctx->cm_id->device, ctx->cm_id->port_num))
 		ucma_copy_ib_route(&resp, &ctx->cm_id->route);
 	else if (rdma_tech_iboe(ctx->cm_id->device, ctx->cm_id->port_num))
 		ucma_copy_iboe_route(&resp, &ctx->cm_id->route);
include/rdma/ib_verbs.h +15 -0
index e4999f6..de3a168 100644
@@ -1833,6 +1833,21 @@ static inline int cap_iw_cm(struct ib_device *device, u8 port_num)
 	return rdma_tech_iwarp(device, port_num);
 }
 
+/**
+ * cap_ib_sa - Check if the port of device has the capability Infiniband
+ * Subnet Administration.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Subnet Administration.
+ */
+static inline int cap_ib_sa(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_ib(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 5 lines
2.1.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
Reviewed-by on v5 20/27
#61 lore raw

Re: [PATCH v5 20/27] IB/Verbs: Use management helper cap_ib_sa()

Quoted 4 lines · Michael Wang

Introduce helper cap_ib_sa() to help us check if the port of an IB device support Infiniband Subnet Administration.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 119 lines
---
 drivers/infiniband/core/cma.c      |  4 ++--
 drivers/infiniband/core/sa_query.c | 10 +++++-----
 drivers/infiniband/core/ucma.c     |  2 +-
 include/rdma/ib_verbs.h            | 15 +++++++++++++++
 4 files changed, 23 insertions(+), 8 deletions(-)
drivers/infiniband/core/cma.c +2 -2
index dd37b4a..b92f81b 100644
@@ -954,7 +954,7 @@ static inline int cma_user_data_offset(struct rdma_id_private *id_priv)
 
 static void cma_cancel_route(struct rdma_id_private *id_priv)
 {
-	if (rdma_tech_ib(id_priv->id.device, id_priv->id.port_num)) {
+	if (cap_ib_sa(id_priv->id.device, id_priv->id.port_num)) {
 		if (id_priv->query)
 			ib_sa_cancel_query(id_priv->query_id, id_priv->query);
 	}
@@ -1978,7 +1978,7 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms)
 		return -EINVAL;
 
 	atomic_inc(&id_priv->refcount);
-	if (rdma_tech_ib(id->device, id->port_num))
+	if (cap_ib_sa(id->device, id->port_num))
 		ret = cma_resolve_ib_route(id_priv, timeout_ms);
 	else if (rdma_tech_iboe(id->device, id->port_num))
 		ret = cma_resolve_iboe_route(id_priv);
drivers/infiniband/core/sa_query.c +5 -5
index 60dc7aa..f14a66f 100644
@@ -450,7 +450,7 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event
 		struct ib_sa_port *port =
 			&sa_dev->port[event->element.port_num - sa_dev->start_port];
 
-		if (WARN_ON(!rdma_tech_ib(handler->device, port->port_num)))
+		if (WARN_ON(!cap_ib_sa(handler->device, port->port_num)))
 			return;
 
 		spin_lock_irqsave(&port->ah_lock, flags);
@@ -1173,7 +1173,7 @@ static void ib_sa_add_one(struct ib_device *device)
 
 	for (i = 0; i <= e - s; ++i) {
 		spin_lock_init(&sa_dev->port[i].ah_lock);
-		if (!rdma_tech_ib(device, i + 1))
+		if (!cap_ib_sa(device, i + 1))
 			continue;
 
 		sa_dev->port[i].sm_ah    = NULL;
@@ -1208,7 +1208,7 @@ static void ib_sa_add_one(struct ib_device *device)
 		goto err;
 
 	for (i = 0; i <= e - s; ++i) {
-		if (rdma_tech_ib(device, i + 1))
+		if (cap_ib_sa(device, i + 1))
 			update_sm_ah(&sa_dev->port[i].update_task);
 	}
 
@@ -1216,7 +1216,7 @@ static void ib_sa_add_one(struct ib_device *device)
 
 err:
 	while (--i >= 0) {
-		if (rdma_tech_ib(device, i + 1))
+		if (cap_ib_sa(device, i + 1))
 			ib_unregister_mad_agent(sa_dev->port[i].agent);
 	}
 
@@ -1238,7 +1238,7 @@ static void ib_sa_remove_one(struct ib_device *device)
 	flush_workqueue(ib_wq);
 
 	for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) {
-		if (rdma_tech_ib(device, i + 1)) {
+		if (cap_ib_sa(device, i + 1)) {
 			ib_unregister_mad_agent(sa_dev->port[i].agent);
 			if (sa_dev->port[i].sm_ah)
 				kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah);
drivers/infiniband/core/ucma.c +1 -1
index 7331c6c..bed7957 100644
@@ -723,7 +723,7 @@ static ssize_t ucma_query_route(struct ucma_file *file,
 	resp.node_guid = (__force __u64) ctx->cm_id->device->node_guid;
 	resp.port_num = ctx->cm_id->port_num;
 
-	if (rdma_tech_ib(ctx->cm_id->device, ctx->cm_id->port_num))
+	if (cap_ib_sa(ctx->cm_id->device, ctx->cm_id->port_num))
 		ucma_copy_ib_route(&resp, &ctx->cm_id->route);
 	else if (rdma_tech_iboe(ctx->cm_id->device, ctx->cm_id->port_num))
 		ucma_copy_iboe_route(&resp, &ctx->cm_id->route);
include/rdma/ib_verbs.h +15 -0
index e4999f6..de3a168 100644
@@ -1833,6 +1833,21 @@ static inline int cap_iw_cm(struct ib_device *device, u8 port_num)
 	return rdma_tech_iwarp(device, port_num);
 }
 
+/**
+ * cap_ib_sa - Check if the port of device has the capability Infiniband
+ * Subnet Administration.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Subnet Administration.
+ */
+static inline int cap_ib_sa(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_ib(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.0
#62 lore raw

PATCH v5 21/27 IB/Verbs: Use management helper cap_ib_mcast()

In reply to Michael Wang

Introduce helper cap_ib_mcast() to help us check if the port of an IB device support Infiniband Multicast.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c       |  6 +++---
 drivers/infiniband/core/multicast.c |  6 +++---
 include/rdma/ib_verbs.h             | 15 +++++++++++++++
 3 files changed, 21 insertions(+), 6 deletions(-)
drivers/infiniband/core/cma.c +3 -3
index 8484ae3..58ec946 100644
@@ -1028,7 +1028,7 @@ static void cma_leave_mc_groups(struct rdma_id_private *id_priv)
 		mc = container_of(id_priv->mc_list.next,
 				  struct cma_multicast, list);
 		list_del(&mc->list);
-		if (rdma_tech_ib(id_priv->cma_dev->device,
+		if (cap_ib_mcast(id_priv->cma_dev->device,
 				      id_priv->id.port_num)) {
 			ib_sa_free_multicast(mc->multicast.ib);
 			kfree(mc);
@@ -3342,7 +3342,7 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
 	if (rdma_tech_iboe(id->device, id->port_num)) {
 		kref_init(&mc->mcref);
 		ret = cma_iboe_join_multicast(id_priv, mc);
-	} else if (rdma_tech_ib(id->device, id->port_num))
+	} else if (cap_ib_mcast(id->device, id->port_num))
 		ret = cma_join_ib_multicast(id_priv, mc);
 	else
 		ret = -ENOSYS;
@@ -3376,7 +3376,7 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
 
 			BUG_ON(id_priv->cma_dev->device != id->device);
 
-			if (rdma_tech_ib(id->device, id->port_num)) {
+			if (cap_ib_mcast(id->device, id->port_num)) {
 				ib_sa_free_multicast(mc->multicast.ib);
 				kfree(mc);
 			} else if (rdma_tech_iboe(id->device, id->port_num))
drivers/infiniband/core/multicast.c +3 -3
index 24d93f5..bdc1880 100644
@@ -780,7 +780,7 @@ static void mcast_event_handler(struct ib_event_handler *handler,
 	int index;
 
 	dev = container_of(handler, struct mcast_device, event_handler);
-	if (WARN_ON(!rdma_tech_ib(dev->device, event->element.port_num)))
+	if (WARN_ON(!cap_ib_mcast(dev->device, event->element.port_num)))
 		return;
 
 	index = event->element.port_num - dev->start_port;
@@ -820,7 +820,7 @@ static void mcast_add_one(struct ib_device *device)
 	}
 
 	for (i = 0; i <= dev->end_port - dev->start_port; i++) {
-		if (!rdma_tech_ib(device, dev->start_port + i))
+		if (!cap_ib_mcast(device, dev->start_port + i))
 			continue;
 		port = &dev->port[i];
 		port->dev = dev;
@@ -858,7 +858,7 @@ static void mcast_remove_one(struct ib_device *device)
 	flush_workqueue(mcast_wq);
 
 	for (i = 0; i <= dev->end_port - dev->start_port; i++) {
-		if (rdma_tech_ib(device, dev->start_port + i)) {
+		if (cap_ib_mcast(device, dev->start_port + i)) {
 			port = &dev->port[i];
 			deref_port(port);
 			wait_for_completion(&port->comp);
include/rdma/ib_verbs.h +15 -0
index de3a168..6e354df 100644
@@ -1848,6 +1848,21 @@ static inline int cap_ib_sa(struct ib_device *device, u8 port_num)
 	return rdma_tech_ib(device, port_num);
 }
 
+/**
+ * cap_ib_mcast - Check if the port of device has the capability Infiniband
+ * Multicast.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Multicast.
+ */
+static inline int cap_ib_mcast(struct ib_device *device, u8 port_num)
+{
+	return cap_ib_sa(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 5 lines
2.1.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
Reviewed-by on v5 21/27
#63 lore raw

Re: [PATCH v5 21/27] IB/Verbs: Use management helper cap_ib_mcast()

Quoted 4 lines · Michael Wang

Introduce helper cap_ib_mcast() to help us check if the port of an IB device support Infiniband Multicast.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 96 lines
---
 drivers/infiniband/core/cma.c       |  6 +++---
 drivers/infiniband/core/multicast.c |  6 +++---
 include/rdma/ib_verbs.h             | 15 +++++++++++++++
 3 files changed, 21 insertions(+), 6 deletions(-)
drivers/infiniband/core/cma.c +3 -3
index 8484ae3..58ec946 100644
@@ -1028,7 +1028,7 @@ static void cma_leave_mc_groups(struct rdma_id_private *id_priv)
 		mc = container_of(id_priv->mc_list.next,
 				  struct cma_multicast, list);
 		list_del(&mc->list);
-		if (rdma_tech_ib(id_priv->cma_dev->device,
+		if (cap_ib_mcast(id_priv->cma_dev->device,
 				      id_priv->id.port_num)) {
 			ib_sa_free_multicast(mc->multicast.ib);
 			kfree(mc);
@@ -3342,7 +3342,7 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
 	if (rdma_tech_iboe(id->device, id->port_num)) {
 		kref_init(&mc->mcref);
 		ret = cma_iboe_join_multicast(id_priv, mc);
-	} else if (rdma_tech_ib(id->device, id->port_num))
+	} else if (cap_ib_mcast(id->device, id->port_num))
 		ret = cma_join_ib_multicast(id_priv, mc);
 	else
 		ret = -ENOSYS;
@@ -3376,7 +3376,7 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
 
 			BUG_ON(id_priv->cma_dev->device != id->device);
 
-			if (rdma_tech_ib(id->device, id->port_num)) {
+			if (cap_ib_mcast(id->device, id->port_num)) {
 				ib_sa_free_multicast(mc->multicast.ib);
 				kfree(mc);
 			} else if (rdma_tech_iboe(id->device, id->port_num))
drivers/infiniband/core/multicast.c +3 -3
index 24d93f5..bdc1880 100644
@@ -780,7 +780,7 @@ static void mcast_event_handler(struct ib_event_handler *handler,
 	int index;
 
 	dev = container_of(handler, struct mcast_device, event_handler);
-	if (WARN_ON(!rdma_tech_ib(dev->device, event->element.port_num)))
+	if (WARN_ON(!cap_ib_mcast(dev->device, event->element.port_num)))
 		return;
 
 	index = event->element.port_num - dev->start_port;
@@ -820,7 +820,7 @@ static void mcast_add_one(struct ib_device *device)
 	}
 
 	for (i = 0; i <= dev->end_port - dev->start_port; i++) {
-		if (!rdma_tech_ib(device, dev->start_port + i))
+		if (!cap_ib_mcast(device, dev->start_port + i))
 			continue;
 		port = &dev->port[i];
 		port->dev = dev;
@@ -858,7 +858,7 @@ static void mcast_remove_one(struct ib_device *device)
 	flush_workqueue(mcast_wq);
 
 	for (i = 0; i <= dev->end_port - dev->start_port; i++) {
-		if (rdma_tech_ib(device, dev->start_port + i)) {
+		if (cap_ib_mcast(device, dev->start_port + i)) {
 			port = &dev->port[i];
 			deref_port(port);
 			wait_for_completion(&port->comp);
include/rdma/ib_verbs.h +15 -0
index de3a168..6e354df 100644
@@ -1848,6 +1848,21 @@ static inline int cap_ib_sa(struct ib_device *device, u8 port_num)
 	return rdma_tech_ib(device, port_num);
 }
 
+/**
+ * cap_ib_mcast - Check if the port of device has the capability Infiniband
+ * Multicast.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support Infiniband
+ * Multicast.
+ */
+static inline int cap_ib_mcast(struct ib_device *device, u8 port_num)
+{
+	return cap_ib_sa(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.0
#64 lore raw

PATCH v5 22/27 IB/Verbs: Use management helper cap_ipoib()

In reply to Michael Wang

Introduce helper cap_ipoib() to help us check if the port of an IB device support IP over Infiniband.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c |  2 +-
 include/rdma/ib_verbs.h                   | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -1
index 60b379d..a9812df 100644
@@ -1671,7 +1671,7 @@ static void ipoib_add_one(struct ib_device *device)
 	}
 
 	for (p = s; p <= e; ++p) {
-		if (!rdma_tech_ib(device, p))
+		if (!cap_ipoib(device, p))
 			continue;
 		dev = ipoib_add_port("ib%d", device, p);
 		if (!IS_ERR(dev)) {
include/rdma/ib_verbs.h +15 -0
index 6e354df..d0ae08e 100644
@@ -1863,6 +1863,21 @@ static inline int cap_ib_mcast(struct ib_device *device, u8 port_num)
 	return cap_ib_sa(device, port_num);
 }
 
+/**
+ * cap_ipoib - Check if the port of device has the capability
+ * IP over Infiniband.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support
+ * IP over Infiniband.
+ */
+static inline int cap_ipoib(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_ib(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 5 lines
2.1.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
Reviewed-by on v5 22/27
#65 lore raw

Re: [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib()

Quoted 4 lines · Michael Wang

Introduce helper cap_ipoib() to help us check if the port of an IB device support IP over Infiniband.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 46 lines
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c |  2 +-
 include/rdma/ib_verbs.h                   | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -1
index 60b379d..a9812df 100644
@@ -1671,7 +1671,7 @@ static void ipoib_add_one(struct ib_device *device)
 	}
 
 	for (p = s; p <= e; ++p) {
-		if (!rdma_tech_ib(device, p))
+		if (!cap_ipoib(device, p))
 			continue;
 		dev = ipoib_add_port("ib%d", device, p);
 		if (!IS_ERR(dev)) {
include/rdma/ib_verbs.h +15 -0
index 6e354df..d0ae08e 100644
@@ -1863,6 +1863,21 @@ static inline int cap_ib_mcast(struct ib_device *device, u8 port_num)
 	return cap_ib_sa(device, port_num);
 }
 
+/**
+ * cap_ipoib - Check if the port of device has the capability
+ * IP over Infiniband.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support
+ * IP over Infiniband.
+ */
+static inline int cap_ipoib(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_ib(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
Signature · 1 line
2.1.0
#66 lore raw

Re: [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib()

In reply to Michael Wang
Quoted 2 lines · Michael Wang

Introduce helper cap_ipoib() to help us check if the port of an IB device support IP over Infiniband.

I thought we were dropping this in favor of listing the actual features the ULP required unconditionally? One of my messages had the start of a list..

Jason
--
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

#67 lore raw

Re: [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib()

Quoted 8 lines · Jason Gunthorpe
Quoted 2 lines · Michael Wang

Introduce helper cap_ipoib() to help us check if the port of an IB device support IP over Infiniband.

I thought we were dropping this in favor of listing the actual features the ULP required unconditionally? One of my messages had the start of a list..

Shall we drop it now or wait until the mechanism introduced?

Just wondering the requirement of ULP could be similar to the requirement of management, isn't it? if the device can tell which ULP it support, then may be a cap_XX() make sense in here?

Regards,
Michael Wang

Quoted 3 lines

Jason

--
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

#68 lore raw

Re: [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib()

Quoted 10 lines · Michael Wang
Quoted 8 lines · Jason Gunthorpe
Quoted 2 lines · Michael Wang

Introduce helper cap_ipoib() to help us check if the port of an IB device support IP over Infiniband.

I thought we were dropping this in favor of listing the actual features the ULP required unconditionally? One of my messages had the start of a list..

??? I forget. I was arguing that we should not have it. But I thought others disagreed with me so it was left in.

V4 of this patch had no responses.

https://www.mail-archive.com/[email protected]/msg24040.html

Jason, I can't find the email where you mentioned a list?

Ira

--
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

#69 lore raw

RE: [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib()

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

I thought we were dropping this in favor of listing the actual features the ULP required unconditionally? One of my messages had the start of a list..

??? I forget. I was arguing that we should not have it. But I thought others
disagreed with me so it was left in.

I don't remember, but I agree with Jason. The ULPs should check for the features that they need.

#70 lore raw

Re: [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib()

In reply to ira.weiny
Quoted 12 lines · ira.weiny
Quoted 10 lines · Michael Wang
Quoted 8 lines · Jason Gunthorpe
Quoted 2 lines · Michael Wang

Introduce helper cap_ipoib() to help us check if the port of an IB device support IP over Infiniband.

I thought we were dropping this in favor of listing the actual features the ULP required unconditionally? One of my messages had the start of a list..

Quoted 8 lines

??? I forget. I was arguing that we should not have it. But I thought others disagreed with me so it was left in.

V4 of this patch had no responses.

https://www.mail-archive.com/[email protected]/msg24040.html

Jason, I can't find the email where you mentioned a list?

I don't see a list too :-P but agreed the ULP reform idea, the check should be

ipoib_init()

{
	if (device don't suport SA or IB CM or...)
		return error;
	...
}

So I'll put the reform to that series.

Regards,
Michael Wang

Quoted 3 lines

Ira

#71 lore raw

Re: [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib()

In reply to Michael Wang
Quoted 11 lines · Michael Wang
Quoted 8 lines · Jason Gunthorpe
Quoted 2 lines · Michael Wang

Introduce helper cap_ipoib() to help us check if the port of an IB device support IP over Infiniband.

I thought we were dropping this in favor of listing the actual features the ULP required unconditionally? One of my messages had the start of a list..

Quoted 5 lines

Shall we drop it now or wait until the mechanism introduced?

Just wondering the requirement of ULP could be similar to the requirement of management, isn't it? if the device can tell which ULP it support, then may be a cap_XX() make sense in here?

You have to audit the ipoib dirver and see what core functions it calls that have cap requirements themselves.

At least SA, multicast and CM. It also requires cap_ib_ah() or whatever we called that.

JAson
--
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

#72 lore raw

Re: [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib()

Quoted 18 lines · Jason Gunthorpe
Quoted 11 lines · Michael Wang
Quoted 8 lines · Jason Gunthorpe
Quoted 2 lines · Michael Wang

Introduce helper cap_ipoib() to help us check if the port of an IB device support IP over Infiniband.

I thought we were dropping this in favor of listing the actual features the ULP required unconditionally? One of my messages had the start of a list..

Quoted 5 lines

Shall we drop it now or wait until the mechanism introduced?

Just wondering the requirement of ULP could be similar to the requirement of management, isn't it? if the device can tell which ULP it support, then may be a cap_XX() make sense in here?

Quoted 5 lines

You have to audit the ipoib dirver and see what core functions it calls that have cap requirements themselves.

At least SA, multicast and CM. It also requires cap_ib_ah() or whatever we called that.

I get your point :-) I'd like to suggest we put these in different threads:

1. bitmask reform
2. ulp check mechanism
3. naming (i think it'll be a really big discussion :-P)

Separate them can help us focus on a particular topic at once, and the purpose of patches will be more clear ;-)

Regards,
Michael Wang

Quoted 3 lines

JAson

--
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

#73 lore raw

PATCH v5 23/27 IB/Verbs: Use management helper cap_read_multi_sge()

In reply to Michael Wang

Introduce helper cap_read_multi_sge() to help us check if the port of an IB device support RDMA Read Multiple Scatter-Gather Entries.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 include/rdma/ib_verbs.h                 | 15 +++++++++++++++
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |  3 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)
include/rdma/ib_verbs.h +15 -0
index d0ae08e..074f66d 100644
@@ -1878,6 +1878,21 @@ static inline int cap_ipoib(struct ib_device *device, u8 port_num)
 	return rdma_tech_ib(device, port_num);
 }
 
+/**
+ * cap_read_multi_sge - Check if the port of device has the capability
+ * RDMA Read Multiple Scatter-Gather Entries.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support
+ * RDMA Read Multiple Scatter-Gather Entries.
+ */
+static inline int cap_read_multi_sge(struct ib_device *device, u8 port_num)
+{
+	return !rdma_tech_iwarp(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +2 -1
index a5bed5b..7711b7a 100644
@@ -117,7 +117,8 @@ static void rdma_build_arg_xdr(struct svc_rqst *rqstp,
 
 static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
 {
-	if (rdma_tech_iwarp(xprt->sc_cm_id->device, xprt->sc_cm_id->port_num))
+	if (!cap_read_multi_sge(xprt->sc_cm_id->device,
+				xprt->sc_cm_id->port_num))
 		return 1;
 	else
 		return min_t(int, sge_count, xprt->sc_max_sge);
Signature · 1 line
2.1.0
Reviewed-by on v5 23/27
#74 lore raw

Re: [PATCH v5 23/27] IB/Verbs: Use management helper cap_read_multi_sge()

Quoted 4 lines · Michael Wang

Introduce helper cap_read_multi_sge() to help us check if the port of an IB device support RDMA Read Multiple Scatter-Gather Entries.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 47 lines
---
 include/rdma/ib_verbs.h                 | 15 +++++++++++++++
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |  3 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)
include/rdma/ib_verbs.h +15 -0
index d0ae08e..074f66d 100644
@@ -1878,6 +1878,21 @@ static inline int cap_ipoib(struct ib_device *device, u8 port_num)
 	return rdma_tech_ib(device, port_num);
 }
 
+/**
+ * cap_read_multi_sge - Check if the port of device has the capability
+ * RDMA Read Multiple Scatter-Gather Entries.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support
+ * RDMA Read Multiple Scatter-Gather Entries.
+ */
+static inline int cap_read_multi_sge(struct ib_device *device, u8 port_num)
+{
+	return !rdma_tech_iwarp(device, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
 		 u8 port_num, int index, union ib_gid *gid);
 
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +2 -1
index a5bed5b..7711b7a 100644
@@ -117,7 +117,8 @@ static void rdma_build_arg_xdr(struct svc_rqst *rqstp,
 
 static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
 {
-	if (rdma_tech_iwarp(xprt->sc_cm_id->device, xprt->sc_cm_id->port_num))
+	if (!cap_read_multi_sge(xprt->sc_cm_id->device,
+				xprt->sc_cm_id->port_num))
 		return 1;
 	else
 		return min_t(int, sge_count, xprt->sc_max_sge);
Signature · 1 line
2.1.0
#75 lore raw

PATCH v5 24/27 IB/Verbs: Use management helper cap_af_ib()

In reply to Michael Wang

Introduce helper cap_af_ib() to help us check if the port of an IB device support Native Infiniband Address.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c |  2 +-
 include/rdma/ib_verbs.h       | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/infiniband/core/cma.c +1 -1
index 05d148e..9c1f5b72 100644
@@ -469,7 +469,7 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
 
 	list_for_each_entry(cur_dev, &dev_list, list) {
 		for (p = 1; p <= cur_dev->device->phys_port_cnt; ++p) {
-			if (!rdma_ib_or_iboe(cur_dev->device, p))
+			if (!cap_af_ib(cur_dev->device, p))
 				continue;
 
 			if (ib_find_cached_pkey(cur_dev->device, p, pkey, &index))
include/rdma/ib_verbs.h +15 -0
index 074f66d..9cfab09 100644
@@ -1879,6 +1879,21 @@ static inline int cap_ipoib(struct ib_device *device, u8 port_num)
 }
 
 /**
+ * cap_af_ib - Check if the port of device has the capability
+ * Native Infiniband Address.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support
+ * Native Infiniband Address.
+ */
+static inline int cap_af_ib(struct ib_device *device, u8 port_num)
+{
+	return rdma_ib_or_iboe(device, port_num);
+}
+
+/**
  * cap_read_multi_sge - Check if the port of device has the capability
  * RDMA Read Multiple Scatter-Gather Entries.
  *
Signature · 5 lines
2.1.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
Reviewed-by on v5 24/27
#76 lore raw

Re: [PATCH v5 24/27] IB/Verbs: Use management helper cap_af_ib()

Quoted 4 lines · Michael Wang

Introduce helper cap_af_ib() to help us check if the port of an IB device support Native Infiniband Address.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 46 lines
---
 drivers/infiniband/core/cma.c |  2 +-
 include/rdma/ib_verbs.h       | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/infiniband/core/cma.c +1 -1
index 05d148e..9c1f5b72 100644
@@ -469,7 +469,7 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
 
 	list_for_each_entry(cur_dev, &dev_list, list) {
 		for (p = 1; p <= cur_dev->device->phys_port_cnt; ++p) {
-			if (!rdma_ib_or_iboe(cur_dev->device, p))
+			if (!cap_af_ib(cur_dev->device, p))
 				continue;
 
 			if (ib_find_cached_pkey(cur_dev->device, p, pkey, &index))
include/rdma/ib_verbs.h +15 -0
index 074f66d..9cfab09 100644
@@ -1879,6 +1879,21 @@ static inline int cap_ipoib(struct ib_device *device, u8 port_num)
 }
 
 /**
+ * cap_af_ib - Check if the port of device has the capability
+ * Native Infiniband Address.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support
+ * Native Infiniband Address.
+ */
+static inline int cap_af_ib(struct ib_device *device, u8 port_num)
+{
+	return rdma_ib_or_iboe(device, port_num);
+}
+
+/**
  * cap_read_multi_sge - Check if the port of device has the capability
  * RDMA Read Multiple Scatter-Gather Entries.
  *
Signature · 1 line
2.1.0
#77 lore raw

PATCH v5 25/27 IB/Verbs: Use management helper cap_eth_ah()

In reply to Michael Wang

Introduce helper cap_eth_ah() to help us check if the port of an IB device support Ethernet Address Handler.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/cma.c      |  2 +-
 drivers/infiniband/core/sa_query.c |  2 +-
 drivers/infiniband/core/verbs.c    |  2 +-
 include/rdma/ib_verbs.h            | 15 +++++++++++++++
 4 files changed, 18 insertions(+), 3 deletions(-)
drivers/infiniband/core/cma.c +1 -1
index 9c1f5b72..b9f7ccc 100644
@@ -732,7 +732,7 @@ static int cma_ib_init_qp_attr(struct rdma_id_private *id_priv,
 	int ret;
 	u16 pkey;
 
-	if (rdma_tech_iboe(id_priv->id.device, id_priv->id.port_num))
+	if (cap_eth_ah(id_priv->id.device, id_priv->id.port_num))
 		pkey = 0xffff;
 	else
 		pkey = ib_addr_get_pkey(dev_addr);
drivers/infiniband/core/sa_query.c +1 -1
index f14a66f..063c17c 100644
@@ -540,7 +540,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
 	ah_attr->port_num = port_num;
 	ah_attr->static_rate = rec->rate;
 
-	force_grh = rdma_tech_iboe(device, port_num);
+	force_grh = cap_eth_ah(device, port_num);
 
 	if (rec->hop_limit > 1 || force_grh) {
 		ah_attr->ah_flags = IB_AH_GRH;
drivers/infiniband/core/verbs.c +1 -1
index 7264860..ee4b5cb 100644
@@ -202,7 +202,7 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc,
 	int ret;
 
 	memset(ah_attr, 0, sizeof *ah_attr);
-	if (rdma_tech_iboe(device, port_num)) {
+	if (cap_eth_ah(device, port_num)) {
 		if (!(wc->wc_flags & IB_WC_GRH))
 			return -EPROTOTYPE;
 
include/rdma/ib_verbs.h +15 -0
index 9cfab09..45050cb 100644
@@ -1894,6 +1894,21 @@ static inline int cap_af_ib(struct ib_device *device, u8 port_num)
 }
 
 /**
+ * cap_eth_ah - Check if the port of device has the capability
+ * Ethernet Address Handler.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support
+ * Ethernet Address Handler.
+ */
+static inline int cap_eth_ah(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_iboe(device, port_num);
+}
+
+/**
  * cap_read_multi_sge - Check if the port of device has the capability
  * RDMA Read Multiple Scatter-Gather Entries.
  *
Signature · 1 line
2.1.0
Reviewed-by on v5 25/27
#78 lore raw

Re: [PATCH v5 25/27] IB/Verbs: Use management helper cap_eth_ah()

Quoted 4 lines · Michael Wang

Introduce helper cap_eth_ah() to help us check if the port of an IB device support Ethernet Address Handler.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 74 lines
---
 drivers/infiniband/core/cma.c      |  2 +-
 drivers/infiniband/core/sa_query.c |  2 +-
 drivers/infiniband/core/verbs.c    |  2 +-
 include/rdma/ib_verbs.h            | 15 +++++++++++++++
 4 files changed, 18 insertions(+), 3 deletions(-)
drivers/infiniband/core/cma.c +1 -1
index 9c1f5b72..b9f7ccc 100644
@@ -732,7 +732,7 @@ static int cma_ib_init_qp_attr(struct rdma_id_private *id_priv,
 	int ret;
 	u16 pkey;
 
-	if (rdma_tech_iboe(id_priv->id.device, id_priv->id.port_num))
+	if (cap_eth_ah(id_priv->id.device, id_priv->id.port_num))
 		pkey = 0xffff;
 	else
 		pkey = ib_addr_get_pkey(dev_addr);
drivers/infiniband/core/sa_query.c +1 -1
index f14a66f..063c17c 100644
@@ -540,7 +540,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
 	ah_attr->port_num = port_num;
 	ah_attr->static_rate = rec->rate;
 
-	force_grh = rdma_tech_iboe(device, port_num);
+	force_grh = cap_eth_ah(device, port_num);
 
 	if (rec->hop_limit > 1 || force_grh) {
 		ah_attr->ah_flags = IB_AH_GRH;
drivers/infiniband/core/verbs.c +1 -1
index 7264860..ee4b5cb 100644
@@ -202,7 +202,7 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc,
 	int ret;
 
 	memset(ah_attr, 0, sizeof *ah_attr);
-	if (rdma_tech_iboe(device, port_num)) {
+	if (cap_eth_ah(device, port_num)) {
 		if (!(wc->wc_flags & IB_WC_GRH))
 			return -EPROTOTYPE;
 
include/rdma/ib_verbs.h +15 -0
index 9cfab09..45050cb 100644
@@ -1894,6 +1894,21 @@ static inline int cap_af_ib(struct ib_device *device, u8 port_num)
 }
 
 /**
+ * cap_eth_ah - Check if the port of device has the capability
+ * Ethernet Address Handler.
+ *
+ * @device: Device to be checked
+ * @port_num: Port number of the device
+ *
+ * Return 0 when port of the device don't support
+ * Ethernet Address Handler.
+ */
+static inline int cap_eth_ah(struct ib_device *device, u8 port_num)
+{
+	return rdma_tech_iboe(device, port_num);
+}
+
+/**
  * cap_read_multi_sge - Check if the port of device has the capability
  * RDMA Read Multiple Scatter-Gather Entries.
  *
Signature · 1 line
2.1.0
#79 lore raw

PATCH v5 26/27 IB/Verbs: Clean up rdma_ib_or_iboe()

In reply to Michael Wang

We have finished introducing the cap_XX(), and raw helper rdma_ib_or_iboe() is no longer necessary, thus clean it up.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 include/rdma/ib_verbs.h                  | 19 +++++++++----------
 net/sunrpc/xprtrdma/svc_rdma_transport.c |  6 ++++--
 2 files changed, 13 insertions(+), 12 deletions(-)
include/rdma/ib_verbs.h +9 -10
index 45050cb..0c0a4f0 100644
@@ -1766,13 +1766,6 @@ static inline int rdma_tech_iwarp(struct ib_device *device, u8 port_num)
 			== RDMA_TRANSPORT_IWARP;
 }
 
-static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num)
-{
-	enum rdma_transport_type tp = device->query_transport(device, port_num);
-
-	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
-}
-
 /**
  * cap_ib_mad - Check if the port of device has the capability Infiniband
  * Management Datagrams.
@@ -1785,7 +1778,9 @@ static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num)
  */
 static inline int cap_ib_mad(struct ib_device *device, u8 port_num)
 {
-	return rdma_ib_or_iboe(device, port_num);
+	enum rdma_transport_type tp = device->query_transport(device, port_num);
+
+	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
 }
 
 /**
@@ -1815,7 +1810,9 @@ static inline int cap_ib_smi(struct ib_device *device, u8 port_num)
  */
 static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
 {
-	return rdma_ib_or_iboe(device, port_num);
+	enum rdma_transport_type tp = device->query_transport(device, port_num);
+
+	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
 }
 
 /**
@@ -1890,7 +1887,9 @@ static inline int cap_ipoib(struct ib_device *device, u8 port_num)
  */
 static inline int cap_af_ib(struct ib_device *device, u8 port_num)
 {
-	return rdma_ib_or_iboe(device, port_num);
+	enum rdma_transport_type tp = device->query_transport(device, port_num);
+
+	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
 }
 
 /**
net/sunrpc/xprtrdma/svc_rdma_transport.c +4 -2
index a09b7a1..8af6f92 100644
@@ -987,8 +987,10 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
 	 */
 	if (!rdma_tech_iwarp(newxprt->sc_cm_id->device,
 			     newxprt->sc_cm_id->port_num) &&
-	    !rdma_ib_or_iboe(newxprt->sc_cm_id->device,
-			     newxprt->sc_cm_id->port_num))
+	    !rdma_tech_ib(newxprt->sc_cm_id->device,
+			  newxprt->sc_cm_id->port_num) &&
+	    !rdma_tech_iboe(newxprt->sc_cm_id->device,
+			    newxprt->sc_cm_id->port_num))
 		goto errout;
 
 	if (!(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG) ||
Signature · 5 lines
2.1.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
Reviewed-by on v5 26/27
#80 lore raw

Re: [PATCH v5 26/27] IB/Verbs: Clean up rdma_ib_or_iboe()

Quoted 4 lines · Michael Wang

We have finished introducing the cap_XX(), and raw helper rdma_ib_or_iboe() is no longer necessary, thus clean it up.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 76 lines
---
 include/rdma/ib_verbs.h                  | 19 +++++++++----------
 net/sunrpc/xprtrdma/svc_rdma_transport.c |  6 ++++--
 2 files changed, 13 insertions(+), 12 deletions(-)
include/rdma/ib_verbs.h +9 -10
index 45050cb..0c0a4f0 100644
@@ -1766,13 +1766,6 @@ static inline int rdma_tech_iwarp(struct ib_device *device, u8 port_num)
 			== RDMA_TRANSPORT_IWARP;
 }
 
-static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num)
-{
-	enum rdma_transport_type tp = device->query_transport(device, port_num);
-
-	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
-}
-
 /**
  * cap_ib_mad - Check if the port of device has the capability Infiniband
  * Management Datagrams.
@@ -1785,7 +1778,9 @@ static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num)
  */
 static inline int cap_ib_mad(struct ib_device *device, u8 port_num)
 {
-	return rdma_ib_or_iboe(device, port_num);
+	enum rdma_transport_type tp = device->query_transport(device, port_num);
+
+	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
 }
 
 /**
@@ -1815,7 +1810,9 @@ static inline int cap_ib_smi(struct ib_device *device, u8 port_num)
  */
 static inline int cap_ib_cm(struct ib_device *device, u8 port_num)
 {
-	return rdma_ib_or_iboe(device, port_num);
+	enum rdma_transport_type tp = device->query_transport(device, port_num);
+
+	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
 }
 
 /**
@@ -1890,7 +1887,9 @@ static inline int cap_ipoib(struct ib_device *device, u8 port_num)
  */
 static inline int cap_af_ib(struct ib_device *device, u8 port_num)
 {
-	return rdma_ib_or_iboe(device, port_num);
+	enum rdma_transport_type tp = device->query_transport(device, port_num);
+
+	return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE);
 }
 
 /**
net/sunrpc/xprtrdma/svc_rdma_transport.c +4 -2
index a09b7a1..8af6f92 100644
@@ -987,8 +987,10 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
 	 */
 	if (!rdma_tech_iwarp(newxprt->sc_cm_id->device,
 			     newxprt->sc_cm_id->port_num) &&
-	    !rdma_ib_or_iboe(newxprt->sc_cm_id->device,
-			     newxprt->sc_cm_id->port_num))
+	    !rdma_tech_ib(newxprt->sc_cm_id->device,
+			  newxprt->sc_cm_id->port_num) &&
+	    !rdma_tech_iboe(newxprt->sc_cm_id->device,
+			    newxprt->sc_cm_id->port_num))
 		goto errout;
 
 	if (!(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG) ||
Signature · 1 line
2.1.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

#81 lore raw

PATCH v5 27/27 IB/Verbs: Cleanup rdma_node_get_transport()

In reply to Michael Wang

We have get rid of all the scene using legacy rdma_node_get_transport(), now clean it up.

Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
---
 drivers/infiniband/core/verbs.c | 21 ---------------------
 include/rdma/ib_verbs.h         |  3 ---
 2 files changed, 24 deletions(-)
drivers/infiniband/core/verbs.c +0 -21
index ee4b5cb..bbea0c0 100644
@@ -107,27 +107,6 @@ __attribute_const__ int ib_rate_to_mbps(enum ib_rate rate)
 }
 EXPORT_SYMBOL(ib_rate_to_mbps);
 
-__attribute_const__ enum rdma_transport_type
-rdma_node_get_transport(enum rdma_node_type node_type)
-{
-	switch (node_type) {
-	case RDMA_NODE_IB_CA:
-	case RDMA_NODE_IB_SWITCH:
-	case RDMA_NODE_IB_ROUTER:
-		return RDMA_TRANSPORT_IB;
-	case RDMA_NODE_RNIC:
-		return RDMA_TRANSPORT_IWARP;
-	case RDMA_NODE_USNIC:
-		return RDMA_TRANSPORT_USNIC;
-	case RDMA_NODE_USNIC_UDP:
-		return RDMA_TRANSPORT_USNIC_UDP;
-	default:
-		BUG();
-		return 0;
-	}
-}
-EXPORT_SYMBOL(rdma_node_get_transport);
-
 enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_num)
 {
 	if (device->get_link_layer)
include/rdma/ib_verbs.h +0 -3
index 0c0a4f0..f2ea6e7 100644
@@ -84,9 +84,6 @@ enum rdma_transport_type {
 	RDMA_TRANSPORT_IBOE,
 };
 
-__attribute_const__ enum rdma_transport_type
-rdma_node_get_transport(enum rdma_node_type node_type);
-
 enum rdma_link_layer {
 	IB_LINK_LAYER_UNSPECIFIED,
 	IB_LINK_LAYER_INFINIBAND,
Signature · 5 lines
2.1.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
Reviewed-by on v5 27/27
#82 lore raw

Re: [PATCH v5 27/27] IB/Verbs: Cleanup rdma_node_get_transport()

Quoted 4 lines · Michael Wang

We have get rid of all the scene using legacy rdma_node_get_transport(), now clean it up.

Quoted 8 lines
Cc Hal Rosenstock <[email protected]>
Cc Steve Wise <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc Doug Ledford <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Sean Hefty <[email protected]>
Quoted 53 lines
---
 drivers/infiniband/core/verbs.c | 21 ---------------------
 include/rdma/ib_verbs.h         |  3 ---
 2 files changed, 24 deletions(-)
drivers/infiniband/core/verbs.c +0 -21
index ee4b5cb..bbea0c0 100644
@@ -107,27 +107,6 @@ __attribute_const__ int ib_rate_to_mbps(enum ib_rate rate)
 }
 EXPORT_SYMBOL(ib_rate_to_mbps);
 
-__attribute_const__ enum rdma_transport_type
-rdma_node_get_transport(enum rdma_node_type node_type)
-{
-	switch (node_type) {
-	case RDMA_NODE_IB_CA:
-	case RDMA_NODE_IB_SWITCH:
-	case RDMA_NODE_IB_ROUTER:
-		return RDMA_TRANSPORT_IB;
-	case RDMA_NODE_RNIC:
-		return RDMA_TRANSPORT_IWARP;
-	case RDMA_NODE_USNIC:
-		return RDMA_TRANSPORT_USNIC;
-	case RDMA_NODE_USNIC_UDP:
-		return RDMA_TRANSPORT_USNIC_UDP;
-	default:
-		BUG();
-		return 0;
-	}
-}
-EXPORT_SYMBOL(rdma_node_get_transport);
-
 enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_num)
 {
 	if (device->get_link_layer)
include/rdma/ib_verbs.h +0 -3
index 0c0a4f0..f2ea6e7 100644
@@ -84,9 +84,6 @@ enum rdma_transport_type {
 	RDMA_TRANSPORT_IBOE,
 };
 
-__attribute_const__ enum rdma_transport_type
-rdma_node_get_transport(enum rdma_node_type node_type);
-
 enum rdma_link_layer {
 	IB_LINK_LAYER_UNSPECIFIED,
 	IB_LINK_LAYER_INFINIBAND,
Signature · 1 line
2.1.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

#83 lore raw
In reply to Michael Wang

Hi Michael,

is there a specific git branch available to pull out all the patches?

-Regards
Devesh

Quoted 158 lines

-----Original Message-----
From: [email protected] [mailto:linux-rdma- [email protected]] On Behalf Of Michael Wang
Sent: Monday, April 20, 2015 1:59 PM
To: Roland Dreier; Sean Hefty; Hal Rosenstock; [email protected]; [email protected]; [email protected]
Cc: Tom Tucker; Steve Wise; Hoang-Nam Nguyen; Christoph Raisch; Mike Marciniszyn; Eli Cohen; Faisal Latif; Jack Morgenstein; Or Gerlitz; Haggai Eran; Ira Weiny; Tom Talpey; Jason Gunthorpe; Doug Ledford; Michael Wang
Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the device/port.

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals below.

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier for extending.

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be another series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#84 lore raw

Hi, Devesh

Quoted 3 lines · Devesh Sharma

Hi Michael,

is there a specific git branch available to pull out all the patches?

Not yet, we may need the maintainer to tell us which branch could the series been applied for testing purpose, after we all satisfied :-)

For now we could 'git am' these patches to 'infiniband.git/for-next' in order to do testing.

Regards,
Michael Wang

Quoted 162 lines

-Regards
Devesh

Quoted 158 lines

-----Original Message-----
From: [email protected] [mailto:linux-rdma- [email protected]] On Behalf Of Michael Wang
Sent: Monday, April 20, 2015 1:59 PM
To: Roland Dreier; Sean Hefty; Hal Rosenstock; [email protected]; [email protected]; [email protected]
Cc: Tom Tucker; Steve Wise; Hoang-Nam Nguyen; Christoph Raisch; Mike
Marciniszyn; Eli Cohen; Faisal Latif; Jack Morgenstein; Or Gerlitz; Haggai Eran;
Ira Weiny; Tom Talpey; Jason Gunthorpe; Doug Ledford; Michael Wang
Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the device/port.

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals below.

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier for extending.

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be another series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#85 lore raw

Hi Michael,

It will be great help if you could base you patches on existing Roland's tree and share to branch details to pull. Just like Chuck lever does for his nfs-rdma patches?

-Regards
Devesh

Quoted 194 lines

-----Original Message-----
From: Michael Wang [mailto:[email protected]]
Sent: Tuesday, April 21, 2015 1:17 PM
To: Devesh Sharma; Roland Dreier; Sean Hefty; Hal Rosenstock; linux- [email protected]; [email protected]; [email protected]
Cc: Tom Tucker; Steve Wise; Hoang-Nam Nguyen; Christoph Raisch; Mike Marciniszyn; Eli Cohen; Faisal Latif; Jack Morgenstein; Or Gerlitz; Haggai Eran; Ira Weiny; Tom Talpey; Jason Gunthorpe; Doug Ledford
Subject: Re: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Hi, Devesh

Quoted 3 lines · Devesh Sharma

Hi Michael,

is there a specific git branch available to pull out all the patches?

Not yet, we may need the maintainer to tell us which branch could the series been applied for testing purpose, after we all satisfied :-)

For now we could 'git am' these patches to 'infiniband.git/for-next' in order to do testing.

Regards,
Michael Wang

Quoted 28 lines

-Regards
Devesh

Quoted 24 lines

-----Original Message-----
From: [email protected] [mailto:linux-rdma- [email protected]] On Behalf Of Michael Wang
Sent: Monday, April 20, 2015 1:59 PM
To: Roland Dreier; Sean Hefty; Hal Rosenstock; [email protected]; [email protected]; [email protected]
Cc: Tom Tucker; Steve Wise; Hoang-Nam Nguyen; Christoph Raisch; Mike Marciniszyn; Eli Cohen; Faisal Latif; Jack Morgenstein; Or Gerlitz; Haggai Eran; Ira Weiny; Tom Talpey; Jason Gunthorpe; Doug Ledford; Michael Wang
Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the

device/port.

Quoted 24 lines
Quoted 24 lines

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals below.

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB
Quoted 8 lines
Quoted 8 lines

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier

for extending.

Quoted 9 lines
Quoted 9 lines

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be
invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Quoted 7 lines
Quoted 7 lines

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be

another

Quoted 89 lines
Quoted 89 lines

series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#86 lore raw
Quoted 4 lines · Devesh Sharma

Hi Michael,

It will be great help if you could base you patches on existing Roland's tree and share to branch details to pull. Just like Chuck lever does for his nfs-rdma patches?

I've setup a repository in:
https://github.com/ywang-pb/infiniband-wy
git url is:
[email protected]:ywang-pb/infiniband-wy.git

It's based on latest infiniband/for-next, branch 'mgmt-helpers' contain this patch set, please let me know if there are any issues :-)

Regards,
Michael Wang

Quoted 198 lines

-Regards
Devesh

Quoted 194 lines

-----Original Message-----
From: Michael Wang [mailto:[email protected]]
Sent: Tuesday, April 21, 2015 1:17 PM
To: Devesh Sharma; Roland Dreier; Sean Hefty; Hal Rosenstock; linux- [email protected]; [email protected]; [email protected]
Cc: Tom Tucker; Steve Wise; Hoang-Nam Nguyen; Christoph Raisch; Mike Marciniszyn; Eli Cohen; Faisal Latif; Jack Morgenstein; Or Gerlitz; Haggai Eran; Ira Weiny; Tom Talpey; Jason Gunthorpe; Doug Ledford
Subject: Re: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Hi, Devesh

Quoted 3 lines · Devesh Sharma

Hi Michael,

is there a specific git branch available to pull out all the patches?

Not yet, we may need the maintainer to tell us which branch could the series been applied for testing purpose, after we all satisfied :-)

For now we could 'git am' these patches to 'infiniband.git/for-next' in order to do testing.

Regards,
Michael Wang

Quoted 28 lines

-Regards
Devesh

Quoted 24 lines

-----Original Message-----
From: [email protected] [mailto:linux-rdma- [email protected]] On Behalf Of Michael Wang
Sent: Monday, April 20, 2015 1:59 PM
To: Roland Dreier; Sean Hefty; Hal Rosenstock; [email protected]; [email protected]; [email protected]
Cc: Tom Tucker; Steve Wise; Hoang-Nam Nguyen; Christoph Raisch; Mike Marciniszyn; Eli Cohen; Faisal Latif; Jack Morgenstein; Or Gerlitz; Haggai Eran; Ira Weiny; Tom Talpey; Jason Gunthorpe; Doug Ledford; Michael Wang
Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the

device/port.

Quoted 24 lines
Quoted 24 lines

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals below.

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB
Quoted 8 lines
Quoted 8 lines

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier

for extending.

Quoted 9 lines
Quoted 9 lines

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be
invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Quoted 7 lines
Quoted 7 lines

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be

another

Quoted 89 lines
Quoted 89 lines

series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#87 lore raw
In reply to Michael Wang

SGkgTWljaGFlbCwNCg0KVGhlIHNwaXJpd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9pbmZpbmliYW5kL2h3L3VzbmljL3VzbmljX2liX21haW4uYyAg fCAgICAxDQo+ICBkcml2ZXJzL2luZmluaWJhbmQvaHcvdXNuaWMvdXNuaWNfaWJfdmVyYnMuYyB8 ICAgIDYNCj4gIGRyaXZlcnMvaW5maW5pYmFuZC9ody91c25pYy91c25pY19pYl92ZXJicy5oIHwg ICAgMg0KPiAgZHJpdmVycy9pbmZpbmliYW5kL3VscC9pcG9pYi9pcG9pYl9tYWluLmMgICAgfCAg IDE3IC0NCj4gIGluY2x1ZGUvcmRtYS9pYl92ZXJicy5oICAgICAgICAgICAgICAgICAgICAgIHwg IDIwNCArKysrKysrKysrKysrKystDQo+ICBuZXQvc3VucnBjL3hwcnRyZG1hL3N2Y19yZG1hX3Jl Y3Zmcm9tLmMgICAgICB8ICAgIDYNCj4gIG5ldC9zdW5ycGMveHBydHJkbWEvc3ZjX3JkbWFfdHJh bnNwb3J0LmMgICAgIHwgICA1MSArLS0tDQo+ICAzNSBmaWxlcyBjaGFuZ2VkLCA1ODQgaW5zZXJ0 aW9ucygrKSwgMzY4IGRlbGV0aW9ucygtKQ0KPiAtLQ0KPiBUbyB1bnN1YnNjcmliZSBmcm9tIHRo aXMgbGlzdDogc2VuZCB0aGUgbGluZSAidW5zdWJzY3JpYmUgbGludXgtcmRtYSIgaW4gdGhlDQo+ IGJvZHkgb2YgYSBtZXNzYWdlIHRvIG1ham9yZG9tb0B2Z2VyLmtlcm5lbC5vcmcgTW9yZSBtYWpv cmRvbW8gaW5mbyBhdA0KPiBodHRwOi8vdmdlci5rZXJuZWwub3JnL21ham9yZG9tby1pbmZvLmh0 bWwNCg==
--
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

#88 lore raw
Quoted 31 lines · Liran Liss

Hi Michael,

The spirit of this patch-set is great, but I think that we need to clarify some concepts. Since this will affect the whole patch-set, I am laying out my concerns here instead.

A suggestion for the resulting management helpers is given below. I believe the result would be much more coherent. --Liran

In general
========

An ib_dev (or a port of) should be distinguished by 3 qualifiers:
- The link layer:
-- Ethernet (shared by iWARP, USNIC, and ROCE)
-- Infiniband

- The transport (*)
-- IBTA transport (shared by IB and ROCE)
-- iWARP transport
-- USNIC transport

(*) Transport means both:
- The L4 wire protocols (e.g., BTH+ headers of IBTA, optionally encapsulated by UDP in ROCEv2, or the iWARP stack)
- The transport semantics (for example, there are slight semantic differences between IBTA and iWARP)

- The node type (**)
-- CA
-- Switch
-- Router

Quoted 5 lines

(**) This has been extended to also encode the transport in the current code.
At least for user-space visible APIs, we might chose to leave this for backward compatibility, but we can consider cleaning up the kernel code.

So, I think that our "old-transport" below is just fine.
No need to change it (and you aren't, since it is currently implemented as a function).

I think there is a need to change this. Encoding the transport into the node type is not a good idea. Having different "transport semantics" while still returning the same transport for the port is confusing.

The only thing which is clear currently is Link Layer.

But the use of "Link Layer" in the code is so convoluted that it is very confusing.

Quoted 6 lines

The "new-transport" does not really exist, but is broken into several capability checks of the L4 transport, optionally with conditions on the link type. I would remove the table below and tell what we really want to achieve:
==> move technology-specific feature-check logic out of the (multiple!) IB code components and various ULPs into per-feature helpers.

Quoted 6 lines

Detailed remarks
==============

1) The introduction of cap_*_*() stuff should have been introduced directly in patch 02/27.
This back-and-forth between rdma_ib_or_iboe() and cap_* is confusing and increases the number of patches in the patch-set. Do this and remove patches 16-24.

I think this is a result of the back and forth which has gone on. Some squashing could be done but the current series is pretty straight forward when you look at the patches. Most are less than a page long at this point.

Quoted 4 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

Define Transport? There has been a lot of discussion over what a transport is in Verbs.

Quoted 5 lines

3) The name cap_* as it is used above is not accurate.
You use it to describe technology characteristics rather than extendable capabilities. I would suggest having a single convention for all helpers, such as rdma_has_*() and rdma_is_*(). For example: cap_ib_smi() ==> rdma_has_smi().

rdma_has_smi is not sufficient for the new OPA technology. We discussed many different names and cap_* was settled on. The use of cap_ib_* was for things which are specific to IB Ports.

Frankly when RoCE was added functions like this this should have been added for clarity into the CM and multicast code. But at the time a simple "is link layer check" was sufficient. Now we have so many different devices and layers that this clean up is needed to support the future.

Quoted 5 lines

4) Remove all capabilities that do not introduce any distinction in the current code. We can add them as needed later.
This means remove patches:
- [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib() – all IB devices support ipoib

Ah? What is the point of supporting IPoIB on RoCE? What do you mean by "IB device"?

Quoted 1 line

- [PATCH v5 24/27] IB/Verbs: Use management helper cap_af_ib() – all IB devices support AF_IB.

But not a generic RDMA device... Which is what is being queried in the call.

Quoted 4 lines

On the other hand:
- rdma_has_multicast() makes sense, since iWARP doesn’t support it.
- cap_ib_sa() might make sense to cut code even further in the CMA, since RoCE has a GSI but no SA.

As does cap_ib_mad, cap_ib_cm, etc.

Quoted 3 lines

5) Do no modify phys_state_show() in [PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs It *is* the link layer!

I agree with this. When the Link Layer is directly being requested we should report the link layer. However, the internal uses of Link Layer should be minimal if not 0.

Quoted 4 lines

6) Remove cap_read_multi_sge
It is not device/port feature, but a transport capability.
Use rdma_is_iwarp_transport() instead, or introduce a new transport flag in 'enum ib_device_cap_flags'.

This was already debated and we settled on cap_read_multi_sge. Checking the transport does not allow for other verbs devices to support this unless they set that same transport.

Quoted 3 lines

7) Remove [PATCH v5 25/27] IB/Verbs: Use management helper cap_eth_ah(). Address handles that refer to Ethernet links always have Ethernet addressing.

But how does the upper level code _know_ that? That is the point of cap_eth_ah.

Quoted 6 lines

In the CMA code, using rdma_tech_iboe() is just fine. This is how you define cap_eth_ah() anyway. Currently, this patch just adds clutter.

8) Remove patch [PATCH v5 26/27] IB/Verbs: Clean up rdma_ib_or_iboe().
We do need a transport qualifier, as exemplified in comment 5) above, and for a complete clean model.

I'm confused, comment 5 was talking about Link Layer???

Quoted 6 lines

This is after renaming the function to rdma_is_ib_transport()...

Putting it all together
==================

Quoted 6 lines

We are left with the following helpers:
- rdma_is_ib_transport()
- rdma_is_iwarp_transport()
- rdma_is_usnic_transport()
- rdma_is_iboe()
- rdma_has_mad()

Not sufficient to distinguish OPA MADs from IB

Quoted 4 lines

- rdma_has_smi()
- rdma_has_gsi() - complements smi; can be used by the mad code for clarity
- rdma_has_sa()
- rdma_has_cm()

Not sufficient to distinguish between the IB CM and iWarp "CM".

Quoted 1 line

- rdma_has_mcast()

Not sufficient to distinguish between the IB Multicast vs IBoE Multicast.

In general I'm flexible on the function names. "cap" vs "rdma" does not really matter to me. Likewise "has" vs "requires" vs "uses" does not matter.

Regardless we still need more granularity than "Transport" and "Link Layer" for many of the code choices.

The result of this series is pretty explicit and much cleaner as to what the upper layers are really checking for.

Furthermore we know that the implementations are going to change going forward. The point of this series is to decouple the MAD, CM, SA, IPoIB, etc modules from the knowledge of transport and link layer. The new interface is simply using the old implementation as a stepping stone.

Ira

Quoted 143 lines
Quoted 143 lines

Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the device/port.

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals below.

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier for extending.

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be another series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
Quoted 8 lines
Quoted 8 lines
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#89 lore raw

On 04/22/2015 04:41 AM, ira.weiny wrote:
[snip]

Quoted 8 lines
Quoted 4 lines

5) Do no modify phys_state_show() in [PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs It *is* the link layer!

I agree with this. When the Link Layer is directly being requested we should report the link layer. However, the internal uses of Link Layer should be minimal if not 0.

Reform on link_layer_show() and ib_uverbs_query_port() Will be dropped in next version :-)

Regards,
Michael Wang

Quoted 62 lines
Quoted 5 lines

6) Remove cap_read_multi_sge
It is not device/port feature, but a transport capability.
Use rdma_is_iwarp_transport() instead, or introduce a new transport flag in 'enum ib_device_cap_flags'.

This was already debated and we settled on cap_read_multi_sge. Checking the transport does not allow for other verbs devices to support this unless they set that same transport.

Quoted 3 lines

7) Remove [PATCH v5 25/27] IB/Verbs: Use management helper cap_eth_ah(). Address handles that refer to Ethernet links always have Ethernet addressing.

But how does the upper level code _know_ that? That is the point of cap_eth_ah.

Quoted 6 lines

In the CMA code, using rdma_tech_iboe() is just fine. This is how you define cap_eth_ah() anyway. Currently, this patch just adds clutter.

8) Remove patch [PATCH v5 26/27] IB/Verbs: Clean up rdma_ib_or_iboe().
We do need a transport qualifier, as exemplified in comment 5) above, and for a complete clean model.

I'm confused, comment 5 was talking about Link Layer???

Quoted 6 lines

This is after renaming the function to rdma_is_ib_transport()...

Putting it all together
==================

Quoted 6 lines

We are left with the following helpers:
- rdma_is_ib_transport()
- rdma_is_iwarp_transport()
- rdma_is_usnic_transport()
- rdma_is_iboe()
- rdma_has_mad()

Not sufficient to distinguish OPA MADs from IB

Quoted 4 lines

- rdma_has_smi()
- rdma_has_gsi() - complements smi; can be used by the mad code for clarity
- rdma_has_sa()
- rdma_has_cm()

Not sufficient to distinguish between the IB CM and iWarp "CM".

Quoted 1 line

- rdma_has_mcast()

Not sufficient to distinguish between the IB Multicast vs IBoE Multicast.

In general I'm flexible on the function names. "cap" vs "rdma" does not really matter to me. Likewise "has" vs "requires" vs "uses" does not matter.

Regardless we still need more granularity than "Transport" and "Link Layer" for many of the code choices.

The result of this series is pretty explicit and much cleaner as to what the upper layers are really checking for.

Quoted 158 lines

Furthermore we know that the implementations are going to change going forward. The point of this series is to decouple the MAD, CM, SA, IPoIB, etc modules from the knowledge of transport and link layer. The new interface is simply using the old implementation as a stepping stone.

Ira

Quoted 151 lines
Quoted 151 lines

Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the device/port.

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals below.

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier for extending.

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be another series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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): DB4PR05MB086335365371E756B789FE84B1EE0@DB4PR05MB0863.eurprd05.prod.outlook.com

#91 lore raw
Quoted 2 lines · Liran Liss

This is redundant. All IB ports have SMI, so if you know that you are using an IB device, you know you have an SMI.

You should really go back and read the whole thread, this has already been discussed.

The patch set was developed from the 'bottom up' - all the points that did 'if is iwarp/rocee/ib/foo' were examined, Michael figured out what *difference* that code actually required and made a dedicated test for it.

It turns out, one of those differences is SMI, !SMI.

The tests are an inventory of all the spec differences the code cares about. This is the entire point.

Yes, of course, an abstract notion like <link-type, transport, node-type> can describe the same state space, but then the call sites loose the insight into *WHY* the code cares, and *WHAT* the difference is.

This is bad:
if (rdma_standard_ib() || rdma_standard_rocee() ||
rdma_standard_opa())

This is worse:
if (!rdma_standard_iwarp())

This is better:
if (rdma_cap_mad())

Going forward, we are growing more tests, and worse, they are for standards that are not public. We need to stop open-coding 'is standard' type code and actually start documenting these differences.

Jason

A message that is not in the archive (sent off-list or not yet received): DB4PR05MB08633B2B2E3BA32752EE8098B1EC0@DB4PR05MB0863.eurprd05.prod.outlook.com

#93 lore raw
Quoted 2 lines · Liran Liss

Currently, the only code in the kernel that has an SMI interface is IB. When OPA is introduced, add the proper helper.

We already have tests checking for SMI is supported so QP0 can be created, this is to support ROCEE

Quoted 8 lines

All I am saying is that there will always be code paths that are technology- and standards-specific. For example, the low-level MAD processing code *must* do stuff like:

if (rdma_is_transport_ib())

	/* IB-spec compliant stuff */
else if (rdma_is_transport_opa())
	/* OPA stuff */

Why should we open code that? It is back to what I said - that doesn't help the reader. Which of the few differences between OPA and IB MADs is that code trying to deal with?

Heck, what are the differences? Do you know? Do I know?

If you don't know what the differences are, you can't realistically work on the MAD layer anymore, because you might break OPA.

Whereas, If I see:

if (cap_2k_mad())
/* Special handling for OPA 2k mad support */
if (cap_opa_mad_space() && mad->baseVersion == ... )
/* Decode OPA mads */
if (cap_ib_mad_space() && mad->baseVersion == ... )
/* Decode IB mads */

The I *know* what to look for when writing new code.

That is the problem we are trying to address here. iWarp has already created it, we addressed it using 'rdma_is_transport_iwarp' and I don't think those results were very satisfying.

Jason
--
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

#94 lore raw
Quoted 16 lines · Jason Gunthorpe
Quoted 2 lines · Liran Liss

Currently, the only code in the kernel that has an SMI interface is IB. When OPA is introduced, add the proper helper.

We already have tests checking for SMI is supported so QP0 can be created, this is to support ROCEE

Quoted 8 lines

All I am saying is that there will always be code paths that are technology- and standards-specific. For example, the low-level MAD processing code *must* do stuff like:

if (rdma_is_transport_ib())

	/* IB-spec compliant stuff */
else if (rdma_is_transport_opa())
	/* OPA stuff */

The issue is that opa is _not_ a new "transport". It is just like RoCEE which supports the IB transport with some differences.

We need a way to explain what those differences are while keeping each section of code as clean and clear as possible. Many of us have spent a lot of time trying to figure out what each section of the current code is doing when they call "get_transport" and/or "get_link_layer".

Quoted 7 lines

Why should we open code that? It is back to what I said - that doesn't help the reader. Which of the few differences between OPA and IB MADs is that code trying to deal with?

Heck, what are the differences? Do you know? Do I know?

Quoted 7 lines

If you don't know what the differences are, you can't realistically work on the MAD layer anymore, because you might break OPA.

Whereas, If I see:

if (cap_2k_mad())
/* Special handling for OPA 2k mad support */

FWIW we decided not to special case 2K and simply provide the max MAD size which a driver supports. This is much more flexible. I think the semantics are equivalent to your example here but I don't think we need a discussion around a "cap_2k_mad" helper.

Quoted 4 lines

if (cap_opa_mad_space() && mad->baseVersion == ... )
/* Decode OPA mads */
if (cap_ib_mad_space() && mad->baseVersion == ... )
/* Decode IB mads */

Agreed.

Quoted 6 lines

The I *know* what to look for when writing new code.

That is the problem we are trying to address here. iWarp has already created it, we addressed it using 'rdma_is_transport_iwarp' and I don't think those results were very satisfying.

No they are not and it is getting more complicated.

Ira

--
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

#95 lore raw
In reply to ira.weiny
Quoted 10 lines
Quoted 2 lines

So, I think that our "old-transport" below is just fine.
No need to change it (and you aren't, since it is currently implemented

as a function).

I think there is a need to change this. Encoding the transport into the node
type is not a good idea. Having different "transport semantics" while still
returning the same transport for the port is confusing.

Quoted 4 lines

The only thing which is clear currently is Link Layer.

But the use of "Link Layer" in the code is so convoluted that it is very confusing.

I agree.

One could implement software iWarp or IBoUDP (RoCEv2) protocols that could run over any link layer and interoperate with existing HW solutions. The stack shouldn't be dealing with the link level at all, with the exception of user space compatibility.

Quoted 3 lines

Define Transport? There has been a lot of discussion over what a transport is
in Verbs.

IMO, we should replace using the word 'transport' with just 'rdma_protocol'. And even then I'm not convinced that anything should care, beyond user space compatibility. The caps are what matter.

- Sean

#96 lore raw
Quoted 1 line

From: Hefty, Sean [mailto:[email protected]]

[snip]

Quoted 22 lines
Quoted 10 lines
Quoted 3 lines

So, I think that our "old-transport" below is just fine. No need to change it (and you aren't, since it is currently implemented

as a function).

I think there is a need to change this. Encoding the transport into the node type is not a good idea. Having different "transport semantics" while still returning the same transport for the port is confusing.

Quoted 4 lines

The only thing which is clear currently is Link Layer.

But the use of "Link Layer" in the code is so convoluted that it is very confusing.

I agree.

One could implement software iWarp or IBoUDP (RoCEv2) protocols that could run over any link layer and interoperate with existing HW solutions. The stack shouldn't be dealing with the link level at all, with the exception of user space compatibility.

Quoted 8 lines
Quoted 2 lines

Define Transport? There has been a lot of discussion over what a transport is in Verbs.

IMO, we should replace using the word 'transport' with just 'rdma_protocol'. And even then I'm not convinced that anything should care, beyond user space compatibility. The caps are what matter.

- Sean

I completely agree.
If we ever see a need for representing a set or subset of cross-layer protocols (at any level, L2-L4, various encapsulations), we will add the proper management helpers. For example:
- rdma_protocol_roce() /* both v1 and v2 */
- rdma_protocol_roce_v1()
- rdma_protocol_roce_v2()
- rdma_protocol_usnic()
- rdma_protocol_usnic_udp()

#97 lore raw
In reply to Liran Liss

Hi, Liran

Thanks for the comment :-)

On 04/22/2015 01:36 AM, Liran Liss wrote:
[snip]

Quoted 10 lines

(**) This has been extended to also encode the transport in the current code.
At least for user-space visible APIs, we might chose to leave this for backward compatibility, but we can consider cleaning up the kernel code.

So, I think that our "old-transport" below is just fine.
No need to change it (and you aren't, since it is currently implemented as a function).

The "new-transport" does not really exist, but is broken into several capability checks of the L4 transport, optionally with conditions on the link type. I would remove the table below and tell what we really want to achieve:
==> move technology-specific feature-check logic out of the (multiple!) IB code components and various ULPs into per-feature helpers.

Our purpose is to help core layer do management more clearly, rather then referring from transport and linklayer.

IMHO from management's point of view, what we really care about is whether a particular management required by device or not, rather then the details on transport and link layer.

This new transport is only understand by core-layer currently, for user-layer we still reserve the old transport for them, next step is to use bitmask instead of transport, at that time we can erase the new transport and make the whole stuff used by user-layer only :-)

Quoted 8 lines

Detailed remarks
==============

1) The introduction of cap_*_*() stuff should have been introduced directly in patch 02/27.
This back-and-forth between rdma_ib_or_iboe() and cap_* is confusing and increases the number of patches in the patch-set. Do this and remove patches 16-24.

We have some discussion about compress the patch set, merge the reform and introducing patch will mix the concept (like the earlier version), IMHO it will increase the difficulty of review...

And now since many review already been done, it's not wise to change the whole structure of patch set IMHO...

Quoted 4 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

We have some discussion on that too, use transport means going back...

Quoted 5 lines

3) The name cap_* as it is used above is not accurate.
You use it to describe technology characteristics rather than extendable capabilities. I would suggest having a single convention for all helpers, such as rdma_has_*() and rdma_is_*(). For example: cap_ib_smi() ==> rdma_has_smi().

That means going back too...

Quoted 10 lines

4) Remove all capabilities that do not introduce any distinction in the current code. We can add them as needed later.
This means remove patches:
- [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib() – all IB devices support ipoib
- [PATCH v5 24/27] IB/Verbs: Use management helper cap_af_ib() – all IB devices support AF_IB.

On the other hand:
- rdma_has_multicast() makes sense, since iWARP doesn’t support it.
- cap_ib_sa() might make sense to cut code even further in the CMA, since RoCE has a GSI but no SA.

We have discussion on define these helpers previously, again, name is not really a problem, I would rather to see such changes in the following series after this one working stably :-)

Quoted 3 lines

5) Do no modify phys_state_show() in [PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs It *is* the link layer!

Actually nothing changed after the modify, the prev purpose it to eliminate the link layer helpers.

But now we are not going to remove the helper any more, so let's drop this modification in next version :-)

Quoted 10 lines

6) Remove cap_read_multi_sge
It is not device/port feature, but a transport capability.
Use rdma_is_iwarp_transport() instead, or introduce a new transport flag in 'enum ib_device_cap_flags'.

7) Remove [PATCH v5 25/27] IB/Verbs: Use management helper cap_eth_ah(). Address handles that refer to Ethernet links always have Ethernet addressing.

In the CMA code, using rdma_tech_iboe() is just fine. This is how you define cap_eth_ah() anyway. Currently, this patch just adds clutter.

There are also some discussion on these helpers, drop them means going back..

The tech helper is not enough to explain the management purpose, and this can be the wrapper for bitmask stuff too.

Quoted 4 lines

8) Remove patch [PATCH v5 26/27] IB/Verbs: Clean up rdma_ib_or_iboe().
We do need a transport qualifier, as exemplified in comment 5) above, and for a complete clean model. This is after renaming the function to rdma_is_ib_transport()...

This means going back again... rdma_is_ib_transport() has been used previously.

This helper is just to make the review more easier, we won't need it internally, not to mention after bitmask was introduced :-)

Quoted 5 lines

Putting it all together
==================

Quoted 11 lines

We are left with the following helpers:
- rdma_is_ib_transport()
- rdma_is_iwarp_transport()
- rdma_is_usnic_transport()
- rdma_is_iboe()
- rdma_has_mad()
- rdma_has_smi()
- rdma_has_gsi() - complements smi; can be used by the mad code for clarity
- rdma_has_sa()
- rdma_has_cm()
- rdma_has_mcast()

I think we can put the discussion on name and new helpers in future, currently let's focus on these basic reform and make them working stably ;-)

Regards,
Michael Wang

Quoted 151 lines
Quoted 151 lines

Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the device/port.

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals below.

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier for extending.

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be another series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#98 lore raw
Quoted 19 lines

From: Michael Wang [mailto:[email protected]]

Hi, Liran

Thanks for the comment :-)

On 04/22/2015 01:36 AM, Liran Liss wrote:
[snip]

Quoted 2 lines

(**) This has been extended to also encode the transport in the current

code.

Quoted 1 line

At least for user-space visible APIs, we might chose to leave this for

backward compatibility, but we can consider cleaning up the kernel code.

Quoted 3 lines

So, I think that our "old-transport" below is just fine.
No need to change it (and you aren't, since it is currently implemented as a

function).

Quoted 2 lines

The "new-transport" does not really exist, but is broken into several

Quoted 9 lines

capability checks of the L4 transport, optionally with conditions on the link type.

Quoted 2 lines

I would remove the table below and tell what we really want to achieve:
==> move technology-specific feature-check logic out of the (multiple!) IB

code components and various ULPs into per-feature helpers.

Our purpose is to help core layer do management more clearly, rather then referring from transport and linklayer.

Right.

Quoted 4 lines

IMHO from management's point of view, what we really care about is whether a particular management required by device or not, rather then the details on transport and link layer.

Depends on who is "we".
For ULPs, you are probably right.

However, core services (e.g., mad management, CM, SA) do care about various details. In some cases, where it doesn't matter, this code will use management helpers. In other cases, this code will inspect link, transport, and node attributes of rdma devices.

For example, the CM code has specific code paths for IB, RoCE, and iWARP. There is no other CM code; there is no reason to abstract 'CM'. This code will have code paths that depend on various specific details.

Quoted 5 lines

This new transport is only understand by core-layer currently, for user-layer we still reserve the old transport for them, next step is to use bitmask instead of transport, at that time we can erase the new transport and make the whole stuff used by user-layer only :-)

I am not sure that we need a bit mask at all.
Your helpers already provide all the useful abstractions, which both core and ULPs call directly. All the information is inferred directly from <link, transport, node> tuples.

Some of the user-space tools need *exactly* the same reasoning.
For example, management tools manage specific technologies and protocols, not some abstraction.

So, For user-space, we can think about exposing exactly the same helper framework, while providing backward compatibility for the existing interfaces.

Quoted 9 lines
Quoted 6 lines

Detailed remarks
==============

1) The introduction of cap_*_*() stuff should have been introduced directly

in patch 02/27.

Quoted 1 line

This back-and-forth between rdma_ib_or_iboe() and cap_* is confusing and

increases the number of patches in the patch-set.

Quoted 9 lines
Quoted 1 line

Do this and remove patches 16-24.

We have some discussion about compress the patch set, merge the reform and introducing patch will mix the concept (like the earlier version), IMHO it will increase the difficulty of review...

And now since many review already been done, it's not wise to change the whole structure of patch set IMHO...

I think it is because you are conditioning code on one thing, and then conditioning the same code on another thing.

This is confusing.

Once we get our abstractions correct (i.e., the right helper functions), you replace the existing logic with the suitable helper up-front.

Quoted 7 lines
Quoted 4 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

We have some discussion on that too, use transport means going back...

No.
The existing notion of transport was correct. It was the node type that wasn't. And in any case the new helpers didn't use it.

We need the original meaning of transport - see my response to Ira. I propose replacing rdma_node_get_transport() with the following helpers:
- rdma_get_transport()
- rdma_is_ib_transport()
- rdma_is_iwarp_transport()
- ...

Quoted 9 lines
Quoted 3 lines

3) The name cap_* as it is used above is not accurate.
You use it to describe technology characteristics rather than extendable

capabilities.

Quoted 1 line

I would suggest having a single convention for all helpers, such as

rdma_has_*() and rdma_is_*().

Quoted 1 line

For example: cap_ib_smi() ==> rdma_has_smi().

That means going back too...

See response to Ira (https://lkml.org/lkml/2015/4/21/951).

Quoted 11 lines
Quoted 3 lines

4) Remove all capabilities that do not introduce any distinction in the

current code.

Quoted 5 lines

We can add them as needed later.
This means remove patches:
- [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib() – all IB devices support ipoib
- [PATCH v5 24/27] IB/Verbs: Use management helper cap_af_ib() – all IB

devices support AF_IB.

Quoted 1 line
Quoted 9 lines
Quoted 3 lines

On the other hand:
- rdma_has_multicast() makes sense, since iWARP doesn’t support it.
- cap_ib_sa() might make sense to cut code even further in the CMA, since

RoCE has a GSI but no SA.

We have discussion on define these helpers previously, again, name is not really a problem, I would rather to see such changes in the following series after this one working stably :-)

The names are not critical. This comment is about introducing helpers that are do not introduce any new semantic notion in the current patch-set.

cap_ipoib(), for example, is brain-dead because only a single technology (as of now) enables it: Infiniband.

Quoted 10 lines
Quoted 3 lines

5) Do no modify phys_state_show() in [PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs It *is* the link layer!

Actually nothing changed after the modify, the prev purpose it to eliminate the link layer helpers.

But now we are not going to remove the helper any more, so let's drop this modification in next version :-)

You don't add modifications just to drop them later. Don't add them in the first place!

This patch-set will remain forever in the kernel commit log - we want it to be as self-explaining and coherent as possible.

Remove this.

Quoted 9 lines
Quoted 4 lines

6) Remove cap_read_multi_sge
It is not device/port feature, but a transport capability.
Use rdma_is_iwarp_transport() instead, or introduce a new transport flag in

'enum ib_device_cap_flags'.

Quoted 2 lines

7) Remove [PATCH v5 25/27] IB/Verbs: Use management helper

cap_eth_ah().

Quoted 1 line

Address handles that refer to Ethernet links always have Ethernet

Quoted 9 lines

addressing.

Quoted 2 lines

In the CMA code, using rdma_tech_iboe() is just fine. This is how you define

cap_eth_ah() anyway.

Quoted 1 line

Currently, this patch just adds clutter.

There are also some discussion on these helpers, drop them means going back..

Back to where? Management helpers are a new concept. Let's get them right.

Quoted 3 lines

The tech helper is not enough to explain the management purpose, and this can be the wrapper for bitmask stuff too.

As I said, I am not sure that we will need any bitmasks. Also see response to Ira (https://lkml.org/lkml/2015/4/21/951).

Quoted 12 lines
Quoted 3 lines

8) Remove patch [PATCH v5 26/27] IB/Verbs: Clean up rdma_ib_or_iboe(). We do need a transport qualifier, as exemplified in comment 5) above, and

for a complete clean model.

Quoted 1 line

This is after renaming the function to rdma_is_ib_transport()...

This means going back again... rdma_is_ib_transport() has been used previously.

This helper is just to make the review more easier, we won't need it internally, not to mention after bitmask was introduced :-)

The same...

Quoted 18 lines
Quoted 5 lines

Putting it all together
==================

Quoted 12 lines

We are left with the following helpers:
- rdma_is_ib_transport()
- rdma_is_iwarp_transport()
- rdma_is_usnic_transport()
- rdma_is_iboe()
- rdma_has_mad()
- rdma_has_smi()
- rdma_has_gsi() - complements smi; can be used by the mad code for clarity
- rdma_has_sa()
- rdma_has_cm()
- rdma_has_mcast()

Quoted 2 lines

I think we can put the discussion on name and new helpers in future, currently let's focus on these basic reform and make them working stably ;-)

It's not just the names, it's their semantics.
Any problems with the names proposed above?

Quoted 163 lines

Regards,
Michael Wang

Quoted 12 lines
Quoted 12 lines

Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

Quoted 3 lines
Quoted 3 lines

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the

device/port.

Quoted 3 lines
Quoted 3 lines

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals

below.

Quoted 21 lines
Quoted 21 lines

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB
Quoted 8 lines
Quoted 8 lines

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier

for extending.

Quoted 10 lines
Quoted 10 lines

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be
invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have

these

Quoted 6 lines
Quoted 6 lines

HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be

another

Quoted 3 lines
Quoted 3 lines

series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing

for

Quoted 1 line
Quoted 1 line

staging, I'd like to suggest we focus on improving existed helpers and

push

Quoted 85 lines
Quoted 85 lines

all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#99 lore raw

On 04/22/2015 06:16 PM, Liran Liss wrote:
[snip]

Quoted 11 lines

Depends on who is "we".
For ULPs, you are probably right.

However, core services (e.g., mad management, CM, SA) do care about various details. In some cases, where it doesn't matter, this code will use management helpers. In other cases, this code will inspect link, transport, and node attributes of rdma devices.

For example, the CM code has specific code paths for IB, RoCE, and iWARP. There is no other CM code; there is no reason to abstract 'CM'. This code will have code paths that depend on various specific details.

That's exactly what we want to stop, we have classified the CM to IB and IWARP now :-)

Quoted 11 lines
Quoted 6 lines

This new transport is only understand by core-layer currently, for user-layer we still reserve the old transport for them, next step is to use bitmask instead of transport, at that time we can erase the new transport and make the whole stuff used by user-layer only :-)

I am not sure that we need a bit mask at all.
Your helpers already provide all the useful abstractions, which both core and ULPs call directly. All the information is inferred directly from <link, transport, node> tuples.

Quoted 5 lines

Some of the user-space tools need *exactly* the same reasoning.
For example, management tools manage specific technologies and protocols, not some abstraction.

So, For user-space, we can think about exposing exactly the same helper framework, while providing backward compatibility for the existing interfaces.

I'd really like to put the topic on bitmask and user app reform into different thread...

bitmask should be next topic, there are many discussion already, but I could imaging far more discussion there, the user reform should be the last step, after every thing in kernel settled down :-)

Quoted 20 lines
Quoted 10 lines
Quoted 7 lines

Detailed remarks
==============

1) The introduction of cap_*_*() stuff should have been introduced directly

in patch 02/27.

Quoted 1 line

This back-and-forth between rdma_ib_or_iboe() and cap_* is confusing and

increases the number of patches in the patch-set.

Quoted 9 lines
Quoted 1 line

Do this and remove patches 16-24.

We have some discussion about compress the patch set, merge the reform and introducing patch will mix the concept (like the earlier version), IMHO it will increase the difficulty of review...

And now since many review already been done, it's not wise to change the whole structure of patch set IMHO...

Quoted 7 lines

I think it is because you are conditioning code on one thing, and then conditioning the same code on another thing.

This is confusing.

Once we get our abstractions correct (i.e., the right helper functions), you replace the existing logic with the suitable helper up-front.

We need to classify and integrate the concept into mgmt helper, that would be very helpful for further reform, reform followed by integration sounds not that bad, correct?

Quoted 13 lines
Quoted 8 lines
Quoted 5 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

We have some discussion on that too, use transport means going back...

No.
The existing notion of transport was correct. It was the node type that wasn't. And in any case the new helpers didn't use it.

Quoted 5 lines

We need the original meaning of transport - see my response to Ira. I propose replacing rdma_node_get_transport() with the following helpers:
- rdma_get_transport()
- rdma_is_ib_transport()
- rdma_is_iwarp_transport()

We can change the name at anytime, tech/transport/protocol/standard, just one patch later can easily change it and start the topic of naming, any of these name will unsatisfied someone AFAIK, I'd like to suggest we consider this as a mark temporarily and focus on the logical issue.

Quoted 36 lines

- ...

Quoted 9 lines
Quoted 3 lines

3) The name cap_* as it is used above is not accurate.
You use it to describe technology characteristics rather than extendable

capabilities.

Quoted 1 line

I would suggest having a single convention for all helpers, such as

rdma_has_*() and rdma_is_*().

Quoted 1 line

For example: cap_ib_smi() ==> rdma_has_smi().

That means going back too...

See response to Ira (https://lkml.org/lkml/2015/4/21/951).

Quoted 11 lines
Quoted 3 lines

4) Remove all capabilities that do not introduce any distinction in the

current code.

Quoted 5 lines

We can add them as needed later.
This means remove patches:
- [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib() – all IB devices support ipoib
- [PATCH v5 24/27] IB/Verbs: Use management helper cap_af_ib() – all IB

devices support AF_IB.

Quoted 1 line
Quoted 9 lines
Quoted 3 lines

On the other hand:
- rdma_has_multicast() makes sense, since iWARP doesn’t support it.
- cap_ib_sa() might make sense to cut code even further in the CMA, since

RoCE has a GSI but no SA.

We have discussion on define these helpers previously, again, name is not really a problem, I would rather to see such changes in the following series after this one working stably :-)

Quoted 5 lines

The names are not critical. This comment is about introducing helpers that are do not introduce any new semantic notion in the current patch-set.

cap_ipoib(), for example, is brain-dead because only a single technology (as of now) enables it: Infiniband.

This will be dropped in next version :-)

Quoted 12 lines
Quoted 11 lines
Quoted 4 lines

5) Do no modify phys_state_show() in [PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs It *is* the link layer!

Actually nothing changed after the modify, the prev purpose it to eliminate the link layer helpers.

But now we are not going to remove the helper any more, so let's drop this modification in next version :-)

Quoted 7 lines

You don't add modifications just to drop them later. Don't add them in the first place!

This patch-set will remain forever in the kernel commit log - we want it to be as self-explaining and coherent as possible.

Remove this.

What i mean is this will be removed in v6...

Quoted 13 lines
Quoted 13 lines
Quoted 5 lines

6) Remove cap_read_multi_sge
It is not device/port feature, but a transport capability.
Use rdma_is_iwarp_transport() instead, or introduce a new transport flag in

'enum ib_device_cap_flags'.

Quoted 2 lines

7) Remove [PATCH v5 25/27] IB/Verbs: Use management helper

cap_eth_ah().

Quoted 1 line

Address handles that refer to Ethernet links always have Ethernet

addressing.

Quoted 2 lines

In the CMA code, using rdma_tech_iboe() is just fine. This is how you define

Quoted 8 lines
Quoted 6 lines

cap_eth_ah() anyway.

Quoted 1 line

Currently, this patch just adds clutter.

There are also some discussion on these helpers, drop them means going back..

Back to where? Management helpers are a new concept. Let's get them right.

Back to one point during v1~v5.

Quoted 7 lines
Quoted 4 lines

The tech helper is not enough to explain the management purpose, and this can be the wrapper for bitmask stuff too.

As I said, I am not sure that we will need any bitmasks. Also see response to Ira (https://lkml.org/lkml/2015/4/21/951).

Better discussed in another thread.

Quoted 34 lines
Quoted 4 lines
Quoted 4 lines

8) Remove patch [PATCH v5 26/27] IB/Verbs: Clean up rdma_ib_or_iboe(). We do need a transport qualifier, as exemplified in comment 5) above, and

Quoted 9 lines

for a complete clean model.

Quoted 1 line

This is after renaming the function to rdma_is_ib_transport()...

This means going back again... rdma_is_ib_transport() has been used previously.

This helper is just to make the review more easier, we won't need it internally, not to mention after bitmask was introduced :-)

The same...

Quoted 18 lines
Quoted 17 lines

Putting it all together
==================

We are left with the following helpers:
- rdma_is_ib_transport()
- rdma_is_iwarp_transport()
- rdma_is_usnic_transport()
- rdma_is_iboe()
- rdma_has_mad()
- rdma_has_smi()
- rdma_has_gsi() - complements smi; can be used by the mad code for clarity
- rdma_has_sa()
- rdma_has_cm()
- rdma_has_mcast()

Quoted 5 lines
Quoted 2 lines

I think we can put the discussion on name and new helpers in future, currently let's focus on these basic reform and make them working stably ;-)

It's not just the names, it's their semantics.
Any problems with the names proposed above?

These were once used in old version, again, name can't satisfied anyone at this moment and I'd like to discuss this after the logical was right, I really don't want folks to focus on this issue since it won't broken anything and can be easily changed once we have the agreement.

Regards,
Michael Wang

Quoted 164 lines
Quoted 164 lines

Regards,
Michael Wang

Quoted 12 lines
Quoted 12 lines

Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

Quoted 3 lines
Quoted 3 lines

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the

device/port.

Quoted 3 lines
Quoted 3 lines

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals

below.

Quoted 21 lines
Quoted 21 lines

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB
Quoted 8 lines
Quoted 8 lines

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier

for extending.

Quoted 10 lines
Quoted 10 lines

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be
invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have

these

Quoted 6 lines
Quoted 6 lines

HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be

another

Quoted 3 lines
Quoted 3 lines

series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing

for

Quoted 1 line
Quoted 1 line

staging, I'd like to suggest we focus on improving existed helpers and

push

Quoted 85 lines
Quoted 85 lines

all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#100 lore raw

PiBGcm9tOiBNaWNoYWVsIFdhbmcgW21haWx0bzp5dW4ud2FuZ0Bwcm9maXRicmlja3MuY29tXQ0K DQoNCj4gW3NuaXBdDQo+ID4NCj4gPiBEZXBlbmRzIG9uIHdobyBpcyAid2UiLg0KPiA+IEZvciBV TFBzLCB5b3UgYXJlIHByb2JhYmx5IHJpZ2h0Lg0KPiA+DQo+ID4gSG93ZXZlciwgY29yZSBzZXJ2 aWNlcyAoZS5nLiwgbWFkIG1hbmFnZW1lbnQsIENNLCBTQSkgZG8gY2FyZSBhYm91dA0KPiB2YXJp b3VzIGRldGFpbHMuDQo+ID4gSW4gc29tZSBjYXNlcywgd2hlcmUgaXQgZG9lc24ndCBtYXR0ZXIs IHRoaXMgY29kZSB3aWxsIHVzZSBtYW5hZ2VtZW50DQo+IGhlbHBlcnMuDQ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+Pj4+ICBkcml2ZXJzL2luZmluaWJhbmQvaHcvdXNuaWMvdXNuaWNf aWJfdmVyYnMuYyB8ICAgIDYNCj4gPj4+PiAgZHJpdmVycy9pbmZpbmliYW5kL2h3L3VzbmljL3Vz bmljX2liX3ZlcmJzLmggfCAgICAyDQo+ID4+Pj4gIGRyaXZlcnMvaW5maW5pYmFuZC91bHAvaXBv aWIvaXBvaWJfbWFpbi5jICAgIHwgICAxNyAtDQo+ID4+Pj4gIGluY2x1ZGUvcmRtYS9pYl92ZXJi cy5oICAgICAgICAgICAgICAgICAgICAgIHwgIDIwNCArKysrKysrKysrKysrKystDQo+ID4+Pj4g IG5ldC9zdW5ycGMveHBydHJkbWEvc3ZjX3JkbWFfcmVjdmZyb20uYyAgICAgIHwgICAgNg0KPiA+ Pj4+ICBuZXQvc3VucnBjL3hwcnRyZG1hL3N2Y19yZG1hX3RyYW5zcG9ydC5jICAgICB8ICAgNTEg Ky0tLQ0KPiA+Pj4+ICAzNSBmaWxlcyBjaGFuZ2VkLCA1ODQgaW5zZXJ0aW9ucygrKSwgMzY4IGRl bGV0aW9ucygtKQ0KPiA+Pj4+IC0tDQo+ID4+Pj4gVG8gdW5zdWJzY3JpYmUgZnJvbSB0aGlzIGxp c3Q6IHNlbmQgdGhlIGxpbmUgInVuc3Vic2NyaWJlIGxpbnV4LXJkbWEiDQo+ID4+Pj4gaW4gdGhl IGJvZHkgb2YgYSBtZXNzYWdlIHRvIG1ham9yZG9tb0B2Z2VyLmtlcm5lbC5vcmcgTW9yZQ0KPiA+ Pj4+IG1ham9yZG9tbyBpbmZvIGF0IGh0dHA6Ly92Z2VyLmtlcm5lbC5vcmcvbWFqb3Jkb21vLWlu Zm8uaHRtbA0K
--
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

#101 lore raw
Quoted 4 lines · Liran Liss
Quoted 4 lines

From: Michael Wang [mailto:[email protected]]

[snip]

[snip]

Quoted 11 lines
Quoted 1 line

We don't want to stop code branches that are not abstractions but rather depend on the specific technology!
There is no generic "iWARP CM" - only one.
There is no generic "ROCE CM" - only one.
There is no generic "IB CM" - only one.

At the CM high-level (i.e., whether an ib_dev port registers an IB client), you could consider an rdma_has_cm() call, but this the only place in the code that this check will be called! Hence, no need for a generic check.

There is plenty of places to check IB or IWARP CM in cma, that is 18# and 19#.

And the purpose is to make sure core-layer check the right thing rather than the 'tech' or 'transport', even if there is only one use case, as long as it meaningful, a helper would make sense IMHO, so later when comes other cases we could use the helpers rather than the meaningless tech check.

Quoted 2 lines

You want to stop abstract code that uses IB core infrastructure.

We want the check on management make more sense :-)

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

This new transport is only understand by core-layer currently, for user-layer we still reserve the old transport for them, next step is to use bitmask instead of transport, at that time we can erase the new transport and make the whole stuff used by user-layer only :-)

[snip]

Quoted 7 lines
Quoted 4 lines

We need to classify and integrate the concept into mgmt helper, that would be very helpful for further reform, reform followed by integration sounds not that bad, correct?

The problem is that it is hard to follow the reasoning for the first use consumer code with the in-complete helper frame-work.

The problem is, with the current implementation in core layer, expanding to new tech would be painful, the reform would come into core directly, which make the logical even more confusing.

This patch set aim to collect all those places where a management check necessary and integrate them together, this is the reform on core-layer so later we don't have to change core but replace the internal implementation of helpers, eg the idea of bitmask.

Quoted 26 lines
Quoted 21 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

Quoted 5 lines
Quoted 2 lines

We have some discussion on that too, use transport means going back...

No.
The existing notion of transport was correct. It was the node type that

wasn't.

Quoted 7 lines

And in any case the new helpers didn't use it.

We need the original meaning of transport - see my response to Ira. I propose replacing rdma_node_get_transport() with the following helpers:
- rdma_get_transport()
- rdma_is_ib_transport()
- rdma_is_iwarp_transport()

Quoted 4 lines

We can change the name at anytime, tech/transport/protocol/standard, just one patch later can easily change it and start the topic of naming, any of these name will unsatisfied someone AFAIK, I'd like to suggest we consider this as a mark temporarily and focus on the logical issue.

Quoted 8 lines

Sure.

The logical issue is:

1. We need the existing notion of transport, meaning "a bunch of L4+headers + semantics presented to apps".
2. We might need an *additional* notion of "rdma_protocol", which designates a complete wire-format: L2-L4+ including. This could be later a bitmask, a management helper, whatever.
Currently, I don't see anything in the existing code that would call such helpers.

My thought is mostly focus on the core-layer, so the name won't satisfied someone focus on hw or user app, but as long as the reform won't break anything, I prefer to leave the naming to those who more expert on that particular part, after this first step :-)

Regards,
Michael Wang

Quoted 156 lines
Quoted 156 lines
Quoted 42 lines

- ...

Quoted 10 lines
Quoted 4 lines

3) The name cap_* as it is used above is not accurate. You use it to describe technology characteristics rather than extendable

capabilities.

Quoted 1 line

I would suggest having a single convention for all helpers, such as

rdma_has_*() and rdma_is_*().

Quoted 1 line

For example: cap_ib_smi() ==> rdma_has_smi().

That means going back too...

See response to Ira (https://lkml.org/lkml/2015/4/21/951).

Quoted 17 lines
Quoted 4 lines

4) Remove all capabilities that do not introduce any distinction in the

current code.

Quoted 6 lines

We can add them as needed later.
This means remove patches:
- [PATCH v5 22/27] IB/Verbs: Use management helper cap_ipoib() – all IB devices support ipoib
- [PATCH v5 24/27] IB/Verbs: Use management helper cap_af_ib() – all IB

devices support AF_IB.

Quoted 5 lines

On the other hand:
- rdma_has_multicast() makes sense, since iWARP doesn’t support it.
- cap_ib_sa() might make sense to cut code even further in the CMA, since

Quoted 6 lines

RoCE has a GSI but no SA.

We have discussion on define these helpers previously, again, name is not really a problem, I would rather to see such changes in the following series after this one working stably :-)

Quoted 5 lines

The names are not critical. This comment is about introducing helpers that are do not introduce any new semantic notion in the current patch-set.

cap_ipoib(), for example, is brain-dead because only a single technology (as of now) enables it: Infiniband.

This will be dropped in next version :-)

Quoted 12 lines
Quoted 11 lines
Quoted 4 lines

5) Do no modify phys_state_show() in [PATCH v5 09/27] IB/Verbs:
Reform IB-core verbs/uverbs_cmd/sysfs It *is* the link layer!

Actually nothing changed after the modify, the prev purpose it to eliminate the link layer helpers.

But now we are not going to remove the helper any more, so let's drop this modification in next version :-)

Quoted 7 lines

You don't add modifications just to drop them later. Don't add them in the first place!

This patch-set will remain forever in the kernel commit log - we want it to be as self-explaining and coherent as possible.

Remove this.

What i mean is this will be removed in v6...

Quoted 15 lines
Quoted 15 lines
Quoted 6 lines

6) Remove cap_read_multi_sge
It is not device/port feature, but a transport capability. Use rdma_is_iwarp_transport() instead, or introduce a new transport flag in

'enum ib_device_cap_flags'.

Quoted 2 lines

7) Remove [PATCH v5 25/27] IB/Verbs: Use management helper

cap_eth_ah().

Quoted 1 line

Address handles that refer to Ethernet links always have Ethernet

addressing.

Quoted 3 lines

In the CMA code, using rdma_tech_iboe() is just fine. This is how you define

Quoted 8 lines
Quoted 6 lines

cap_eth_ah() anyway.

Quoted 1 line

Currently, this patch just adds clutter.

There are also some discussion on these helpers, drop them means going back..

Back to where? Management helpers are a new concept. Let's get them

right.

Back to one point during v1~v5.

Quoted 7 lines
Quoted 4 lines

The tech helper is not enough to explain the management purpose, and this can be the wrapper for bitmask stuff too.

As I said, I am not sure that we will need any bitmasks. Also see response to Ira (https://lkml.org/lkml/2015/4/21/951).

Better discussed in another thread.

Quoted 35 lines
Quoted 5 lines
Quoted 5 lines

8) Remove patch [PATCH v5 26/27] IB/Verbs: Clean up rdma_ib_or_iboe(). We do need a transport qualifier, as exemplified in comment 5) above, and

Quoted 9 lines

for a complete clean model.

Quoted 1 line

This is after renaming the function to rdma_is_ib_transport()...

This means going back again... rdma_is_ib_transport() has been used previously.

This helper is just to make the review more easier, we won't need it internally, not to mention after bitmask was introduced :-)

The same...

Quoted 18 lines
Quoted 17 lines

Putting it all together
==================

We are left with the following helpers:
- rdma_is_ib_transport()
- rdma_is_iwarp_transport()
- rdma_is_usnic_transport()
- rdma_is_iboe()
- rdma_has_mad()
- rdma_has_smi()
- rdma_has_gsi() - complements smi; can be used by the mad code for clarity
- rdma_has_sa()
- rdma_has_cm()
- rdma_has_mcast()

Quoted 6 lines
Quoted 3 lines

I think we can put the discussion on name and new helpers in future, currently let's focus on these basic reform and make them working stably ;-)

It's not just the names, it's their semantics.
Any problems with the names proposed above?

These were once used in old version, again, name can't satisfied anyone at this moment and I'd like to discuss this after the logical was right, I really don't want folks to focus on this issue since it won't broken anything and can be easily changed once we have the agreement.

Quoted 177 lines
Quoted 3 lines

Regards,
Michael Wang

OK

Quoted 171 lines
Quoted 27 lines
Quoted 27 lines

Regards,
Michael Wang

Quoted 12 lines
Quoted 12 lines

Subject: [PATCH v5 00/27] IB/Verbs: IB Management Helpers

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

Quoted 4 lines
Quoted 4 lines

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the

device/port.

Quoted 3 lines
Quoted 3 lines

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals

below.

Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP

IWARP

Quoted 135 lines
Quoted 135 lines
Quoted 16 lines
Quoted 16 lines

amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB

For example:

	if (transport == IB) && (link-layer == ETH) will now become:
	if (query_transport() == IBOE)
Quoted 5 lines
Quoted 5 lines

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier

for extending.

Quoted 11 lines
Quoted 11 lines

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be
invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who
have

these

Quoted 7 lines
Quoted 7 lines

HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to
be

another

Quoted 4 lines
Quoted 4 lines

series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good
timing

for

Quoted 2 lines
Quoted 2 lines

staging, I'd like to suggest we focus on improving existed
helpers and

push

Quoted 85 lines
Quoted 85 lines

all the further reforms into next series ;-)

Proposals:
Sean:
https://www.mail-archive.com/linux-
[email protected]/msg23339.html
Doug:
https://www.mail-archive.com/linux-
[email protected]/msg23418.html
https://www.mail-archive.com/linux-
[email protected]/msg23765.html
Jason:
https://www.mail-archive.com/linux-
[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8
 drivers/infiniband/core/ucm.c                |    5
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7
 drivers/infiniband/hw/cxgb4/provider.c       |    7
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3
 drivers/infiniband/hw/ehca/ehca_main.c       |    1
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7
 drivers/infiniband/hw/mlx4/main.c            |   10
 drivers/infiniband/hw/mlx5/main.c            |    7
 drivers/infiniband/hw/mthca/mthca_provider.c |    7
 drivers/infiniband/hw/nes/nes_verbs.c        |    6
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3
 drivers/infiniband/hw/qib/qib_verbs.c        |    7
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)

--
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

#102 lore raw
In reply to Liran Liss
Quoted 23 lines · Liran Liss
Quoted 13 lines

From: Michael Wang [mailto:[email protected]]

[snip]

Quoted 5 lines

Depends on who is "we".
For ULPs, you are probably right.

However, core services (e.g., mad management, CM, SA) do care about

various details.

Quoted 1 line

In some cases, where it doesn't matter, this code will use management

helpers.

Quoted 1 line

In other cases, this code will inspect link, transport, and node attributes of

Quoted 9 lines

rdma devices.

Quoted 4 lines

For example, the CM code has specific code paths for IB, RoCE, and iWARP. There is no other CM code; there is no reason to abstract 'CM'. This code will have code paths that depend on various specific details.

That's exactly what we want to stop, we have classified the CM to IB and IWARP now :-)

Quoted 5 lines

We don't want to stop code branches that are not abstractions but rather depend on the specific technology!
There is no generic "iWARP CM" - only one.
There is no generic "ROCE CM" - only one.
There is no generic "IB CM" - only one.

How can you say this? Or perhaps I don't understand what you mean.

While conceptually one could say that each technology has its own "CM" we are trying to have the same module (and code) implement them all (ie a generic CM for a node). Therefore, the CM code _is_ generic. As is the MAD code. This is the reason we have this problem. We are trying to reuse those modules for multiple technologies.

Quoted 6 lines

At the CM high-level (i.e., whether an ib_dev port registers an IB client), you could consider an rdma_has_cm() call, but this the only place in the code that this check will be called! Hence, no need for a generic check.

You want to stop abstract code that uses IB core infrastructure.

Not sure what you mean here?

Ira

#103 lore raw
In reply to Liran Liss
Quoted 45 lines · Liran Liss

Hi Michael,

The spirit of this patch-set is great, but I think that we need to clarify some concepts. Since this will affect the whole patch-set, I am laying out my concerns here instead.

A suggestion for the resulting management helpers is given below. I believe the result would be much more coherent. --Liran

In general
========

An ib_dev (or a port of) should be distinguished by 3 qualifiers:
- The link layer:
-- Ethernet (shared by iWARP, USNIC, and ROCE)
-- Infiniband

- The transport (*)
-- IBTA transport (shared by IB and ROCE)
-- iWARP transport
-- USNIC transport

(*) Transport means both:
- The L4 wire protocols (e.g., BTH+ headers of IBTA, optionally encapsulated by UDP in ROCEv2, or the iWARP stack)
- The transport semantics (for example, there are slight semantic differences between IBTA and iWARP)

- The node type (**)
-- CA
-- Switch
-- Router

(**) This has been extended to also encode the transport in the current code.
At least for user-space visible APIs, we might chose to leave this for backward compatibility, but we can consider cleaning up the kernel code.

So, I think that our "old-transport" below is just fine.
No need to change it (and you aren't, since it is currently implemented as a function).

The "new-transport" does not really exist, but is broken into several capability checks of the L4 transport, optionally with conditions on the link type. I would remove the table below and tell what we really want to achieve:
==> move technology-specific feature-check logic out of the (multiple!) IB code components and various ULPs into per-feature helpers.

Detailed remarks
==============

Quoted 7 lines

1) The introduction of cap_*_*() stuff should have been introduced directly in patch 02/27.
This back-and-forth between rdma_ib_or_iboe() and cap_* is confusing and increases the number of patches in the patch-set. Do this and remove patches 16-24.

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

I especially want to second this. I haven't really been happy with the rdma_tech_* names at all.

Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD
#104 lore raw
Quoted 6 lines · Doug Ledford
Quoted 3 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

I especially want to second this. I haven't really been happy with the rdma_tech_* names at all.

I'm not excited about the names either..

cap_ is bad because it pollutes the global namespace.

rdma_tech_ .. as used, this is selecting the standard the port implements. The word 'standard' is a better choice than 'transport', and 'technology' is often synonymous with 'standard'. Meh.

I've said it already, but this patch set has probably gotten too big. If we could just do the cap conversion without messing with other stuff, or adding rdma_tech, that would really be the best.

Nobody seems to like the rdma_tech parts of this series.

I'd also drop '[PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs' - that is UAPI stuff, it could be done as a followup someday, not worth the risk right now.

Jason

#105 lore raw
Quoted 21 lines · Jason Gunthorpe
Quoted 6 lines · Doug Ledford
Quoted 3 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

I especially want to second this. I haven't really been happy with the rdma_tech_* names at all.

I'm not excited about the names either..

cap_ is bad because it pollutes the global namespace.

rdma_tech_ .. as used, this is selecting the standard the port implements. The word 'standard' is a better choice than 'transport', and 'technology' is often synonymous with 'standard'. Meh.

I've said it already, but this patch set has probably gotten too big. If we could just do the cap conversion without messing with other stuff, or adding rdma_tech, that would really be the best.

Quoted 5 lines

Nobody seems to like the rdma_tech parts of this series.

I'd also drop '[PATCH v5 09/27] IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs' - that is UAPI stuff, it could be done as a followup someday, not worth the risk right now.

There won't be risk... the logical is clear that they will return the same result, but I'll drop the modification on link_layer_show() and ib_uverbs_query_port() anyway, since they are just try to get the link-layer type and we are not going to erase that helper anymore.

Regards,
Michael Wang

Quoted 3 lines

Jason

#106 lore raw
In reply to Doug Ledford
Quoted 1 line · Doug Ledford

On Tue, 2015-04-21 at 23:36 +0000, Liran Liss wrote:

[snip]

Quoted 8 lines
Quoted 4 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

I especially want to second this. I haven't really been happy with the rdma_tech_* names at all.

I am sure Michael is open to alternative names. I know I am. The problem is that we can't figure out what "IBoE" is. It is not a transport, even though query_transport is now returning it as one. :-P

I think the idea behind the "tech" name was that it is a technology "family". I can't think of a better name.

Ira

--
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

#107 lore raw
Quoted 10 lines · ira.weiny
Quoted 1 line · Doug Ledford

On Tue, 2015-04-21 at 23:36 +0000, Liran Liss wrote:

[snip]

Quoted 5 lines
Quoted 4 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

Quoted 7 lines
Quoted 3 lines

I especially want to second this. I haven't really been happy with the rdma_tech_* names at all.

I am sure Michael is open to alternative names. I know I am. The problem is that we can't figure out what "IBoE" is. It is not a transport, even though query_transport is now returning it as one. :-P

Exactly :-P

Quoted 3 lines

I think the idea behind the "tech" name was that it is a technology "family". I can't think of a better name.

IMHO a single patch to change the name and collecting all the discussion in that thread would be better.

The discussion in this thread already starting to be scattered, like discussion on bitmask would be better in a thread dedicated on that purpose, otherwise we have to collect all these scattered discussions again when the bitmask series come out...

Regards,
Michael Wang

Quoted 3 lines

Ira

A message that is not in the archive (sent off-list or not yet received): DB4PR05MB08630282DEFFFB181A525B67B1EC0@DB4PR05MB0863.eurprd05.prod.outlook.com

#109 lore raw
Quoted 17 lines · Liran Liss
Quoted 8 lines

From: ira.weiny [mailto:[email protected]] [snip]

Quoted 5 lines
Quoted 4 lines

2)The name rdma_tech_* is lame.
rdma_transport_*(), adhering to the above (*) remark, is much better. For example, both IB and ROCE *do* use the same transport.

Quoted 8 lines
Quoted 4 lines

I especially want to second this. I haven't really been happy with the
rdma_tech_* names at all.

I am sure Michael is open to alternative names. I know I am. The problem is that we can't figure out what "IBoE" is. It is not a transport, even though query_transport is now returning it as one. :-P

Quoted 8 lines

IBOE is used in part of the kernel symbols that refer to RoCE. That's it. ROCE HCA links have the following characteristics:
- Ethernet link layer
- IB transport
- CA node type

And, if needed in the future:
- ROCEv1 and ROCEv2 protocol stacks

Let me rephrase that[*].

We don't know what to "call" "IBoE" vs "IBoIB" vs "iWarp Verbs over iWarp" vs "IBoOPA", etc.

The problem with your argument (no matter what name we use, "Transport", "tech", "protocol") etc is that support for various features are implied rather than explicit.

Your argument that RoCE is just "IB transport" over Ethernet (while technically correct) is not relevant for the problem we are trying to solve.

The ib_mad, ib_cm, rdma_cm, and ib_sa modules are attempting to support many different device type (on a port basis). The functionality they provide is dependent on so much more that the notion of "transport" and "link layer".

The purpose of this patch series was to create the specific helper functions based on the support the core modules need to explicitly determine what they should do for a port. Furthermore, the implementation of those features was to be based on the current implementation (which happens to use the transport and link layer) to ensure we don't break everything.

Once we could agree on items like the feature set and the names of the helper calls we could then alter the implementation to remove the implied nature of this support.

Quoted 4 lines
Quoted 4 lines

I think the idea behind the "tech" name was that it is a technology "family". I can't think of a better name.

I see "protocol" and "specification" being discussed. Those are probably decent.

Ira

[*] We all know what RoCE (IBoE) _is_...
--
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

#110 lore raw
In reply to Liran Liss
Quoted 9 lines · Liran Liss

An ib_dev (or a port of) should be distinguished by 3 qualifiers:
- The link layer:
-- Ethernet (shared by iWARP, USNIC, and ROCE)
-- Infiniband

- The transport (*)
-- IBTA transport (shared by IB and ROCE)
-- iWARP transport
-- USNIC transport

I haven't been following this discussion as closely as I could have, but I want to clarify something about usNIC. There are two "transports" used by usNIC:

1. The legacy RDMA_TRANSPORT_USNIC type, which indicates usNIC traffic will be Ethernet frames with Ethertype==0x8915 (like RoCE) but containing a custom, non-IBTA-sanctioned header format instead of a full GRH. This "transport" is still supported by the usnic_verbs kernel driver but in practice is no longer in use. For this "transport" there isn't really any clear L3/L4 header to point to.

2. The current RDMA_TRANSPORT_USNIC_UDP type, which indicates usNIC traffic will be standard UDP/IP/Ethernet packets.

Quoted 3 lines

(*) Transport means both:
- The L4 wire protocols (e.g., BTH+ headers of IBTA, optionally encapsulated by UDP in ROCEv2, or the iWARP stack)
- The transport semantics (for example, there are slight semantic differences between IBTA and iWARP)

No usNIC hardware or software currently performs any hardware offload of RDMA features (only UD is supported), so there is no usNIC equivalent of the BTH+ to discuss right now.

-Dave

--
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

Tested-by on the v5 series
#111 lore raw
In reply to Michael Wang
Quoted 55 lines · Michael Wang

Since v4:
* Thanks for the comments from Hal, Sean, Tom, Or Gerlitz, Jason, Roland, Ira and Steve :-) Please remind me if anything missed :-P
* Fix logical issue inside 3#, 14#
* Refine 3#, 4#, 5# with label 'free'
* Rework 10# to stop using port 1 when port already assigned

There are plenty of lengthy code to check the transport type of IB device, or the link layer type of it's port, but actually we are just speculating whether a particular management/feature is supported by the device/port.

Thus instead of inferring, we should have our own mechanism for IB management capability/protocol/feature checking, several proposals below.

This patch set will reform the method of getting transport type, we will now using query_transport() instead of inferring from transport and link layer respectively, also we defined the new transport type to make the concept more reasonable.

Mapping List:
node-type link-layer old-transport new-transport
nes RNIC ETH IWARP IWARP
amso1100 RNIC ETH IWARP IWARP

cxgb3   	RNIC		ETH		IWARP		IWARP
cxgb4   	RNIC		ETH		IWARP		IWARP
usnic   	USNIC_UDP	ETH		USNIC_UDP	USNIC_UDP
ocrdma  	IB_CA		ETH		IB		IBOE
mlx4    	IB_CA		IB/ETH		IB		IB/IBOE
mlx5    	IB_CA		IB		IB		IB
ehca    	IB_CA		IB		IB		IB
ipath   	IB_CA		IB		IB		IB
mthca   	IB_CA		IB		IB		IB
qib     	IB_CA		IB		IB		IB

For example:

	if (transport == IB) && (link-layer == ETH)
will now become:
	if (query_transport() == IBOE)

Thus we will be able to get rid of the respective transport and link-layer checking, and it will help us to add new protocol/Technology (like OPA) more easier, also with the introduced management helpers, IB management logical will be more clear and easier for extending.

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Quoted 9 lines

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be another series which focus on semantic and performance.

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Series tested for IPoIB and MAD functionality on qib and mlx4 hardware.

Quoted 76 lines

Proposals:

    Sean:
	https://www.mail-archive.com/[email protected]/msg23339.html
    Doug:
	https://www.mail-archive.com/[email protected]/msg23418.html
	https://www.mail-archive.com/[email protected]/msg23765.html
    Jason:
	https://www.mail-archive.com/[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4 
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1 
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8 
 drivers/infiniband/core/ucm.c                |    5 
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6 
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7 
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7 
 drivers/infiniband/hw/cxgb4/provider.c       |    7 
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6 
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3 
 drivers/infiniband/hw/ehca/ehca_main.c       |    1 
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7 
 drivers/infiniband/hw/mlx4/main.c            |   10 
 drivers/infiniband/hw/mlx5/main.c            |    7 
 drivers/infiniband/hw/mthca/mthca_provider.c |    7 
 drivers/infiniband/hw/nes/nes_verbs.c        |    6 
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1 
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6 
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3 
 drivers/infiniband/hw/qib/qib_verbs.c        |    7 
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1 
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6 
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2 
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6 
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)
#112 lore raw

On 04/22/2015 02:28 AM, ira.weiny wrote:
[snip]

Quoted 16 lines
Quoted 16 lines

Highlights:
The patch set covered a wide range of IB stuff, thus for those who are familiar with the particular part, your suggestion would be invaluable ;-)

Patch 1#~15# included all the logical reform, 16#~25# introduced the management helpers, 26#~27# do clean up.

Patches haven't been tested yet, we appreciate if any one who have these HW willing to provide his Tested-by :-)

Doug suggested the bitmask mechanism:
https://www.mail-archive.com/[email protected]/msg23765.html
which could be the plan for future reforming, we prefer that to be another series which focus on semantic and performance.

Quoted 8 lines
Quoted 4 lines

This patch-set is somewhat 'bloated' now and it may be a good timing for staging, I'd like to suggest we focus on improving existed helpers and push all the further reforms into next series ;-)

Series tested for IPoIB and MAD functionality on qib and mlx4 hardware.

Thanks for the testing :-)

Regards,
Michael Wang

Quoted 77 lines
Quoted 77 lines

Proposals:

    Sean:
	https://www.mail-archive.com/[email protected]/msg23339.html
    Doug:
	https://www.mail-archive.com/[email protected]/msg23418.html
	https://www.mail-archive.com/[email protected]/msg23765.html
    Jason:
	https://www.mail-archive.com/[email protected]/msg23425.html

Michael Wang (27):
IB/Verbs: Implement new callback query_transport() IB/Verbs: Implement raw management helpers IB/Verbs: Reform IB-core mad/agent/user_mad IB/Verbs: Reform IB-core cm
IB/Verbs: Reform IB-core sa_query
IB/Verbs: Reform IB-core multicast
IB/Verbs: Reform IB-ulp ipoib
IB/Verbs: Reform IB-ulp xprtrdma
IB/Verbs: Reform IB-core verbs/uverbs_cmd/sysfs IB/Verbs: Reform cm related part in IB-core cma/ucm IB/Verbs: Reform route related part in IB-core cma IB/Verbs: Reform mcast related part in IB-core cma IB/Verbs: Reserve legacy transport type in 'dev_addr' IB/Verbs: Reform cma_acquire_dev()
IB/Verbs: Reform rest part in IB-core cma IB/Verbs: Use management helper cap_ib_mad() IB/Verbs: Use management helper cap_ib_smi() IB/Verbs: Use management helper cap_ib_cm() IB/Verbs: Use management helper cap_iw_cm() IB/Verbs: Use management helper cap_ib_sa() IB/Verbs: Use management helper cap_ib_mcast() IB/Verbs: Use management helper cap_ipoib() IB/Verbs: Use management helper cap_read_multi_sge() IB/Verbs: Use management helper cap_af_ib() IB/Verbs: Use management helper cap_eth_ah() IB/Verbs: Clean up rdma_ib_or_iboe() IB/Verbs: Cleanup rdma_node_get_transport()

---
 drivers/infiniband/core/agent.c              |    4 
 drivers/infiniband/core/cm.c                 |   26 +-
 drivers/infiniband/core/cma.c                |  328 ++++++++++++---------------
 drivers/infiniband/core/device.c             |    1 
 drivers/infiniband/core/mad.c                |   51 ++--
 drivers/infiniband/core/multicast.c          |   18 -
 drivers/infiniband/core/sa_query.c           |   41 +--
 drivers/infiniband/core/sysfs.c              |    8 
 drivers/infiniband/core/ucm.c                |    5 
 drivers/infiniband/core/ucma.c               |   27 --
 drivers/infiniband/core/user_mad.c           |   32 +-
 drivers/infiniband/core/uverbs_cmd.c         |    6 
 drivers/infiniband/core/verbs.c              |   33 --
 drivers/infiniband/hw/amso1100/c2_provider.c |    7 
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |    7 
 drivers/infiniband/hw/cxgb4/provider.c       |    7 
 drivers/infiniband/hw/ehca/ehca_hca.c        |    6 
 drivers/infiniband/hw/ehca/ehca_iverbs.h     |    3 
 drivers/infiniband/hw/ehca/ehca_main.c       |    1 
 drivers/infiniband/hw/ipath/ipath_verbs.c    |    7 
 drivers/infiniband/hw/mlx4/main.c            |   10 
 drivers/infiniband/hw/mlx5/main.c            |    7 
 drivers/infiniband/hw/mthca/mthca_provider.c |    7 
 drivers/infiniband/hw/nes/nes_verbs.c        |    6 
 drivers/infiniband/hw/ocrdma/ocrdma_main.c   |    1 
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |    6 
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.h  |    3 
 drivers/infiniband/hw/qib/qib_verbs.c        |    7 
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |    1 
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |    6 
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |    2 
 drivers/infiniband/ulp/ipoib/ipoib_main.c    |   17 -
 include/rdma/ib_verbs.h                      |  204 +++++++++++++++-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c      |    6 
 net/sunrpc/xprtrdma/svc_rdma_transport.c     |   51 +---
 35 files changed, 584 insertions(+), 368 deletions(-)