[openib-general] IPOIB NAPI

Michael S. Tsirkin mst at mellanox.co.il
Mon Oct 16 13:05:33 PDT 2006


Quoting r. Roland Dreier <rdreier at cisco.com>:
> There are further changes I would like to add on top of that, but
> comments on the two patches there would be appreciated.

A small optimization:

	if (missed_event && netif_rx_reschedule(dev, 0))

should be, I think

	if (unlikely(missed_event) && netif_rx_reschedule(dev, 0))

since we are talking about an unlikely race where CQ became non-empty
just as we were calling req_notify_cq.

An API idea:
how about instead testing missed_events, we add a flag:

IB_CQ_TEST (or a longer name IB_CQ_REPORT_MISSED_EVENTS?)
and change ib_req_notify_cq to return int which will keep
the missed_events value, only if this flag is set?

This has 2 advatages
- Less churn updating all users to new API - they just ignore return value -
  and still almost no overhead for them as they don't set IB_CQ_TEST
- For all users we have to push less values on stack - note compiler can't
  get rid of them as we are calling function through a pointer
- For users that do
  missed_events = ib_req_notify_cq(priv->cq, IB_CQ_NEXT_COMP | IB_CQ_TEST)
  we get the result in register.

I agree its a minor optimization, but I think quite a similiar change went in
in the linux irq code - waste not, want not.

Want to see hw a patch like this will look?

-- 
MST




More information about the general mailing list