tuntap: Introduce per thread structure to suport multi-threads (VPP-1012) 02/8702/1
authorSteven <[email protected]>
Thu, 5 Oct 2017 07:12:33 +0000 (00:12 -0700)
committersteven luong <[email protected]>
Fri, 6 Oct 2017 18:12:05 +0000 (18:12 +0000)
commit16d12cf1861bd56c83cc8437944c290a59a34a79
tree531fc996f04c7a6fe460247eb492b0884c63de3a
parent43bb653d7fbc4903ea4960dac9c8a3ee8a9ed173
tuntap: Introduce per thread structure to suport multi-threads (VPP-1012)

https://gerrit.fd.io/r/#/c/8551/ decoupled the global variable,
namely tm->iovecs from TX and RX. However, to support multi-threads,
we have to eliminate the use of this global variable with per thread
variable. I notice that rx_buffers must also be per thread variable.
So, we introduce per thread struct to contain rx_buffers and iovecs.
Each thread will find the per thread struct with thread_index.

Change-Id: I61abf2fdace8d722525a382ac72f0d04a173b9ce
Signed-off-by: Steven <[email protected]>
(cherry picked from commit 4cd257667406d0500a81323ef91f5c7c8c902b25)
src/vnet/unix/tapcli.c
src/vnet/unix/tuntap.c