Re: [PATCH net] tuntap: synchronize through tfiles array instead of tun->numqueues

2019-05-07 Thread Jason Wang
On 2019/5/7 下午10:47, Eric Dumazet wrote: On 5/6/19 11:54 PM, Jason Wang wrote: On 2019/5/7 上午11:41, Eric Dumazet wrote: If you remove the test on (!numqueues), the following might crash with a divide by zero... Indeed, let me post V2. You probably want to fix tun_ebpf_select_queue() a

Re: [PATCH net] tuntap: synchronize through tfiles array instead of tun->numqueues

2019-05-07 Thread Eric Dumazet
On 5/6/19 11:54 PM, Jason Wang wrote: > > On 2019/5/7 上午11:41, Eric Dumazet wrote: >> >>>   >> If you remove the test on (!numqueues), >> the following might crash with a divide by zero... > > > Indeed, let me post V2. You probably want to fix tun_ebpf_select_queue() as well.

Re: [PATCH net] tuntap: synchronize through tfiles array instead of tun->numqueues

2019-05-06 Thread Jason Wang
On 2019/5/7 上午11:41, Eric Dumazet wrote: On 5/6/19 11:23 PM, Jason Wang wrote: When a queue(tfile) is detached through __tun_detach(), we move the last enabled tfile to the position where detached one sit but don't NULL out last position. We expect to synchronize the datapath through tun->num

Re: [PATCH net] tuntap: synchronize through tfiles array instead of tun->numqueues

2019-05-06 Thread Eric Dumazet
On 5/6/19 11:23 PM, Jason Wang wrote: > When a queue(tfile) is detached through __tun_detach(), we move the > last enabled tfile to the position where detached one sit but don't > NULL out last position. We expect to synchronize the datapath through > tun->numqueues. Unfortunately, this won't wo

[PATCH net] tuntap: synchronize through tfiles array instead of tun->numqueues

2019-05-06 Thread Jason Wang
When a queue(tfile) is detached through __tun_detach(), we move the last enabled tfile to the position where detached one sit but don't NULL out last position. We expect to synchronize the datapath through tun->numqueues. Unfortunately, this won't work since we're lacking sufficient mechanism to or