Problem running rping over Intel adapters
We ran into this problem when testing rping over Intel/QLogic hardware:
[root@rdmaperf3 ~]# rping -s -a 172.31.2.103 -v
wait for CONNECTED state 10
connect error -1
cma event RDMA_CM_EVENT_REJECTED, error 28
[root@rdmaperf3 ~]#
[root@rdmaperf8 ~]# rping -c -a 172.31.2.103 -v -C 5 cma event RDMA_CM_EVENT_CONNECT_ERROR, error -1 wait for CONNECTED state 4
connect error -1
[root@rdmaperf8 ~]#
Turns out this is because of a couple things:
1) rping, on the client side, clears the conn_params for the newly to be attempted connection, then sets:
conn_param.responder_resources = 1; conn_param.initiator_depth = 1; conn_param.retry_count = 10;
On the accept side, rping clears the conn_params and then sets just the responder_resources and initiator_depth, without even checking the incoming requested conn_param values from the incoming cm_id. So, OK, you can get away with that since this is a simple test program, but still not "best programming practices". However, the important part here is the retry_count of 10. That won't work on Intel/QLogic hardware.
2) the qib driver enforces a maximum of 7 for retry_count. I don't see anything in the spec that specifies a maximum for this entry, and in particular I know it doesn't call out for 7 to mean infinite retries like it does for rnr_retry_count.
I don't think the spec really cares how we solve this, and I don't think there is a hard limit of 7 for the retry_count like the qib driver enforces. On the other hand, the spec doesn't call out a limit on the retry_count but I would assume each driver has the option to implement their own "reasonable, implementation defined" limit in a case like this.
So, do we make qib more liberal in its acceptance of retry_count or do we fix rping to use a smaller number? Matters not to me...
Signature · 6 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD http://people.redhat.com/dledford Infiniband specific RPMs available at http://people.redhat.com/dledford/Infiniband
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines
1) rping, on the client side, clears the
conn_paramsfor the newly to be attempted connection, then sets:conn_param.responder_resources = 1; conn_param.initiator_depth = 1; conn_param.retry_count = 10;
Quoted 4 lines
2) the qib driver enforces a maximum of 7 for
retry_count. I don't see anything in the spec that specifies a maximum for this entry, and in particular I know it doesn't call out for 7 to mean infinite retries like it does forrnr_retry_count.
On IB, retry count is a 3-bit value. See the CM REQ message.
The kernel rdma cm should probably check for a valid value and reduce it accordingly.
- Sean
--
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): 1828884A29C6694DAF28B7E6B8A8237346A98E58-Q3cL8pyY+6ukrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org
Quoted 8 lines · Sean
Quoted 6 lines
1) rping, on the client side, clears the
conn_paramsfor the newly to be attempted connection, then sets:conn_param.responder_resources = 1; conn_param.initiator_depth = 1; conn_param.retry_count = 10;
Quoted 8 lines
Quoted 4 lines
2) the qib driver enforces a maximum of 7 for
retry_count. I don't see anything in the spec that specifies a maximum for this entry, and in particular I know it doesn't call out for 7 to mean infinite retries like it does forrnr_retry_count.On IB, retry count is a 3-bit value. See the CM REQ message.
The kernel rdma cm should probably check for a valid value and reduce it accordingly.
Then it's also fair to say that right now rping passes a known invalid value and needs fixed ;-)
Signature · 6 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD http://people.redhat.com/dledford Infiniband specific RPMs available at http://people.redhat.com/dledford/Infiniband
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
1) rping, on the client side, clears the
conn_paramsfor the newly to be attempted connection, then sets:conn_param.responder_resources = 1; conn_param.initiator_depth = 1; conn_param.retry_count = 10;2) the qib driver enforces a maximum of 7 for
retry_count. I don't see anything in the spec that specifies a maximum for this entry, and in particular I know it doesn't call out for 7 to mean infinite retries like it does forrnr_retry_count.
Quoted 7 lines
Quoted 3 lines
On IB, retry count is a 3-bit value. See the CM REQ message.
The kernel rdma cm should probably check for a valid value and reduce it
accordingly.
Then it's also fair to say that right now rping passes a known invalid value and needs fixed ;-)
For IB, but I wasn't sure about iWarp. It doesn't look like it's used there though.
If not, I'll apply a patch to rping, plus submit a fix for the kernel to validate the value. --
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): 1828884A29C6694DAF28B7E6B8A8237346A98E8E-Q3cL8pyY+6ukrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org
Quoted 16 lines · Sean
Quoted 16 lines
Quoted 16 lines
Quoted 11 lines
1) rping, on the client side, clears the
conn_paramsfor the newly to be attempted connection, then sets:conn_param.responder_resources = 1; conn_param.initiator_depth = 1; conn_param.retry_count = 10;
2) the qib driver enforces a maximum of 7 for
retry_count. I don't see anything in the spec that specifies a maximum for this entry, and in particular I know it doesn't call out for 7 to mean infinite retries like it does forrnr_retry_count.On IB, retry count is a 3-bit value. See the CM REQ message.
The kernel rdma cm should probably check for a valid value and reduce it
Quoted 7 lines
Quoted 4 lines
accordingly.
Then it's also fair to say that right now rping passes a known invalid value and needs fixed ;-)
For IB, but I wasn't sure about iWarp. It doesn't look like it's used there though.
I would hope it's not used on iWARP....it's running over it's own link layer where this is neither defined nor applicable.
Quoted 2 lines
If not, I'll apply a patch to rping, plus submit a fix for the kernel to validate the value.
Signature · 6 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD http://people.redhat.com/dledford Infiniband specific RPMs available at http://people.redhat.com/dledford/Infiniband
Quoted 14 lines · Sean
Quoted 14 lines
Quoted 14 lines
Quoted 11 lines
1) rping, on the client side, clears the
conn_paramsfor the newly to be attempted connection, then sets:conn_param.responder_resources = 1; conn_param.initiator_depth = 1; conn_param.retry_count = 10;2) the qib driver enforces a maximum of 7 for
retry_count. I don't see anything in the spec that specifies a maximum for this entry, and in particular I know it doesn't call out for 7 to mean infinite retries like it does forrnr_retry_count.On IB, retry count is a 3-bit value. See the CM REQ message.
The kernel rdma cm should probably check for a valid value and reduce it
Quoted 8 lines
Quoted 4 lines
accordingly.
Then it's also fair to say that right now rping passes a known invalid value and needs fixed ;-)
For IB, but I wasn't sure about iWarp. It doesn't look like it's used there though.
If not, I'll apply a patch to rping, plus submit a fix for the kernel to validate the value. --
Not used by iwarp drivers...
--
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): 506CEAC1.9070808-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org
Quoted 2 lines · Steve Wise
Not used by iwarp drivers...
Which one, the retry counter or the RNR retry counter?
Or.
--
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): 506D2174.10601-VPRAkNaXOzVWk0Htik3J/[email protected]
Quoted 6 lines · Or Gerlitz
Quoted 2 lines · Steve Wise
Not used by iwarp drivers...
Which one, the retry counter or the RNR retry counter?
rnr_retry_count has no meaning in iWARP. There is no RNR message in the iwarp protocol. For some iwarp devices (cxgb3 for example), an ingress send with no recv buffer available results in immediate connection termination. Some devices, (eg cxgb4), the ingress SEND is buffered in the adapter until a recv buf is posted. Both behaviors are allowed in the iwarp specs.
retry_count, I assume, is for connection establishment? For the Chelsio devices, this is all up to the TCP stack and thus this counter is not used. If there is no TCP listener, then the connection establishment will fail immediately. If the node is not reachable, then normal TCP retransmit rules apply, but once TCP gives up, then the rdma connection establishment will fail.
Also, the RDMA_CM and IW_CM don't even pass these two counters down to the drivers' connect function. See struct iw_cm_conn_param and cma.c/cma_connect_iw() iwcm.c/iw_cm_connect().
Steve.
Quoted 6 lines
Or.
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
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines
retry_count, I assume, is for connection establishment? For the Chelsio devices, this is all up to the TCP stack and thus this counter is not used. If there is no TCP listener, then the connection establishment will fail immediately. If the node is not reachable, then normal TCP retransmit rules apply, but once TCP gives up, then the rdma connection establishment will fail.
On IB, this is a transport level retry of a lost request.
--
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): 1828884A29C6694DAF28B7E6B8A8237346A99126-Q3cL8pyY+6ukrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org
Quoted 7 lines · Sean
Quoted 6 lines
retry_count, I assume, is for connection establishment? For the Chelsio devices, this is all up to the TCP stack and thus this counter is not used. If there is no TCP listener, then the connection establishment will fail immediately. If the node is not reachable, then normal TCP retransmit rules apply, but once TCP gives up, then the rdma connection establishment will fail.On IB, this is a transport level retry of a lost request.
Ah, ok. Regardless, TCP handles all that for IWARP and we currently don't provide the rdma application any way to manipulate the TCP behavior.
Steve.
--
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
Quoted 7 lines
1) rping, on the client side, clears the
conn_paramsfor the newly to be attempted connection, then sets:conn_param.responder_resources = 1; conn_param.initiator_depth = 1; conn_param.retry_count = 10;
Quoted 6 lines
On the accept side, rping clears the
conn_paramsand then sets just theresponder_resourcesandinitiator_depth, without even checking the incoming requestedconn_paramvalues from the incomingcm_id. So, OK, you can get away with that since this is a simple test program, but still not "best programming practices". However, the important part here is theretry_countof 10. That won't work on Intel/QLogic hardware.
I pushed in the following fix to rping. Thanks
---
rping: Reduce retry_count to fit in 3-bits
From: Sean Hefty <[email protected]>
retry_count is a 3 bit value on IB, reduce it from 10 to 7.
A value of 10 prevents rping from working over the Intel
IB HCA. Problem reported by Doug Ledford <[email protected]>
The retry_count is also not set when calling rdma_accept. Rather than passing different values into rdma_accept than what was specified by the remote side, use the values given in the connection request.
--- examples/rping.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-)
examples/rping.c +2 -7
@@ -342,16 +342,11 @@ error:static int rping_accept (struct rping_cb *cb) { -struct rdma_conn_param conn_param;int ret;DEBUG_LOG ("accepting client connection request\n" ); -memset (&conn_param,0 ,sizeof conn_param); - conn_param.responder_resources =1 ; - conn_param.initiator_depth =1 ; - - ret =rdma_accept (cb->child_cm_id, &conn_param); + ret =rdma_accept (cb->child_cm_id,NULL );if (ret) {perror ("rdma_accept" );return ret;
@@ -975,7 +970,7 @@ static int rping_connect_client(struct rping_cb *cb)memset (&conn_param,0 ,sizeof conn_param); conn_param.responder_resources =1 ; conn_param.initiator_depth =1 ; - conn_param.retry_count =10 ; + conn_param.retry_count =7 ; ret =rdma_connect (cb->cm_id, &conn_param);if (ret) {
--
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): 1828884A29C6694DAF28B7E6B8A8237346A98ECB-Q3cL8pyY+6ukrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org
The IBTA spec clearly binds the IB HCA to a max of 7:
C9-142: For an HCA requester using Reliable Connection service, to prevent the requester from retrying the request forever, the requester shall maintain a 3 bit retry counter which is used to count the number of times a particular request packet has been retried and timed out. This counter shall be decremented each time the transport timer expires for a given request packet. The counter shall be re-loaded whenever a given outstanding request is cleared.
The language round modify QP probably validates a test on the Retry count:
C11-9: If any of the QP attributes to be modified are invalid or the requested state transition is invalid, none of the QP attributes shall be modified. An immediate error shall be returned and the QP state shall remain unchanged.
A brief look at Mellanox code indicates that the "invalid" value is trusted and or'ed into the modify mechanism.
Mike
Quoted 66 lines
-----Original Message-----
From: Hefty, Sean
Sent: Wednesday, October 03, 2012 6:39 PM
To: Doug Ledford; Marciniszyn, Mike; [email protected]
Subject: RE: Problem running rping over Intel adaptersQuoted 7 lines
1) rping, on the client side, clears the
conn_paramsfor the newly to be attempted connection, then sets:conn_param.responder_resources = 1; conn_param.initiator_depth = 1; conn_param.retry_count = 10;Quoted 6 lines
On the accept side, rping clears the
conn_paramsand then sets just theresponder_resourcesandinitiator_depth, without even checking the incoming requestedconn_paramvalues from the incomingcm_id. So, OK, you can get away with that since this is a simple test program, but still not "best programming practices". However, the important part here is theretry_countof 10. That won't work on Intel/QLogic hardware.I pushed in the following fix to rping. Thanks
---
rping: Reduce
retry_countto fit in 3-bitsFrom: Sean Hefty <[email protected]>
retry_countis a 3 bit value on IB, reduce it from 10 to 7.A value of 10 prevents rping from working over the Intel IB HCA. Problem reported by Doug Ledford <[email protected]>
The
retry_countis also not set when callingrdma_accept.
Rather than passing different values intordma_acceptthan what was specified by the remote side, use the values given in the connection request.Signed-off-by Sean Hefty <[email protected]>--- examples/rping.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-)examples/rping.c index 785338e..32bd70a renamed from examples/rping.c +0
-0100644
examples/rping.c +1
-6@@ -342,16 +342,11 @@ error:static int rping_accept (struct rping_cb *cb) { -struct rdma_conn_param conn_param;int ret;DEBUG_LOG ("accepting client connection request\n" ); -memset (&conn_param,0 ,sizeof conn_param); - conn_param.responder_resources =1 ; - conn_param.initiator_depth =1 ; - - ret =rdma_accept (cb->child_cm_id, &conn_param); + ret =rdma_accept (cb->child_cm_id,NULL );if (ret) {perror ("rdma_accept" );return ret;
examples/rping.c static int rping_connect_client(struct rping_cb *cb) · line 976
Quoted 8 lines
examples/rping.c +1
-1@@ -975,7 +970,7 @@ static int rping_connect_client(struct rping_cb *cb)memset (&conn_param,0 ,sizeof conn_param); conn_param.responder_resources =1 ; conn_param.initiator_depth =1 ; - conn_param.retry_count =10 ; + conn_param.retry_count =7 ; ret =rdma_connect (cb->cm_id, &conn_param);if (ret) {
--
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