DPDK / grout

grout # a graph router based on DPDK
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

worker: allow starting threads outside of current process affinity #64

Closed rjarry closed 1 week ago

rjarry commented 2 weeks ago

When using tuned CPU partitioning, the default CPU affinity of processes are often restricted to a set of housekeeping cores. We want the control plane threads to run in these CPUs. However, we also want the data path threads NOT to run on these CPUs, but instead pin them on the previously isolated cores.

Remove the restriction of worker_rxq_assign() cpu_id to be part of the current process CPU affinity. Instead use a pthread attribute to specify the desired affinity based on cpu_id and pass that to pthread_create(). That way, if the cpu_id cannot be used (either because it is invalid or referencing to an offline CPU), pthread_create() will return an appropriate error code that can be returned to the caller. Since this call can now fail, delay the removal of the rxq from the source worker after the destination has been successfully created.

Remove the (now redundant) call to rte_thread_set_affinity() inside gr_datapath_loop().

Update unit tests accordingly.