public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org
Subject: RDMA_CM_EVENT_REJECTED and ressources release
Date: Wed, 20 Jun 2012 16:19:55 +0200	[thread overview]
Message-ID: <1340201995.2468.24.camel@test.quest-ce.net> (raw)

Hi,

I'm trying to make my InfiniBand verbs/RDMA application more reliable
regarding RDMA CM error events.

In particular, I'm trying to handle verbs ressources release.

Here's a scenarii from the client point of view:

rdma_resolve_addr()
    => event RDMA_CM_EVENT_ADDR_RESOLVED
rdma_resolv_route()
    => event RDMA_CM_EVENT_ROUTE_RESOLVED
ibv_reg_mr()
ibv_create_cq()
rdma_create_qp()
rdma_connect()
    => event RDMA_CM_EVENT_REJECTED !

In the handler of RDMA_CM_EVENT_REJECTED, I could handle this in two
different ways:

- call rdma_disconnect(): even if the connection is not established, 
  rdma_disconnect() can be called.

  In this case, all receive WR posted came back in error.

  But there's no event RDMA_CM_EVENT_TIMEWAIT_EXIT to handle
  where the program could call rdma_destroy_qp(), ibv_destroy_cq(), 
  ibv_dereg_mr(), and rdma_destroy_id().

  Note there's no event RDMA_CM_EVENT_DISCONNECTED either (indeed).

- call rdma_destroy_qp(), ibv_destroy_cq(), ibv_dereg_mr(), and 
  rdma_destroy_id(). 
  
  Before calling ibv_destroy_cq(), the program call ibv_poll_cq() to 
  flush the CQ (but the function return -2 when called on the CQ used 
  to hold receive WC, but without problem on the one used to hold send 
  WC)

  The completion channel which was registered against the CQ is 
  notified of an event. ibv_get_cq_event() will return a pointer 
  to the destroyed CQ and ibv_poll_cq() return 0 (no WC).
  (and currently my code is calling ibv_ack_cq_events() then 
   ibv_req_notify_cq() on the CQ returned by ibv_get_cq_event).


Neither solution seems really suitable to me.

Do you have any tip/hint to handle this situation.

Regards.

-- 
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2012-06-20 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20 14:19 Yann Droneaud [this message]
     [not found] ` <CAFRond5aFKD1orfM=3wdDkkHq47b8BkY2RiidMLJDTy014gdLQ@mail.gmail.com>
     [not found]   ` <CAFRond5aFKD1orfM=3wdDkkHq47b8BkY2RiidMLJDTy014gdLQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-21  6:11     ` RDMA_CM_EVENT_REJECTED and ressources release Yann Droneaud
     [not found] ` <1340201995.2468.24.camel-sQn2kEGNn0pFevvuwOF9vF6hYfS7NtTn@public.gmane.org>
2012-06-21 16:04   ` Hefty, Sean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340201995.2468.24.camel@test.quest-ce.net \
    --to=ydroneaud-rly5vtjfyj3qt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox