Skip to content

Commit

Permalink
Merge "Waiting for completion of asynchronous events as part of soft …
Browse files Browse the repository at this point in the history
…reset" into R2.21.x
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 24, 2016
2 parents dfed394 + a90bf7e commit 5d564a3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dp-core/vrouter.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,13 @@ vrouter_exit(bool soft_reset)
if (modules[i].shut)
modules[i].shut(&router);

/* After all the modules are shut: Vrouter is really not ready */
/* Mark that vrouter is no more ready as shut is already done */
vr_not_ready = true;

/* Flush the previous ashynchronous events, before init */
if (vr_soft_reset)
vr_soft_reset(&router);

for (i = VR_NUM_MODULES - 1; i >= 0; --i) {
modules[i].exit(&router, soft_reset);
}
Expand Down
2 changes: 2 additions & 0 deletions include/vrouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ struct host_os {
void (*hos_del_mpls)(struct vrouter *, unsigned);
int (*hos_enqueue_to_assembler)(struct vrouter *, struct vr_packet *,
struct vr_forwarding_md *);
void (*hos_soft_reset)(struct vrouter *);
};

#define vr_printf vrouter_host->hos_printf
Expand Down Expand Up @@ -157,6 +158,7 @@ struct host_os {
#define vr_pkt_may_pull vrouter_host->hos_pkt_may_pull
#define vr_gro_process vrouter_host->hos_gro_process
#define vr_enqueue_to_assembler vrouter_host->hos_enqueue_to_assembler
#define vr_soft_reset vrouter_host->hos_soft_reset

struct vrouter {
unsigned char vr_vrrp_mac[VR_ETHER_ALEN];
Expand Down
10 changes: 10 additions & 0 deletions linux/vrouter_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -2354,6 +2354,15 @@ lh_create_timer(struct vr_timer *vtimer)
return 0;
}

static void
lh_soft_reset(struct vrouter *router)
{
flush_scheduled_work();
rcu_barrier();

return;
}

struct host_os linux_host = {
.hos_printf = lh_printk,
.hos_malloc = lh_malloc,
Expand Down Expand Up @@ -2398,6 +2407,7 @@ struct host_os linux_host = {
.hos_pkt_may_pull = lh_pkt_may_pull,
.hos_gro_process = lh_gro_process,
.hos_enqueue_to_assembler = lh_enqueue_to_assembler,
.hos_soft_reset = lh_soft_reset,
};

struct host_os *
Expand Down

0 comments on commit 5d564a3

Please sign in to comment.