2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-15 14:17:18 +00:00

dpif: Abstract translation from OpenFlow queue ID into ODP priority value.

When the QoS code was integrated, I didn't yet know how to abstract the
translation from a queue ID in an OpenFlow OFPAT_ENQUEUE action into a
priority value for an ODP ODPAT_SET_PRIORITY action.  This commit is a
first attempt that works OK for Linux, so far.  It's possible that in fact
this translation needs the 'netdev' as an argument too, but it's not needed
yet.
This commit is contained in:
Ben Pfaff
2010-07-20 11:23:21 -07:00
parent c4d279ab34
commit aae51f5335
6 changed files with 68 additions and 12 deletions

View File

@@ -1096,6 +1096,25 @@ dpif_get_netflow_ids(const struct dpif *dpif,
*engine_type = dpif->netflow_engine_type;
*engine_id = dpif->netflow_engine_id;
}
/* Translates OpenFlow queue ID 'queue_id' (in host byte order) into a priority
* value for use in the ODPAT_SET_PRIORITY action. On success, returns 0 and
* stores the priority into '*priority'. On failure, returns a positive errno
* value and stores 0 into '*priority'. */
int
dpif_queue_to_priority(const struct dpif *dpif, uint32_t queue_id,
uint32_t *priority)
{
int error = (dpif->dpif_class->queue_to_priority
? dpif->dpif_class->queue_to_priority(dpif, queue_id,
priority)
: EOPNOTSUPP);
if (error) {
*priority = 0;
}
log_operation(dpif, "queue_to_priority", error);
return error;
}
void
dpif_init(struct dpif *dpif, const struct dpif_class *dpif_class,