[openib-general] help with gen2 cq callback

James Lentini jlentini at netapp.com
Fri Jul 22 13:03:49 PDT 2005


I assume you are asking about the kernel interface. 

You should use ib_poll_cq() to dequeue CQ entries (you don't have to 
do this in the callback). You will also need to use ib_req_notify_cq() 
to re-enable the callback.

You can look at the DAPL code in

 svn/gen2/users/jlentini/linux-kernel/dat-provider

for examples of how to use these interfaces. There are probably
simpler examples though.

james

On Fri, 22 Jul 2005, PAulN wrote:

pauln> Can someone tell me what replaces the "struct ib_cq_entry *" param
pauln> of gen1's ib_cq_event_callback_func?  It's not obvious to me how to
pauln> access the cq entry in the gen2 stack from the callback - gen1
pauln> pushes it right up.  Is it necessary to poll the cq from the callback
pauln> to determine which entries are done?
pauln> Thanks,
pauln> Paul
pauln> 
pauln> //GEN2
pauln> typedef void (*ib_comp_handler)(struct ib_cq *cq, void *cq_context);
pauln> 
pauln> struct ib_cq {
pauln>        struct ib_device       *device;
pauln>        struct ib_uobject      *uobject;
pauln>        ib_comp_handler         comp_handler;
pauln>        void                  (*event_handler)(struct ib_event *, void *);
pauln>        void *                  cq_context;
pauln>        int                     cqe;
pauln>        atomic_t                usecnt; /* count number of work queues */
pauln> };
pauln> 
pauln> //GEN1
pauln> typedef void (*ib_cq_entry_callback_func)(struct ib_cq       *cq,
pauln>                                          struct ib_cq_entry *entry,
pauln>                                          void               *arg);
pauln> typedef void (*ib_cq_event_callback_func)(struct ib_cq *cq,
pauln>                                          void         *arg);
pauln> struct ib_cq_entry {
pauln>        void                     *device_specific;
pauln>        u64                       work_request_id;
pauln>        u64                       bytes_transferred;
pauln>        enum ib_completion_status status;
pauln>        enum ib_completion_op     op;
pauln>        int                       pkey_index;
pauln>        u32                       immediate_data;
pauln>        u32                       sqpn;
pauln>        u32                       local_eecn;
pauln>        u32                       freed_resource_count;
pauln>        u16                       ethertype;
pauln>        u16                       slid;
pauln>        u8                        sl;
pauln>        u8                        dlid_path_bits;
pauln>        int                       grh_present:1;
pauln>        int                       immediate_data_valid:1;
pauln> };
pauln> 
pauln> struct ib_cq;
pauln> 
pauln> 
pauln> _______________________________________________
pauln> openib-general mailing list
pauln> openib-general at openib.org
pauln> http://openib.org/mailman/listinfo/openib-general
pauln> 
pauln> To unsubscribe, please visit
pauln> http://openib.org/mailman/listinfo/openib-general
pauln> 



More information about the general mailing list