netdev: Map to OpenFlow port for flow lookup
authorEd Maste <emaste@freebsd.org>
Wed, 15 Aug 2012 22:00:34 +0000 (22:00 +0000)
committerBen Pfaff <blp@nicira.com>
Wed, 15 Aug 2012 23:07:54 +0000 (16:07 -0700)
In the flow hash special ports are stored using OpenFlow constants.
For example the "local port" is stored as 0xfffe (OFPP_LOCAL).

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/dpif-netdev.c

index 60fae5fad5b32247ba5689f10e0c7c12e3292892..7fa272084bfe41c3e751b50af919b048a58d696f 100644 (file)
@@ -1011,7 +1011,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, 0, port->port_no, &key);
+    flow_extract(packet, 0, 0, odp_port_to_ofp_port(port->port_no), &key);
     flow = dp_netdev_lookup_flow(dp, &key);
     if (flow) {
         dp_netdev_flow_used(flow, &key, packet);