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:
19
lib/dpif.c
19
lib/dpif.c
@@ -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,
|
||||
|
Reference in New Issue
Block a user