On 2/12/21 3:49 PM, Anton Ivanov wrote:
> This adds a set of functions and macros intended to process
> hashes in parallel.
> 
> The principles of operation are documented in the fasthmap.h
> 
> If these one day go into the OVS tree, the OVS tree versions
> would be used in preference.
> 
> Signed-off-by: Anton Ivanov <anton.iva...@cambridgegreys.com>

Hi, Anton.  Not a full review, just one comment below.

> +static inline void wait_for_work(struct worker_control *control)
> +{
> +    sem_wait(control->fire);
> +}

Shouldn't we check the result of sem_wait?  If it failed with
EINTR we likely need to call it again, otherwise worker thread
might start working on the incomplete or uninitialized data
and crash.

We may also add assertion for EINVAL just to catch it earlier.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to