[openib-general] Re: [PATCH] add cq error events

Michael S. Tsirkin mst at mellanox.co.il
Mon Sep 26 20:25:45 PDT 2005


Quoting Roland Dreier <rolandd at cisco.com>:
>     Michael> As a side note, the spec says: "Two types of CQ errors
>     Michael> can occur: the CQ can overrun or it can become
>     Michael> inaccessible": I wander whether this should be
>     Michael> interpreted in a sense that that there should be two
>     Michael> types of events: IB_EVENT_CQ_OVERRUN and
>     Michael> IB_EVENT_CQ_ACCESS, rather than just a generic
>     Michael> IB_EVENT_CQ_ERR
> 
> Yes, this seems useful to me.  The reason is that a CQ overrun
> indicates a bug in the consumer, and a CQ access error indicates a bug
> in the verbs implementation.  So it's useful to be able to tell whose
> fault a CQ error is.
> 
>  - R.
> 

Okay ... one problem that I've run into adding this, is
that IB_EVENT_CQ_ERR is the first item in the ib_event_type enum.
And since uverbs seems to just copy the event over to userspace,
changing all the enum values would break the ABI.

Given that IB_EVENT_CQ_ERR wasnt actually produced by any hardware
provider yet, I'm thinking about working around this by simply giving
specific values to enum items, like this

enum ib_event_type {
        IB_EVENT_QP_FATAL = 1,
        IB_EVENT_QP_REQ_ERR = 2,
        IB_EVENT_QP_ACCESS_ERR = 3,
        IB_EVENT_COMM_EST = 4,
        IB_EVENT_SQ_DRAINED = 5,
        IB_EVENT_PATH_MIG = 6,
        IB_EVENT_PATH_MIG_ERR = 7,
        IB_EVENT_DEVICE_FATAL = 8,
        IB_EVENT_PORT_ACTIVE = 9,
        IB_EVENT_PORT_ERR = 10,
        IB_EVENT_LID_CHANGE = 11,
        IB_EVENT_PKEY_CHANGE = 12,
        IB_EVENT_SM_CHANGE = 13,
        IB_EVENT_SRQ_ERR = 14,
        IB_EVENT_SRQ_LIMIT_REACHED = 15,
        IB_EVENT_QP_LAST_WQE_REACHED = 16,
	IB_EVENT_CQ_OVERRUN = 17,
	IB_EVENT_CQ_ACCESS = 18
}

Is that acceptable?
And alternative would be to add a switch statement to uverbs
or to libibverbs.


-- 
MST



More information about the general mailing list