Skip to content

Commit

Permalink
Make sure that userspace does not retrieve stale asynchronous or
Browse files Browse the repository at this point in the history
completion events after destroying a CQ, QP or SRQ.  We do this by
sweeping the event lists before returning from a destroy calls, and
then return the number of events already reported before the destroy
call.  This allows userspace wait until it has processed all events
for an object returned from the kernel before it frees its context for
the object.

The ABI of the destroy CQ, destroy QP and destroy SRQ commands has to
change to return the event count, so bump the ABI version from 1 to 2.
The userspace libibverbs library has already been updated to handle
both the old and new ABI versions.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier authored and Roland Dreier committed Sep 9, 2005
1 parent 2e9f7cb commit 63aaf64
Show file tree
Hide file tree
Showing 4 changed files with 211 additions and 89 deletions.
26 changes: 17 additions & 9 deletions drivers/infiniband/core/uverbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,28 @@ struct ib_uverbs_file {
struct ib_uverbs_event_file comp_file[1];
};

struct ib_uverbs_async_event {
struct ib_uverbs_async_event_desc desc;
struct ib_uverbs_event {
union {
struct ib_uverbs_async_event_desc async;
struct ib_uverbs_comp_event_desc comp;
} desc;
struct list_head list;
struct list_head obj_list;
u32 *counter;
};

struct ib_uverbs_comp_event {
struct ib_uverbs_comp_event_desc desc;
struct list_head list;
struct ib_uevent_object {
struct ib_uobject uobject;
struct list_head event_list;
u32 events_reported;
};

struct ib_uobject_mr {
struct ib_uobject uobj;
struct page *page_list;
struct scatterlist *sg_list;
struct ib_ucq_object {
struct ib_uobject uobject;
struct list_head comp_list;
struct list_head async_list;
u32 comp_events_reported;
u32 async_events_reported;
};

extern struct semaphore ib_uverbs_idr_mutex;
Expand Down
Loading

0 comments on commit 63aaf64

Please sign in to comment.