The declaration of 'get_max_ports()' to return odp_port_t adds
unwanted complexity to coding. This commit changes it back to
return uint32_t type.
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
return dpif_linux_port_query__(dpif, 0, devname, dpif_port);
}
return dpif_linux_port_query__(dpif, 0, devname, dpif_port);
}
dpif_linux_get_max_ports(const struct dpif *dpif OVS_UNUSED)
{
dpif_linux_get_max_ports(const struct dpif *dpif OVS_UNUSED)
{
- return u32_to_odp(MAX_PORTS);
dpif_netdev_get_max_ports(const struct dpif *dpif OVS_UNUSED)
{
dpif_netdev_get_max_ports(const struct dpif *dpif OVS_UNUSED)
{
- return u32_to_odp(MAX_PORTS);
/* Returns one greater than the largest port number accepted in flow
* actions. */
/* Returns one greater than the largest port number accepted in flow
* actions. */
- odp_port_t (*get_max_ports)(const struct dpif *dpif);
+ uint32_t (*get_max_ports)(const struct dpif *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
/* 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
/* Returns one greater than the maximum port number accepted in flow
* actions. */
/* Returns one greater than the maximum port number accepted in flow
* actions. */
dpif_get_max_ports(const struct dpif *dpif)
{
return dpif->dpif_class->get_max_ports(dpif);
dpif_get_max_ports(const struct dpif *dpif)
{
return dpif->dpif_class->get_max_ports(dpif);
struct dpif_port *);
int dpif_port_get_name(struct dpif *, odp_port_t port_no,
char *name, size_t name_size);
struct dpif_port *);
int dpif_port_get_name(struct dpif *, odp_port_t port_no,
char *name, size_t name_size);
-odp_port_t dpif_get_max_ports(const struct dpif *);
+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 {
uint32_t dpif_port_get_pid(const struct dpif *, odp_port_t port_no);
struct dpif_port_dump {
{
struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
struct shash_node *node, *next;
{
struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
struct shash_node *node, *next;
int error;
error = open_dpif_backer(ofproto->up.type, &ofproto->backer);
int error;
error = open_dpif_backer(ofproto->up.type, &ofproto->backer);
}
max_ports = dpif_get_max_ports(ofproto->backer->dpif);
}
max_ports = dpif_get_max_ports(ofproto->backer->dpif);
- ofproto_init_max_ports(ofproto_, u16_to_ofp(MIN(odp_to_u32(max_ports),
- ofp_to_u16(OFPP_MAX))));
+ ofproto_init_max_ports(ofproto_, MIN(max_ports, ofp_to_u16(OFPP_MAX)));
ofproto->netflow = NULL;
ofproto->sflow = NULL;
ofproto->netflow = NULL;
ofproto->sflow = NULL;