Dear DPDK experts.

I have a question about load balancer implementaion in DPDK library example.
(dpdk-2.0.0/examples/load_balancer)

I read from load balancer application user guide that The worker lcore to 
handle the current packet is determined by reading a predefined 1 byte field 
from the input packet.

worker_id = packet[load_balancing_field(pos_lb)] % n_workers .

However I found its implementaion of the above function in the source code.

worker_0 = data_0_0[pos_lb] & (n_workers - 1);
worker_1 = data_0_1[pos_lb] & (n_workers - 1);

Does this implementation works?

If the n_workers = 3, the worker_0 and worker_1 have only values of 0 or 2.

I will appreciate if I can be given any advice or information.

Thank you very much.

Sincerely Yours,

Ick-Sung Choi.

Reply via email to