[openib-general] IPOIB NAPI

Roland Dreier rdreier at cisco.com
Mon Oct 16 15:19:53 PDT 2006


 > A small optimization:
 > 
 > 	if (missed_event && netif_rx_reschedule(dev, 0))
 > 
 > should be, I think
 > 
 > 	if (unlikely(missed_event) && netif_rx_reschedule(dev, 0))

Yes, makes sense.  I updated my ipoib-napi branch with this.

 > 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.

Yes, I like this.  So ib_req_notify_cq() gets a return value that is
negative if an error occurred, 0 if everything is fine, or positive if
a missed event might have happened.

I think I prefer the longer name IB_CQ_REPORT_MISSED_EVENTS -- at
least there's a chance at guessing what it means even if you don't
read the documentation.

 > Want to see hw a patch like this will look?

That would be great.  Most convenient would be a patch on top of the
first "missed event" patch in my ipoib-napi branch, although a
replacement patch for that would be fine too.

Otherwise if you're busy I'll do it myself in a few days -- I have a
few other things I want to get to first.

Thanks,
  Roland




More information about the general mailing list