aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2013-06-22 10:33:27 -0700
committerEthan Jackson <ethan@nicira.com>2013-06-24 14:15:50 -0700
commitf9c0c3eccdb8e14dc8fbf572e515dbef1eb7b2ee (patch)
tree620c68eed5586228e8aea554e812d3152ad39fe8 /vswitchd
parent7894e7daad4bc780dc3386bf2c28cafdc0692016 (diff)
flow: New function hash_ofp_port() and hash_ofp_port().
These functions are used so often, that having an easy to read helper is worth it. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 6f573df8..abae7f58 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1285,7 +1285,7 @@ iface_set_ofp_port(struct iface *iface, ofp_port_t ofp_port)
ovs_assert(iface->ofp_port == OFPP_NONE && ofp_port != OFPP_NONE);
iface->ofp_port = ofp_port;
hmap_insert(&br->ifaces, &iface->ofp_port_node,
- hash_int(ofp_to_u16(ofp_port), 0));
+ hash_ofp_port(ofp_port));
iface_set_ofport(iface->cfg, ofp_port);
}
@@ -3485,8 +3485,7 @@ iface_from_ofp_port(const struct bridge *br, ofp_port_t ofp_port)
{
struct iface *iface;
- HMAP_FOR_EACH_IN_BUCKET (iface, ofp_port_node,
- hash_int(ofp_to_u16(ofp_port), 0),
+ HMAP_FOR_EACH_IN_BUCKET (iface, ofp_port_node, hash_ofp_port(ofp_port),
&br->ifaces) {
if (iface->ofp_port == ofp_port) {
return iface;