On May 20, 2014, at 4:03 PM, Jarno Rajahalme <jrajaha...@nicira.com> wrote:
> > On May 8, 2014, at 4:50 PM, Ben Pfaff <b...@nicira.com> wrote: > >> Signed-off-by: Ben Pfaff <b...@nicira.com> >> --- >> lib/dpif-netdev.c | 163 >> +++++++++++++++++++++++++++-------------------------- >> 1 file changed, 82 insertions(+), 81 deletions(-) >> >> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c >> index 55712dd..b682876 100644 >> --- a/lib/dpif-netdev.c >> +++ b/lib/dpif-netdev.c >> @@ -32,6 +32,7 @@ >> > > (snip) > >> static void >> -port_unref(struct dp_netdev_port *port) >> +port_destroy__(struct dp_netdev_port *port) >> { >> - if (port && ovs_refcount_unref(&port->ref_cnt) == 1) { >> - int i; >> + int i; >> >> - netdev_close(port->netdev); >> - netdev_restore_flags(port->sf); >> + netdev_close(port->netdev); >> + netdev_restore_flags(port->sf); >> >> - for (i = 0; i < netdev_n_rxq(port->netdev); i++) { >> - netdev_rxq_close(port->rxq[i]); >> - } >> - free(port->type); >> - free(port); >> + for (i = 0; i < netdev_n_rxq(port->netdev); i++) { >> + netdev_rxq_close(port->rxq[i]); > > Running with the v1, I saw a core here. It appears that the port->netdev is > freed before the postponed port_destroy__ is executed. Maybe the netdev > deletion needs also be ovsrcu_postponed()? > Or maybe the closing stuff should really be done when unreeling, and only the freeing of memory should be postponed? > Jarno > >> + } >> + free(port->type); >> + free(port); >> +} >> + >> +static void >> +port_unref(struct dp_netdev_port *port) >> +{ >> + if (port && ovs_refcount_unref(&port->ref_cnt) == 1) { >> + ovsrcu_postpone(port_destroy__, port); >> } >> } > > > Jarno > _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev