Re: [ovs-dev] [PATCH] ovs-atomic: __GNUC__ == 4 is enough

2020-09-21 Thread Linhaifeng
> > On 9/19/20 8:08 AM, Linhaifeng wrote: > > 1. include config.h to avoid include different atomic head file > > All .c files should include config.h as their first include, so config.h > should always > be already included at the time we including ovs-atomic.h. D

[ovs-dev] [PATCH] ovs-atomic: __GNUC__ == 4 is enough

2020-09-19 Thread Linhaifeng
1. include config.h to avoid include different atomic head file 2. __GNUC__ == 4 is enough Fixes: 31a3fc6e3e9c ("ovs-atomic: New library for atomic operations.") Cc: b...@nicira.com Signed-off-by: Linhaifeng --- lib/ovs-atomic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletio

Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first

2020-06-07 Thread Linhaifeng
Hi, Ben Will this patch apply ? > -Original Message- > From: Ilya Maximets [mailto:i.maxim...@ovn.org] > Sent: Wednesday, June 3, 2020 10:33 PM > To: Linhaifeng ; Ilya Maximets > ; Ben Pfaff > Cc: d...@openvswitch.org; Lilijun (Jerry) ; Lichunhe > ; nd ; chencha

Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first

2020-06-03 Thread Linhaifeng
> -Original Message- > From: Ilya Maximets [mailto:i.maxim...@ovn.org] > Sent: Thursday, June 4, 2020 12:01 AM > To: Ben Pfaff ; Linhaifeng > Cc: d...@openvswitch.org; Lilijun (Jerry) ; Lichunhe > ; nd ; chenchanghu > ; i.maxim...@ovn.org > Subject: Re: [ovs

Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first

2020-06-03 Thread Linhaifeng
> -Original Message- > From: Ilya Maximets [mailto:i.maxim...@ovn.org] > Sent: Wednesday, June 3, 2020 6:50 PM > To: Linhaifeng ; Ben Pfaff > Cc: i.maxim...@ovn.org; d...@openvswitch.org; Lilijun (Jerry) > ; Lichunhe ; nd > ; chenchanghu > Subject: Re: [ovs

Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first

2020-06-03 Thread Linhaifeng
> -Original Message- > From: Ben Pfaff [mailto:b...@ovn.org] > Sent: Wednesday, June 3, 2020 1:26 PM > To: Linhaifeng > Cc: Yanqin Wei ; d...@openvswitch.org; nd > ; Lilijun (Jerry) ; chenchanghu > ; Lichunhe > Subject: Re: [ovs-dev] [PATCH v2] ovs rcu:

Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first

2020-06-02 Thread Linhaifeng
> -Original Message- > From: Ben Pfaff [mailto:b...@ovn.org] > Sent: Wednesday, June 3, 2020 8:35 AM > To: Yanqin Wei > Cc: Linhaifeng ; d...@openvswitch.org; nd > ; Lilijun (Jerry) ; chenchanghu > ; Lichunhe > Subject: Re: [ovs-dev] [PATCH v2] ovs rcu:

Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first

2020-06-02 Thread Linhaifeng
-Original Message- From: Yanqin Wei [mailto:yanqin@arm.com] Sent: Wednesday, June 3, 2020 7:23 AM To: Ben Pfaff ; Linhaifeng Cc: d...@openvswitch.org; nd ; Lilijun (Jerry) ; chenchanghu ; Lichunhe Subject: RE: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first Hi Ben

Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first

2020-06-02 Thread Linhaifeng
-Original Message- From: Ben Pfaff [mailto:b...@ovn.org] Sent: Wednesday, June 3, 2020 1:28 AM To: Linhaifeng Cc: Yanqin Wei ; d...@openvswitch.org; nd ; Lilijun (Jerry) ; chenchanghu ; Lichunhe Subject: Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first On Tue, Jun 02

[ovs-dev] [PATCH v3 5/5] classifier: fix conj_set use-after-free issue

2020-06-02 Thread Linhaifeng
use ovsrcu_set first then use ovsrcu_postpone CC: Ben Pfaff Fixes: 18080541d276 (\classifier: Add support for conjunctive matches.\) Acked-by: Yanqin Wei Signed-off-by: Linhaifeng --- lib/classifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/classifier.c b

[ovs-dev] [PATCH v3 4/5] ofproto: fix actions use-after-free issue

2020-06-02 Thread Linhaifeng
use ovsrcu_set first then use ovsrcu_postpone CC: Eelco Chaudron Fixes: f82b3b6a2f4d (\ofproto-dpif-upcall: Only call ovsrcu_postpone() on active actions\) Acked-by: Yanqin Wei Signed-off-by: Linhaifeng --- ofproto/ofproto-dpif-upcall.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

[ovs-dev] [PATCH v3 3/5] ofproto: fix vlans use-after-free issue

2020-06-02 Thread Linhaifeng
use ovsrcu_set first then use ovsrcu_postpone CC: Jarno Rajahalme Fixes: 4f6780691653 (\mirror: Allow concurrent lookups.\) Acked-by: Yanqin Wei Signed-off-by: Linhaifeng --- ofproto/ofproto-dpif-mirror.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ofproto/ofproto

[ovs-dev] [PATCH v3 2/5] pvector: fix pvector use-after-free issue

2020-06-02 Thread Linhaifeng
use ovsrcu_set first then use ovsrcu_postpone CC: Jarno Rajahalme Fixes: da9cfca6e2d7 (\Revert "pvector: Expose non-concurrent priority vector."\) Acked-by: Yanqin Wei Signed-off-by: Linhaifeng --- lib/pvector.c | 15 --- 1 file changed, 8 insertions(+), 7 deletion

[ovs-dev] [PATCH v3 1/5] ovs-rcu: fix rcu use-after-free issue

2020-06-02 Thread Linhaifeng
library.\) Acked-by: Yanqin Wei Signed-off-by: Linhaifeng --- lib/ovs-rcu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ovs-rcu.h b/lib/ovs-rcu.h index ecc4c9201..98c238aea 100644 --- a/lib/ovs-rcu.h +++ b/lib/ovs-rcu.h @@ -118,10 +118,10 @@ * void

[ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first

2020-06-02 Thread Linhaifeng
We should update rcu pointer first then use ovsrcu_postpone to free otherwise maybe cause use-after-free. e.g.,reader indicates momentary quiescent and access old pointer after writer postpone free old pointer and before setting new pointer. Signed-off-by: Linhaifeng --- lib/classifier.c

Re: [ovs-dev] [PATCH] ovs rcu: update rcu pointer first

2020-06-02 Thread Linhaifeng
Hi Yanqin, Thank you for your suggestions. I will send a new patch. -Original Message- From: Yanqin Wei [mailto:yanqin@arm.com] Sent: Tuesday, June 2, 2020 11:51 AM To: Linhaifeng ; d...@openvswitch.org Cc: nd Subject: RE: [PATCH] ovs rcu: update rcu pointer first Hi Haifeng

[ovs-dev] [PATCH] ovs rcu: update rcu pointer first

2020-05-31 Thread Linhaifeng
call ovsrcu_quiesce 4. thread B get the old pointer next round 5. thrad A call ovsrcu_quiesce, now all threads have called ovsrcu_quiesce 6. thread rcu free old pointer 7. thread B use-after-free Signed-off-by: Linhaifeng --- lib/classifier.c | 4 ++-- lib/ovs-rcu.h

[ovs-dev] [PATCH] ovs rcu: update rcu pointer first

2020-05-31 Thread Linhaifeng
We should update rcu pointer first then use ovsrcu_postpone to free otherwise maybe cause use-after-free. e.g, thead are two threads, A and B: 1. thread A call ovsrcu_postpone and flush cbset, have not call ovsrcu_quiesce 2. thread rcu wait all threads call ovsrcu_quiesce 3. thread B call

Re: [ovs-dev] [PATCH] ofproto: fix stack-buffer-overflow

2019-12-02 Thread Linhaifeng
Hi, Ben Pfaff Thank you. Give a like. > -Original Message- > From: Ben Pfaff [mailto:b...@ovn.org] > Sent: Tuesday, December 3, 2019 4:21 AM > To: Numan Siddique > Cc: Linhaifeng ; d...@openvswitch.org > Subject: Re: [ovs-dev] [PATCH] ofproto: fix stack-buffer-overflo

[ovs-dev] [PATCH] ofproto: fix stack-buffer-overflow

2019-11-28 Thread Linhaifeng
l init order: f6 Poisoned by user:f7 Container overflow: fc Array cookie:ac Intra object redzone:bb ASan internal: fe Left alloca redzone: ca Right alloca redzone:cb ==57189==ABORTING Signed-off-by: Linhaifeng --- ofproto/ofproto-dpif-

[ovs-dev] [PATCH] ofproto: fix stack-buffer-overflow

2019-11-28 Thread Linhaifeng
Should use flow->actions not >actions. Here is some print info for debug: @@@ flow->actions=0xb5e48844 len=196 @@@ stub=[0x7eefa120,0x7eefa918] actions->data=0x7eefa0a0 actions->size=196 actions->data != flow->actions and actions->data + 196 is in the range of stub . here is

[ovs-dev] 答复: [PATCH v2] netlink-notifier: support blacklist

2018-08-03 Thread Linhaifeng
hernet)but they don't need 'if change' notification. -邮件原件- 发件人: Ben Pfaff [mailto:b...@ovn.org] 发送时间: 2018年8月4日 8:25 收件人: Linhaifeng 抄送: d...@openvswitch.org 主题: Re: [PATCH v2] netlink-notifier: support blacklist On Fri, Aug 03, 2018 at 02:10:06PM +0800, Haifeng Lin wrote: > in dpdk

[ovs-dev] 答复: 答复: [bug] ovs crash when call xlate_normal_flood

2018-08-02 Thread Linhaifeng
Sorry . send wrong message. Pls igore. The problem is ousr code had 'use-after-free' -邮件原件- 发件人: Linhaifeng 发送时间: 2018年8月3日 13:55 收件人: 'Ben Pfaff' 抄送: d...@openvswitch.org 主题: 答复: [ovs-dev] 答复: [bug] ovs crash when call xlate_normal_flood Some PMD add to ovs dpdk aslo have linux

[ovs-dev] 答复: 答复: [bug] ovs crash when call xlate_normal_flood

2018-08-02 Thread Linhaifeng
Some PMD add to ovs dpdk aslo have linux if interface . Linux if interface would notice ovs to reconfig and would fail too when failed to add. -邮件原件- 发件人: Ben Pfaff [mailto:b...@ovn.org] 发送时间: 2018年7月11日 5:08 收件人: Linhaifeng 抄送: d...@openvswitch.org 主题: Re: [ovs-dev] 答复: [bug] ovs

[ovs-dev] 答复: [bug] ovs crash when call xlate_normal_flood

2018-06-28 Thread Linhaifeng
Sorry.This is not ovs‘s bug. 发件人: Linhaifeng 发送时间: 2018年6月21日 13:54 收件人: 'd...@openvswitch.org' 主题: 答复: [bug] ovs crash when call xlate_normal_flood Or stop upcall thread before xlate_remove_ofproto in destruct. 发件人: Linhaifeng 发送时间: 2018年6月21日 13:49 收件人: 'd...@openvswitch.org' mailto:d

[ovs-dev] 答复: 答复: [PATCH] dpif-netdev:Delete port check in do_add_port

2018-06-23 Thread Linhaifeng
It's good. If get_port_by_name in dpif-netdev use string hash replace of HMAP_FOR_EACH the performance would better. -邮件原件- 发件人: Ben Pfaff [mailto:b...@ovn.org] 发送时间: 2018年6月22日 6:56 收件人: Linhaifeng 抄送: d...@openvswitch.org 主题: Re: 答复: [ovs-dev] [PATCH] dpif-netdev:Delete port check

[ovs-dev] 答复: [PATCH] dpif-netdev:Delete port check in do_add_port

2018-06-21 Thread Linhaifeng
年5月10日 5:10 收件人: Linhaifeng 抄送: d...@openvswitch.org 主题: Re: [ovs-dev] [PATCH] dpif-netdev:Delete port check in do_add_port On Thu, Apr 26, 2018 at 03:12:51PM +0800, Haifeng Lin wrote: > It is not need check port exist in do_add_port because it had check in > port_add. > &g

[ovs-dev] 答复: [bug] ovs crash when call xlate_normal_flood

2018-06-20 Thread Linhaifeng
Or stop upcall thread before xlate_remove_ofproto in destruct. 发件人: Linhaifeng 发送时间: 2018年6月21日 13:49 收件人: 'd...@openvswitch.org' 主题: [bug] ovs crash when call xlate_normal_flood Should we use rwlock to use xbridge->xbundles? xbridge->xbundles may write in main thread and read in upcall

[ovs-dev] [bug] ovs crash when call xlate_normal_flood

2018-06-20 Thread Linhaifeng
Should we use rwlock to use xbridge->xbundles? xbridge->xbundles may write in main thread and read in upcall thread. The crash stack as follow: #5 0x004a04e8 in xlate_normal_flood (ctx=ctx@entry=0x7faeee7b6f30, in_xbundle=in_xbundle@entry=0x553d950, vlan=vlan@entry=0) at

[ovs-dev] 答复: [PATCH] dpif-netdev:Delete port check in do_add_port

2018-04-27 Thread Linhaifeng
Ping... -邮件原件- 发件人: Linhaifeng 发送时间: 2018年4月26日 15:13 收件人: d...@openvswitch.org 抄送: Linhaifeng <haifeng@huawei.com> 主题: [PATCH] dpif-netdev:Delete port check in do_add_port It is not need check port exist in do_add_port because it had check in port_add. Cha

Re: [ovs-dev] how to get packet information in ovs-dpdk?

2017-07-12 Thread linhaifeng
You can use dpdk tool 'pdump' to capture packets http://dpdk.org/doc/guides-16.07/sample_app_ug/pdump.html 在 2017/7/12 16:21, Sam 写道: > hi all, > > I'm running ovs-dpdk(ovs-2.4.9), I found the counter of bond port of br_t > is increasing, but I want to know what's these packets, how could I do

Re: [ovs-dev] [PATCH] netdev: fix crash when ifa_netmask is null

2017-07-12 Thread linhaifeng
在 2017/7/12 12:55, Ben Pfaff 写道: > On Tue, Jul 04, 2017 at 08:52:57AM +0800, Haifeng Lin wrote: >> The ifa_netmask is null when failed to call ioctl >> in getifaddrs >> >> Signed-off-by: Haifeng Lin > Thanks for figuring this out. > > What does it mean if ifa_netmask is