[ovs-discuss] reply: ovs_assert when do classifier_insert: classifier.c:236: assertion !displaced_rule failed in classifier_insert()

Ben Pfaff blp at ovn.org
Sat Aug 5 18:04:16 UTC 2017


I'm sorry, I can't help with OVS 2.0.  It is too old.  I recommend
upgrading.

On Sat, Aug 05, 2017 at 12:34:49PM +0000, Yangxiaoliang (Neo) wrote:
> Hello Ben,
> 
> I'm looking this problem with yinpeijun. Our ovs code is almost same with the latest ovs 2.0 branch. We found no patch related to this problem. We hope to get some advice from you. We are looking forward to your reply. Thanks.
> 
> The calling functions are as follows: handle_flow_miss->facet_lookup_valid->facet_create->classifier_insert. 
> There is an assert error: classifier.c:236: assertion !displaced_rule failed in classifier_insert(). 
> 
> ==Related functions:
> static void
> handle_flow_miss(struct flow_miss *miss, struct flow_miss_op *ops,
>                  size_t *n_ops)
> {
>     struct facet *facet;
> 
>     miss->ofproto->n_missed += list_size(&miss->packets);
> 
>     facet = facet_lookup_valid(miss->ofproto, &miss->flow);
>     if (!facet) { //**** facet is NULL, take this branch
>         if (miss->key_fitness == ODP_FIT_TOO_LITTLE //**** miss->key_fitness=ODP_FIT_PERFECT
>             || !flow_miss_should_make_facet(miss)) {
>             return;
>         }
> 
>         facet = facet_create(miss); //**** take this line
>     }
>     handle_flow_miss_with_facet(miss, facet, ops, n_ops);
> }
> 
> static struct facet *
> facet_lookup_valid(struct ofproto_dpif *ofproto, const struct flow *flow)
> {
>     struct facet *facet;
> 
>     facet = facet_find(ofproto, flow); //**** facet is found
>     if (facet
>         && ofproto->backer->need_revalidate
>         && !facet_revalidate(facet)) { //**** facet_revalidate has been called.
>         return NULL;  //**** take this line
>     }
> 
>     return facet;
> }
> 
> ==In the core file, we found 2 same rules. After analyzing the ovs 2.0.2 code for a long time, we have no idea about how does this happen? 
> //new rule
> (gdb) p *rule
> $2 = {hmap_node = {hash = 2324087362, next = 0x0}, list = {prev = 0x7f230c603258, next = 0x7f230c603258}, match = {
>     flow = {values = 0x7f230c603270, inline_values = {2, 8, 3301985768, 1278747220, 3813303887, 0, 0, 0}, map = {
>         0, 1825}}, mask = {masks = {values = 0x7f230c6032a0, inline_values = {4294967295, 4294967295, 4280221696, 
>           65535, 4294967295, 4294967295, 4294967295, 50331648}, map = {1048576, 18225}}}}, priority = 32768}
> //old rule
> (gdb) p *displaced_rule
> $4 = {hmap_node = {hash = 2324087362, next = 0x0}, list = {prev = 0x7f230c603258, next = 0x7f230c173d38}, match = {
>     flow = {values = 0x7f230c173d50, inline_values = {2, 8, 3301985768, 1278747220, 3813303887, 0, 0, 0}, map = {
>         0, 1825}}, mask = {masks = {values = 0x7f230c173d80, inline_values = {4294967295, 4294967295, 4280221696, 
>           65535, 4294967295, 4294967295, 4294967295, 50331648}, map = {1048576, 18225}}}}, priority = 32768}
> 
> 
> -----Original Message-----
> From: Yinpeijun 
> Sent: Thursday, August 03, 2017 11:06 AM
> To: Ben Pfaff <blp at ovn.org>
> Cc: ovs-discuss at openvswitch.org; lixiao (H) <lixiao91 at huawei.com>; gaoxiaoqiu <gaoxiaoqiu at huawei.com>; Lichunhe <lichunhe at huawei.com>; Chentao (Boby) <boby.chen at huawei.com>; Yangxiaoliang (Neo) <david.yangxiaoliang at huawei.com>
> Subject: reply: [ovs-discuss] ovs_assert when do classifier_insert
> 
> 
> >>On Thu, Aug 03, 2017 at 02:04:34AM +0000, Yinpeijun wrote:
> >>                    Recently, there's been a problem when I use ovs,  
> >>the problem is ovs_assert when do classifier_insert. I read the source  
> >>code and annotation, but I don't understand how the problem is been  
> >>triggered.
> 
> >Can you provide a backtrace?  Which assertion is failing?  When did this start?
> 
>  Thank you for your reply, Ben.
>  
> I use ovs2.0.2(may be too old) and backtrace as follow:
>  #0  0x00007f2315a98875 in raise () from /lib64/libc.so.6
>  #1  0x00007f2315a99e51 in abort () from /lib64/libc.so.6
>  #2  0x00000000004d64ff in ovs_abort_valist (err_no=0, format=0x5577e0 "%s: assertion %s failed in %s()",
>     args=0x7ffc597e57a0) at lib/util.c:243
>  #3  0x00000000004dcd8a in vlog_abort_valist (module_=0x7cdae0 <VLM_util>,
>     message=0x5577e0 "%s: assertion %s failed in %s()", args=0x7ffc597e57a0) at lib/vlog.c:944
>  #4  0x00000000004dce6d in vlog_abort (module=0x7cdae0 <VLM_util>,
>     message=0x5577e0 "%s: assertion %s failed in %s()") at lib/vlog.c:958
>  #5  0x00000000004d5f50 in ovs_assert_failure (where=0x53d3c2 "lib/classifier.c:236",
>     function=0x53d3a0 <__func__.10702> "classifier_insert", condition=0x53d3b2 "!displaced_rule") at lib/util.c:66
>  #6  0x0000000000457f16 in classifier_insert (cls=0xa2ff48, rule=0x7f230c603248) at lib/classifier.c:236
>  #7  0x000000000042cdb2 in facet_create (miss=0xb68c10) at ofproto/ofproto_dpif.c:4444
>  #8  0x000000000042b6de in handle_flow_miss (miss=0xb68c10, ops=0x7ffc597e5cb0, n_ops=0x7ffc597e5b18)
>     at ofproto/ofproto_dpif.c:3826
>  #9  0x000000000042b9eb in handle_flow_misses (backer=0xcce850, fmb=0xb68c00) at ofproto/ofproto_dpif.c:3886
>  #10 0x000000000042c0a6 in handle_upcalls (backer=0xcce850) at ofproto/ofproto_dpif.c:4047
>  #11 0x00000000004254c8 in dpif_backer_run_fast (backer=0xcce850) at ofproto/ofproto_dpif.c:1155
>  #12 0x0000000000425506 in type_run_fast (type=0x7f230c52fc20 "system") at ofproto/ofproto_dpif.c:1172
>  #13 0x0000000000418db9 in ofproto_type_run_fast (datapath_type=0x7f230c52fc20 "system") at ofproto/ofproto.c:1462
>  #14 0x000000000040e0dd in bridge_run_fast () at vswitchd/bridge.c:2493
> 
>  I've been using ovs2.0.2 for more than one year, it happened recently in my  lab environment.
>   
>  And I was a little confused, there is only one thread to process the classifier insert , why need  to lock it ?


More information about the discuss mailing list