On 11/26/25 04:41, David Gibson wrote:
+/** + * flow_qp() - Get the queue pair for a flow + * @f: Flow to query (may be NULL) + * + * Return: queue pair number for the flow, or 0 if flow is NULL or has no + * valid queue pair assignment + */ +unsigned int flow_qp(const struct flow_common *f) +{ + if (f == NULL || f->qpair == FLOW_QPAIR_INVALID) Are there any instances where you actually want to pass a NULL flow to this?
If you're going to return 0 anyway, why not just set f->qpair to 0 by default, rather than using FLOW_QPAIR_INVALID?
In fact, in the multithread part I need to know if the queue pair has been set or not. I agree that we should avoid this if possible because it takes one slot in the array. And as we have 16 qpairs we must use 5 bit (we need 17 values) rather than 4 bit. I'm reworking the multithread part, I will see if I can remove this. Thanks, Laurent