[ovs-dev] [netlink v5 46/61] datapath: Get rid of ODPP_NONE.
Ben Pfaff
blp at nicira.com
Thu Jan 27 00:23:29 UTC 2011
This definition wasn't actually useful for the kernel--the only place that
it was used it didn't really have to be, so this commit removes it from
datapath-protocol.h. It is still marginally useful in userspace, at least
as a value that converts to and from OpenFlow port number OFPP_NONE, so
move it to odp-util.c.
Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Jesse Gross <jesse at nicira.com>
---
datapath/datapath.c | 2 +-
include/openvswitch/datapath-protocol.h | 1 -
lib/odp-util.h | 2 ++
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/datapath/datapath.c b/datapath/datapath.c
index d4d6811..95449f6 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -296,7 +296,7 @@ void dp_process_received_packet(struct vport *p, struct sk_buff *skb)
bool is_frag;
/* Extract flow from 'skb' into 'key'. */
- error = flow_extract(skb, p ? p->port_no : ODPP_NONE, &key, &is_frag);
+ error = flow_extract(skb, p->port_no, &key, &is_frag);
if (unlikely(error)) {
kfree_skb(skb);
return;
diff --git a/include/openvswitch/datapath-protocol.h b/include/openvswitch/datapath-protocol.h
index 0aa6cd6..d76b547 100644
--- a/include/openvswitch/datapath-protocol.h
+++ b/include/openvswitch/datapath-protocol.h
@@ -137,7 +137,6 @@ struct odp_stats {
/* Logical ports. */
#define ODPP_LOCAL ((uint16_t)0)
-#define ODPP_NONE ((uint16_t)-1)
/* Listening channels. */
#define _ODPL_MISS_NR 0 /* Packet missed in flow table. */
diff --git a/lib/odp-util.h b/lib/odp-util.h
index a7c0982..1a0d58d 100644
--- a/lib/odp-util.h
+++ b/lib/odp-util.h
@@ -30,6 +30,8 @@ struct ds;
struct flow;
struct ofpbuf;
+#define ODPP_NONE ((uint16_t) -1)
+
static inline uint16_t
ofp_port_to_odp_port(uint16_t ofp_port)
{
--
1.7.1
More information about the dev
mailing list