[ofw] umad: do not modify input after sending
Hefty, Sean
sean.hefty at intel.com
Wed Apr 20 22:48:26 PDT 2011
> > +// If the Version is not set, use umad compatability address format
> > +static void WmConvertGrh(ib_grh_t *pGrh, WM_IO_MAD *pIoMad)
> > +{
> > + if (RtlUlongByteSwap(pIoMad->Address.VersionClassFlow) >> 28) {
>
> Couldn't you just check the upper four bits of the lowest byte and avoid
> the byte swap here:
Only if you assume little endian. The efficiency doesn't seem worth it versus the maintenance, especially since nothing in the tree will actually invoke this code. We'll fail on the GrhValid test before calling this function.
Besides, if the compiler were smart enough, it would figure this out for us, since we're shifting 28 bits over. :)
- Sean
More information about the ofw
mailing list