[ovs-dev] [BUG][meter] ovs crash when add meter openflow

2024-06-11 Thread Simon Jones
Hi all, I'm using ovs-dpdk with this patch: ``` commit 4c226944f7c55c9d6e7c85f7c33c5ce11c35ce54 Author: Jianbo Liu Date: Fri Jul 8 03:06:26 2022 + netdev-offload-tc: Implement meter offload API for tc ``` This patch is for offload flow meter by tc. Now I found a bug: ovs crash when ad

Re: [ovs-dev] [BUG][meter] ovs crash when add meter openflow

2024-06-14 Thread Simon Jones
Maybe reason is this: ``` @netdev_offload_tc and @netdev_offload_dpdk will always be register. Then the @meter_set api will be called. The @meter_set could be called only after @init_flow_api, but the BUG happens when @meter_set is called before @init_flow_api is called. Check these code: static

Re: [ovs-dev] [BUG][meter] ovs crash when add meter openflow

2024-06-14 Thread Simon Jones
``` Date: Fri Jun 14 19:25:43 2024 +0800 bugfix of meter tc crash. diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c index 9fde5f7a9..d08c5a35f 100644 --- a/lib/netdev-offload.c +++ b/lib/netdev-offload.c @@ -186,7 +186,6 @@ netdev_assign_flow_api(struct netdev *netdev)

Re: [ovs-dev] [BUG][meter] ovs crash when add meter openflow

2024-06-14 Thread Ilya Maximets
On 6/14/24 13:33, Simon Jones wrote: > ``` > Date: Fri Jun 14 19:25:43 2024 +0800 > > bugfix of meter tc crash. > > diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c > index 9fde5f7a9..d08c5a35f 100644 > --- a/lib/netdev-offload.c > +++ b/lib/netdev-offload.c > @@ -186,7 +186,6 @@ ne

Re: [ovs-dev] [BUG][meter] ovs crash when add meter openflow

2024-06-16 Thread Simon Jones
Oh, I'm using ovs-2.17.2, and I found that there is no .meter_set api implement in ovs-dpdk, which means only one .meter_set implement in TC. ``` const struct netdev_flow_api netdev_offload_dpdk = { .type = "dpdk_flow_api", .flow_put = netdev_offload_dpdk_flow_put, .flow_del = netdev_of

Re: [ovs-dev] [BUG][meter] ovs crash when add meter openflow

2024-06-16 Thread Simon Jones
I found another cause of this BUG: ``` In public-ovs code, @netdev_offload_dpdk and @netdev_offload_tc is register in @netdev_register_flow_api_provider. The @netdev_register_flow_api_provider is called in init stage, like @dpdk_init__ and @netdev_initialize. After register, @netdev_offload_dpdk an

Re: [ovs-dev] [BUG][meter] ovs crash when add meter openflow

2024-06-17 Thread Simon Jones
I use this patch to try to fix BUG, I test several times, it's OK ``` [root@bogon yusur_ovs]# git diff diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c index b000aee..3330cb2 100644 --- a/lib/netdev-offload-tc.c +++ b/lib/netdev-offload-tc.c @@ -86,6 +86,8 @@ static struct hmap meter_

Re: [ovs-dev] [BUG][meter] ovs crash when add meter openflow

2024-06-17 Thread Simon Jones
This patch: ``` $ git diff diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c index b000aeea8..74fd7c11b 100644 --- a/lib/netdev-offload-tc.c +++ b/lib/netdev-offload-tc.c @@ -86,6 +86,8 @@ static struct hmap meter_id_to_police_idx OVS_GUARDED_BY(meter_mutex) = HMAP_INITIALIZER(&me

Re: [ovs-dev] [BUG][meter] ovs crash when add meter openflow

2024-06-17 Thread Simon Jones
It's PR: Bugfix of meter_set crash. by batmancn · Pull Request #425 · openvswitch/ovs (github.com) Simon Jones Simon Jones 于2024年6月17日周一 15:35写道: > This patch: > ``` > $ git diff > diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c