Skip to content

Commit bd9de1b

Browse files
MarkZhang81rleon
authored andcommitted
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: 8dc105b ("RDMA/cm: Add tracepoints to track MAD send operations") Signed-off-by: Mark Zhang <markzhang@nvidia.com> Link: https://lore.kernel.org/r/20230330072351.481200-1-markzhang@nvidia.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent f13bcef commit bd9de1b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • drivers/infiniband/core

drivers/infiniband/core/cm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2912,6 +2912,8 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv,
29122912
(ari && ari_length > IB_CM_REJ_ARI_LENGTH))
29132913
return -EINVAL;
29142914

2915+
trace_icm_send_rej(&cm_id_priv->id, reason);
2916+
29152917
switch (state) {
29162918
case IB_CM_REQ_SENT:
29172919
case IB_CM_MRA_REQ_RCVD:
@@ -2942,7 +2944,6 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv,
29422944
return -EINVAL;
29432945
}
29442946

2945-
trace_icm_send_rej(&cm_id_priv->id, reason);
29462947
ret = ib_post_send_mad(msg, NULL);
29472948
if (ret) {
29482949
cm_free_msg(msg);

0 commit comments

Comments
 (0)