mirror of
https://github.com/openvswitch/ovs
synced 2025-10-29 15:28:56 +00:00
classifier: Change type used for priorities from 'unsigned int' to 'int'.
OpenFlow has priorities in the 16-bit unsigned range, from 0 to 65535. In the classifier, it is sometimes useful to be able to have values below and above this range. With the 'unsigned int' type used for priorities until now, there were no values below the range, so some code worked around it by converting priorities to 64-bit signed integers. This didn't seem so great to me given that a plain 'int' also had the needed range. This commit therefore changes the type used for priorities to int. The interesting parts of this change are in pvector.h and classifier.c, where one can see the elimination of the use of int64_t. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
@@ -33,8 +33,7 @@ struct cls_subtable {
|
||||
/* The fields are only used by writers. */
|
||||
int n_rules OVS_GUARDED; /* Number of rules, including
|
||||
* duplicates. */
|
||||
unsigned int max_priority OVS_GUARDED; /* Max priority of any rule in
|
||||
* the subtable. */
|
||||
int max_priority OVS_GUARDED; /* Max priority of any rule in subtable. */
|
||||
unsigned int max_count OVS_GUARDED; /* Count of max_priority rules. */
|
||||
|
||||
/* These fields are accessed by readers who care about wildcarding. */
|
||||
@@ -72,7 +71,7 @@ struct cls_match {
|
||||
struct cls_partition *partition OVS_GUARDED;
|
||||
|
||||
/* Accessed by readers interested in wildcarding. */
|
||||
unsigned int priority; /* Larger numbers are higher priorities. */
|
||||
int priority; /* Larger numbers are higher priorities. */
|
||||
struct cmap_node index_nodes[CLS_MAX_INDICES]; /* Within subtable's
|
||||
* 'indices'. */
|
||||
/* Accessed by all readers. */
|
||||
|
||||
Reference in New Issue
Block a user