X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif.c;h=649c2464c8aae38a11a3f0e7f23ab10640ad448f;hb=5f21d20e65f1846c346704ac7c749a3f0ad8660e;hp=73fa4b98375d9614f8a0396df16487e1904a34b1;hpb=3b01baa3970139c3a195017ab1ea3e42761e3db2;p=openvswitch diff --git a/lib/dpif.c b/lib/dpif.c index 73fa4b98..649c2464 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -65,8 +65,8 @@ static void check_rw_odp_flow(struct odp_flow *); /* Performs periodic work needed by all the various kinds of dpifs. * - * If your program opens any dpifs, it must call this function within its main - * poll loop. */ + * If your program opens any dpifs, it must call both this function and + * netdev_run() within its main poll loop. */ void dp_run(void) { @@ -81,8 +81,8 @@ dp_run(void) /* Arranges for poll_block() to wake up when dp_run() needs to be called. * - * If your program opens any dpifs, it must call this function within its main - * poll loop. */ + * If your program opens any dpifs, it must call both this function and + * netdev_wait() within its main poll loop. */ void dp_wait(void) { @@ -95,9 +95,9 @@ dp_wait(void) } } -/* Initializes 'all_dps' and enumerates the names of all known created - * datapaths, where possible, into it. Returns 0 if successful, otherwise a - * positive errno value. +/* Clears 'all_dps' and enumerates the names of all known created datapaths, + * where possible, into it. The caller must first initialize 'all_dps'. + * Returns 0 if successful, otherwise a positive errno value. * * Some kinds of datapaths might not be practically enumerable. This is not * considered an error. */ @@ -107,7 +107,7 @@ dp_enumerate(struct svec *all_dps) int error; int i; - svec_init(all_dps); + svec_clear(all_dps); error = 0; for (i = 0; i < N_DPIF_CLASSES; i++) { const struct dpif_class *class = dpif_classes[i]; @@ -397,7 +397,7 @@ dpif_port_list(const struct dpif *dpif, struct odp_port **portsp, size_t *n_portsp) { struct odp_port *ports; - size_t n_ports; + size_t n_ports = 0; int error; for (;;) {