Michael S. Tsirkin wrote:
Okay, but lets try to avoid adding runtime overhead.

This shouldn't add any runtime overhead than what's already there. The only difference is the notation used to get to the process_mad function.

I dont see how - the union size will likely change anyway.

This could be avoided by making the union reference pointers to structures, rather than the structures themselves. I didn't go this route because I didn't want to update where the ib_device structures were allocated. This would have an impact on runtime performance, but the cost is only an additional memory read.

My point is, I have to test whether the function is implemented anyway,
so why add two checks: one for device type, another for function
implementation? Its complicated and inefficient.

Multiple checks are already done today. For example, the MAD code checks device type before trying to use a device, then checks again to see if a function is implemented. Similarly, the CMA must also check device type.

Then at least lets make it a structure, not a union.
This way a single test is sufficient to figure out whether
a specific function is supported.

I don't follow the advantages of embedding a structure inside ib_device.

- Sean


_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to