diff options
author | Justin Pettit <jpettit@nicira.com> | 2012-09-25 15:25:51 -0700 |
---|---|---|
committer | Justin Pettit <jpettit@nicira.com> | 2012-11-01 22:54:27 -0700 |
commit | ddbfda846297ab9e89ed9c3f844a8eff86692275 (patch) | |
tree | 5ac2667bc4c7d94236f749017c41e11ef88dc854 /lib/dpif-netdev.c | |
parent | 9b56fe137d3c734edcfa00631a960920f04c866a (diff) |
Use ODP ports in dpif layer and below.
The current code has a simple mapping between datapath and OpenFlow port
numbers (the port numbers were the same other than OFPP_LOCAL which maps
to datapath port 0). Since the translation was know at compile time,
this allowed different layers to easily translate between the two, so
the translation often occurred late.
A future commit will break this simple mapping, so this commit draws a
line between where datapath and OpenFlow port numbers are used. The
ofproto-dpif layer will be responsible for the translations. Callers
above will use OpenFlow port numbers. Providers below will use
datapath port numbers.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'lib/dpif-netdev.c')
-rw-r--r-- | lib/dpif-netdev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 9ebf3552..08f3abf5 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -866,7 +866,7 @@ dpif_netdev_flow_dump_next(const struct dpif *dpif, void *state_, struct ofpbuf buf; ofpbuf_use_stack(&buf, &state->keybuf, sizeof state->keybuf); - odp_flow_key_from_flow(&buf, &flow->key); + odp_flow_key_from_flow(&buf, &flow->key, flow->key.in_port); *key = buf.data; *key_len = buf.size; @@ -1014,7 +1014,7 @@ dp_netdev_port_input(struct dp_netdev *dp, struct dp_netdev_port *port, if (packet->size < ETH_HEADER_LEN) { return; } - flow_extract(packet, 0, NULL, odp_port_to_ofp_port(port->port_no), &key); + flow_extract(packet, 0, NULL, port->port_no, &key); flow = dp_netdev_lookup_flow(dp, &key); if (flow) { dp_netdev_flow_used(flow, packet); @@ -1104,7 +1104,7 @@ dp_netdev_output_userspace(struct dp_netdev *dp, const struct ofpbuf *packet, buf = &u->buf; ofpbuf_init(buf, ODPUTIL_FLOW_KEY_BYTES + 2 + packet->size); - odp_flow_key_from_flow(buf, flow); + odp_flow_key_from_flow(buf, flow, flow->in_port); key_len = buf->size; ofpbuf_pull(buf, key_len); ofpbuf_reserve(buf, 2); |