Skip to contentSkip to conversation

RDMA/cm: Trace icm_send_rej event before the cm state is reset

PATCH RESEND Applied Mark Zhang 3 participants 4 messages Mar 30, 2023 – Apr 9, 2023 InfiniBand

lore
Share & tools
lore

Mark Zhang

author
#0 lore raw

PATCH RESEND 1/1 RDMA/cm: Trace icm_send_rej event before the cm state is reset

Trace icm_send_rej event before the cm state is reset to idle, so that correct cm state will be logged. For example when an incoming request is rejected, the old trace log was:

    icm_send_rej: local_id=961102742 remote_id=3829151631 state=IDLE reason=REJ_CONSUMER_DEFINED
With this patch:
    icm_send_rej: local_id=312971016 remote_id=3778819983 state=MRA_REQ_SENT reason=REJ_CONSUMER_DEFINED
Fixes 8dc105befe16 ("RDMA/cm: Add tracepoints to track MAD send operations")
---
 drivers/infiniband/core/cm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/core/cm.c +2 -1
index 603c0aecc361..ff58058aeadc 100644
@@ -2912,6 +2912,8 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv,
 	    (ari && ari_length > IB_CM_REJ_ARI_LENGTH))
 		return -EINVAL;
 
+	trace_icm_send_rej(&cm_id_priv->id, reason);
+
 	switch (state) {
 	case IB_CM_REQ_SENT:
 	case IB_CM_MRA_REQ_RCVD:
@@ -2942,7 +2944,6 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv,
 		return -EINVAL;
 	}
 
-	trace_icm_send_rej(&cm_id_priv->id, reason);
 	ret = ib_post_send_mad(msg, NULL);
 	if (ret) {
 		cm_free_msg(msg);
Signature · 1 line
2.37.1
maintainer
#1 lore raw
Quoted 7 lines · Mark Zhang

Trace icm_send_rej event before the cm state is reset to idle, so that correct cm state will be logged. For example when an incoming request is rejected, the old trace log was:

    icm_send_rej: local_id=961102742 remote_id=3829151631 state=IDLE reason=REJ_CONSUMER_DEFINED
With this patch:
    icm_send_rej: local_id=312971016 remote_id=3778819983 state=MRA_REQ_SENT reason=REJ_CONSUMER_DEFINED
Quoted 5 lines
Fixes 8dc105befe16 ("RDMA/cm: Add tracepoints to track MAD send operations")
---
 drivers/infiniband/core/cm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

For future reference:
1. You sent new version, so your patch should have vXXX in subject and not RESEND.
2. Changelog is missing.
3. Signed-off-by should be last.

There is no need to resend this patch, we will fix when we will apply it.

Thanks

author
#2 lore raw
Quoted 14 lines · Leon Romanovsky
Quoted 7 lines · Mark Zhang

Trace icm_send_rej event before the cm state is reset to idle, so that correct cm state will be logged. For example when an incoming request is rejected, the old trace log was:

     icm_send_rej: local_id=961102742 remote_id=3829151631 state=IDLE reason=REJ_CONSUMER_DEFINED
With this patch:
     icm_send_rej: local_id=312971016 remote_id=3778819983 state=MRA_REQ_SENT reason=REJ_CONSUMER_DEFINED
Quoted 5 lines
Fixes 8dc105befe16 ("RDMA/cm: Add tracepoints to track MAD send operations")
---
  drivers/infiniband/core/cm.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 7 lines

For future reference:
1. You sent new version, so your patch should have vXXX in subject and not RESEND.
2. Changelog is missing.
3. Signed-off-by should be last.

There is no need to resend this patch, we will fix when we will apply it.

Thank you Leon and sorry for the trouble:)

#3 lore raw
In reply to Mark Zhang
Quoted 8 lines · Mark Zhang

Trace icm_send_rej event before the cm state is reset to idle, so that correct cm state will be logged. For example when an incoming request is rejected, the old trace log was:

    icm_send_rej: local_id=961102742 remote_id=3829151631 state=IDLE reason=REJ_CONSUMER_DEFINED
With this patch:
    icm_send_rej: local_id=312971016 remote_id=3778819983 state=MRA_REQ_SENT reason=REJ_CONSUMER_DEFINED

[...]

Applied, thanks!

[1/1] RDMA/cm: Trace icm_send_rej event before the cm state is reset

      https://git.kernel.org/rdma/rdma/c/bd9de1badac7e4

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>