Re: [ovs-discuss] ovs-ofctl fails occasionally
Ben, > The following stopgap appears to fix the problem on master. I suspect > it could be easily backported as far as necessary. Does it work for you > too? Yes, it worked. Thank you for your support. Thanks, Ken On Thu, 28 Feb 2019 00:12:54 +, b...@ovn.org wrote in E-mail "Re: [ovs-discuss] ovs-ofctl fails occasionally": > On Wed, Feb 27, 2019 at 12:45:58PM +, Ken Ajiro wrote: > > > > Hello, > > > > When I use ovs-ofctl on OVS 2.10.1, it failed occasionally by error: > > > > ovs-ofctl: br0: failed to connect to socket (Broken pipe) > > > > This error is possible to be reproduced with: > > > > # while :; do /opt/nec/pf/ds/bin/ovs-ofctl --timeout=5 dump-flows br0 > > > /tmp/log || break; done; cat /tmp/log > > ovs-ofctl: br0: failed to connect to socket (Broken pipe) > > > > Also I tried with OVS 2.4.1 and could not reproduce this error. > > > > I think that recently rconn.c was modified on commit > > 476d2551abd2871696a64203f78d658ac2d7f32c > > and the connection for ofctl was changed it begins on state S_CONNECTING > > instead of S_ACTIVE. > > So timeout_CONNECTING will be applied for ofctl connection, however > > timeout_CONNECTING is 1 > > and this is too short (e.g. if transition time of CONNCTING was > > 12:00:00.999, it will be timed out > > after 1ms). I think that this is cause of occasionally disconnection of > > ofctl. > > Thanks for the report. > > It seems to me that the right long-term fix is to use higher resolution > (e.g. millisecond resolution) to measure the timeouts. However, that > will be a relatively large fix. > > The following stopgap appears to fix the problem on master. I suspect > it could be easily backported as far as necessary. Does it work for you > too? > > diff --git a/lib/rconn.c b/lib/rconn.c > index 48ae8c6a72e5..8ca23cbcfe90 100644 > --- a/lib/rconn.c > +++ b/lib/rconn.c > @@ -502,7 +502,7 @@ static unsigned int > timeout_CONNECTING(const struct rconn *rc) > OVS_REQUIRES(rc->mutex) > { > -return MAX(1, rc->backoff); > +return MAX(2, rc->backoff); > } > > static void ___ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
[ovs-discuss] ovs-ofctl fails occasionally
Hello, When I use ovs-ofctl on OVS 2.10.1, it failed occasionally by error: ovs-ofctl: br0: failed to connect to socket (Broken pipe) This error is possible to be reproduced with: # while :; do /opt/nec/pf/ds/bin/ovs-ofctl --timeout=5 dump-flows br0 > /tmp/log || break; done; cat /tmp/log ovs-ofctl: br0: failed to connect to socket (Broken pipe) Also I tried with OVS 2.4.1 and could not reproduce this error. I think that recently rconn.c was modified on commit 476d2551abd2871696a64203f78d658ac2d7f32c and the connection for ofctl was changed it begins on state S_CONNECTING instead of S_ACTIVE. So timeout_CONNECTING will be applied for ofctl connection, however timeout_CONNECTING is 1 and this is too short (e.g. if transition time of CONNCTING was 12:00:00.999, it will be timed out after 1ms). I think that this is cause of occasionally disconnection of ofctl. Thanks, -- Ken Ajiro ___ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
Re: [ovs-discuss] About ovs_vport_init() error
On Mon, 21 Jan 2019 19:17:58 +, gvrose8...@gmail.com wrote in E-mail "Re: [ovs-discuss] About ovs_vport_init() error": > >datapath/vport.c ovs_vport_init() > > > > err = ip6gre_init(); > > if (err && err != -EEXIST) { > > goto err_ip6gre; <== > > } else { > > if (err == -EEXIST) { > > pr_warn("IPv6 GRE/ERSPAN Rx mode is not supported\n"); > > goto skip_ip6_tunnel_init; > > } > > } > > > >datapath/linux/compat/ip6_gre.c rpl_ip6gre_init(): > > > > err = inet6_add_protocol(&ip6gre_protocol, IPPROTO_GRE); > > if (err < 0) { > > pr_info("%s: can't add protocol\n", __func__); <== > > unregister_pernet_device(&ip6gre_net_ops); > > goto ip6_gre_loaded; > > } > > > >I checked net/ipv6/protocol.c and understand that when > > inet6_add_protocol() failed it returns -1 (same to -EPERM) instead of > > -EEXIT. > > > >Is it needed checking if err is -EEXIT at ovs_vport_init() ? > > That's -EEXIST. Sorry, I spelled it wrong. > It looks to me like you have the gre and ip6_gre kernel > modules already loaded. Try unloading those first. Thank you for your advise. I'll try it. > Yes, special handling is required in that case. However I think that inet6_add_protocol() never return -EEXIST so I think that this special handling won't work. (It looks that inet6_add_protocol() returns only 0 or -1) int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char protocol) { return !cmpxchg((const struct inet6_protocol **)&inet6_protos[protocol], NULL, prot) ? 0 : -1; } Thanks, -- Ken Ajiro ___ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
[ovs-discuss] About ovs_vport_init() error
Hello, On my kernel 4.9.0 box, I could not insmod openvswitch.ko (OVS 2.10.1) by following error: openvswitch: LISP tunneling driver GRE over IPv4 demultiplexor driver can't add protocol Cannot take GRE protocol rx entry- The GRE/ERSPAN rx feature not supported openvswitch: GRE over IPv4 tunneling driver openvswitch: rpl_ip6gre_init: can't add protocol openvswitch: GRE TX only over IPv6 tunneling driver insmod: ERROR: could not insert module /tmp/openvswitch.ko: Operation not permitted I think that this error caused by following logic: datapath/vport.c ovs_vport_init() err = ip6gre_init(); if (err && err != -EEXIST) { goto err_ip6gre; <== } else { if (err == -EEXIST) { pr_warn("IPv6 GRE/ERSPAN Rx mode is not supported\n"); goto skip_ip6_tunnel_init; } } datapath/linux/compat/ip6_gre.c rpl_ip6gre_init(): err = inet6_add_protocol(&ip6gre_protocol, IPPROTO_GRE); if (err < 0) { pr_info("%s: can't add protocol\n", __func__); <== unregister_pernet_device(&ip6gre_net_ops); goto ip6_gre_loaded; } I checked net/ipv6/protocol.c and understand that when inet6_add_protocol() failed it returns -1 (same to -EPERM) instead of -EEXIT. Is it needed checking if err is -EEXIT at ovs_vport_init() ? Thanks, -- Ken Ajiro ___ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
[ovs-discuss] About controller rate limiting statistics
Hello, When I used controller packet-in rate limiting (controller_rate_limit in controller table), I found that incorrect statistics was increased. I think that following fix is needed. Thanks, -- Ken Ajiro diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 4b927d6..bfd1ff5 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -539,7 +539,7 @@ connmgr_get_controller_info(struct connmgr *mgr, struct shash *info) for (i = 0; i < N_SCHEDULERS; i++) { if (ofconn->schedulers[i]) { -const char *name = i ? "miss" : "action"; +const char *name = i == 0 ? "miss" : "action"; struct pinsched_stats stats; pinsched_get_stats(ofconn->schedulers[i], &stats); ___ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss