From: Ben Pfaff Date: Wed, 17 Jun 2009 21:18:10 +0000 (-0700) Subject: dpif: Rename odp_msg related functions for more consistency. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f24562aed1ad5d80eebf9c6430deb3d900c3e71;p=openvswitch dpif: Rename odp_msg related functions for more consistency. This seems like a more consistent naming scheme, since all of these functions are related but none of them were named similarly or grouped together. --- diff --git a/lib/dpif.c b/lib/dpif.c index b538c4ca..09a47d2f 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -218,25 +218,7 @@ dpif_set_drop_frags(struct dpif *dpif, bool drop_frags) } int -dpif_get_listen_mask(const struct dpif *dpif, int *listen_mask) -{ - int error = do_ioctl(dpif, ODP_GET_LISTEN_MASK, "ODP_GET_LISTEN_MASK", - listen_mask); - if (error) { - *listen_mask = 0; - } - return error; -} - -int -dpif_set_listen_mask(struct dpif *dpif, int listen_mask) -{ - return do_ioctl(dpif, ODP_SET_LISTEN_MASK, "ODP_SET_LISTEN_MASK", - &listen_mask); -} - -int -dpif_purge(struct dpif *dpif) +dpif_recv_purge(struct dpif *dpif) { struct odp_stats stats; unsigned int i; @@ -659,6 +641,24 @@ dpif_execute(struct dpif *dpif, uint16_t in_port, return error; } +int +dpif_recv_get_mask(const struct dpif *dpif, int *listen_mask) +{ + int error = do_ioctl(dpif, ODP_GET_LISTEN_MASK, "ODP_GET_LISTEN_MASK", + listen_mask); + if (error) { + *listen_mask = 0; + } + return error; +} + +int +dpif_recv_set_mask(struct dpif *dpif, int listen_mask) +{ + return do_ioctl(dpif, ODP_SET_LISTEN_MASK, "ODP_SET_LISTEN_MASK", + &listen_mask); +} + int dpif_recv(struct dpif *dpif, struct ofpbuf **bufp) { diff --git a/lib/dpif.h b/lib/dpif.h index a7677883..c4619c9b 100644 --- a/lib/dpif.h +++ b/lib/dpif.h @@ -42,10 +42,6 @@ int dpif_get_dp_stats(const struct dpif *, struct odp_stats *); int dpif_get_drop_frags(const struct dpif *, bool *drop_frags); int dpif_set_drop_frags(struct dpif *, bool drop_frags); -int dpif_get_listen_mask(const struct dpif *, int *listen_mask); -int dpif_set_listen_mask(struct dpif *, int listen_mask); -int dpif_purge(struct dpif *); - int dpif_port_add(struct dpif *, const char *devname, uint16_t port_no, uint16_t flags); int dpif_port_del(struct dpif *, uint16_t port_no); @@ -76,7 +72,10 @@ int dpif_execute(struct dpif *, uint16_t in_port, const union odp_action[], size_t n_actions, const struct ofpbuf *); +int dpif_recv_get_mask(const struct dpif *, int *listen_mask); +int dpif_recv_set_mask(struct dpif *, int listen_mask); int dpif_recv(struct dpif *, struct ofpbuf **); +int dpif_recv_purge(struct dpif *); void dpif_recv_wait(struct dpif *); void dpif_get_netflow_ids(const struct dpif *, diff --git a/secchan/ofproto.c b/secchan/ofproto.c index b82ccb3b..28568461 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -280,7 +280,7 @@ ofproto_create(const char *datapath, const struct ofhooks *ofhooks, void *aux, dpif_close(dpif); return error; } - error = dpif_set_listen_mask(dpif, ODPL_MISS | ODPL_ACTION); + error = dpif_recv_set_mask(dpif, ODPL_MISS | ODPL_ACTION); if (error) { VLOG_ERR("failed to listen on datapath %s: %s", datapath, strerror(error)); @@ -288,7 +288,7 @@ ofproto_create(const char *datapath, const struct ofhooks *ofhooks, void *aux, return error; } dpif_flow_flush(dpif); - dpif_purge(dpif); + dpif_recv_purge(dpif); /* Start monitoring datapath ports for status changes. */ error = dpifmon_create(datapath, &dpifmon);