aboutsummaryrefslogtreecommitdiff
path: root/lib/odp-util.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-05-11 12:13:10 -0700
committerBen Pfaff <blp@nicira.com>2011-05-11 12:35:09 -0700
commitabe529af477b8311a1fd68c130374bd7442003c3 (patch)
tree49101f12f5b35574965df39b1cc5a72f5b28f02d /lib/odp-util.c
parentf79e673f3d3f429cd213043b054c904d23c7151a (diff)
ofproto: Break apart into generic and hardware-specific parts.
In addition to the changes to ofproto, this commit changes all of the instances of "struct flow" in the tree so that the "in_port" member is an OpenFlow port number. Previously, this member was an OpenFlow port number in some cases and an ODP port number in other cases.
Diffstat (limited to 'lib/odp-util.c')
-rw-r--r--lib/odp-util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/odp-util.c b/lib/odp-util.c
index e82006bc..79f4bfc7 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -403,7 +403,8 @@ odp_flow_key_from_flow(struct ofpbuf *buf, const struct flow *flow)
nl_msg_put_be64(buf, ODP_KEY_ATTR_TUN_ID, flow->tun_id);
}
- nl_msg_put_u32(buf, ODP_KEY_ATTR_IN_PORT, flow->in_port);
+ nl_msg_put_u32(buf, ODP_KEY_ATTR_IN_PORT,
+ ofp_port_to_odp_port(flow->in_port));
eth_key = nl_msg_put_unspec_uninit(buf, ODP_KEY_ATTR_ETHERNET,
sizeof *eth_key);
@@ -551,7 +552,7 @@ odp_flow_key_to_flow(const struct nlattr *key, size_t key_len,
if (nl_attr_get_u32(nla) >= UINT16_MAX) {
return EINVAL;
}
- flow->in_port = nl_attr_get_u32(nla);
+ flow->in_port = odp_port_to_ofp_port(nl_attr_get_u32(nla));
break;
case TRANSITION(ODP_KEY_ATTR_IN_PORT, ODP_KEY_ATTR_ETHERNET):