From 9f5bbb005cde84505e112495e59604bf62e580ff Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Tue, 5 Nov 2013 10:39:47 -0800 Subject: [PATCH] ofproto-dpif: Disassociate datapath max_ports with openflow port numbers. With single datapath, multiple userspace bridges share the same datapath. As such it does not look beneficial that we decide a valid open flow port number based on the number of ports in the datapath specially now that we have the ofport_request column in OVSDB. This commit does not remove ofproto_init_max_ports() interface as defined in ofproto-provider.h as there may be other implementations that still use it. But ofproto-dpif should not need it. Bug #20163. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- lib/dpif.c | 8 -------- lib/dpif.h | 1 - ofproto/ofproto-dpif.c | 4 ---- 3 files changed, 13 deletions(-) diff --git a/lib/dpif.c b/lib/dpif.c index ed84f5fcf..783a7cb77 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -632,14 +632,6 @@ dpif_port_query_by_name(const struct dpif *dpif, const char *devname, return error; } -/* Returns one greater than the maximum port number accepted in flow - * actions. */ -uint32_t -dpif_get_max_ports(const struct dpif *dpif) -{ - return dpif->dpif_class->get_max_ports(dpif); -} - /* Returns the Netlink PID value to supply in OVS_ACTION_ATTR_USERSPACE actions * as the OVS_USERSPACE_ATTR_PID attribute's value, for use in flows whose * packets arrived on port 'port_no'. diff --git a/lib/dpif.h b/lib/dpif.h index de7450a2f..6db6ad38b 100644 --- a/lib/dpif.h +++ b/lib/dpif.h @@ -418,7 +418,6 @@ int dpif_port_query_by_name(const struct dpif *, const char *devname, struct dpif_port *); int dpif_port_get_name(struct dpif *, odp_port_t port_no, char *name, size_t name_size); -uint32_t dpif_get_max_ports(const struct dpif *); uint32_t dpif_port_get_pid(const struct dpif *, odp_port_t port_no); struct dpif_port_dump { diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 9756480d0..da27f6a11 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1233,7 +1233,6 @@ construct(struct ofproto *ofproto_) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); struct shash_node *node, *next; - uint32_t max_ports; int error; error = open_dpif_backer(ofproto->up.type, &ofproto->backer); @@ -1241,9 +1240,6 @@ construct(struct ofproto *ofproto_) return error; } - max_ports = dpif_get_max_ports(ofproto->backer->dpif); - ofproto_init_max_ports(ofproto_, MIN(max_ports, ofp_to_u16(OFPP_MAX))); - ofproto->netflow = NULL; ofproto->sflow = NULL; ofproto->ipfix = NULL; -- 2.43.0