diff options
| author | Andy Zhou <azhou@ovn.org> | 2017-11-10 15:09:40 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-11-12 20:37:07 -0500 |
| commit | 5794040647de4011598a6d005fdad95d24fd385b (patch) | |
| tree | f0c7641fac5a8a90a783a3585d565daba9b3ba94 /include/uapi/linux/openvswitch.h | |
| parent | aef1e0d5dd3ca3acd7274c9179c8f7bf68170509 (diff) | |
openvswitch: Add meter netlink definitions
Meter has its own netlink family. Define netlink messages and attributes
for communicating with the user space programs.
Signed-off-by: Andy Zhou <azhou@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/openvswitch.h')
| -rw-r--r-- | include/uapi/linux/openvswitch.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h index ec75a685f1dd..d60b9a4cf3d1 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h | |||
| @@ -883,4 +883,55 @@ enum ovs_action_attr { | |||
| 883 | 883 | ||
| 884 | #define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1) | 884 | #define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1) |
| 885 | 885 | ||
| 886 | /* Meters. */ | ||
| 887 | #define OVS_METER_FAMILY "ovs_meter" | ||
| 888 | #define OVS_METER_MCGROUP "ovs_meter" | ||
| 889 | #define OVS_METER_VERSION 0x1 | ||
| 890 | |||
| 891 | enum ovs_meter_cmd { | ||
| 892 | OVS_METER_CMD_UNSPEC, | ||
| 893 | OVS_METER_CMD_FEATURES, /* Get features supported by the datapath. */ | ||
| 894 | OVS_METER_CMD_SET, /* Add or modify a meter. */ | ||
| 895 | OVS_METER_CMD_DEL, /* Delete a meter. */ | ||
| 896 | OVS_METER_CMD_GET /* Get meter stats. */ | ||
| 897 | }; | ||
| 898 | |||
| 899 | enum ovs_meter_attr { | ||
| 900 | OVS_METER_ATTR_UNSPEC, | ||
| 901 | OVS_METER_ATTR_ID, /* u32 meter ID within datapath. */ | ||
| 902 | OVS_METER_ATTR_KBPS, /* No argument. If set, units in kilobits | ||
| 903 | * per second. Otherwise, units in | ||
| 904 | * packets per second. | ||
| 905 | */ | ||
| 906 | OVS_METER_ATTR_STATS, /* struct ovs_flow_stats for the meter. */ | ||
| 907 | OVS_METER_ATTR_BANDS, /* Nested attributes for meter bands. */ | ||
| 908 | OVS_METER_ATTR_USED, /* u64 msecs last used in monotonic time. */ | ||
| 909 | OVS_METER_ATTR_CLEAR, /* Flag to clear stats, used. */ | ||
| 910 | OVS_METER_ATTR_MAX_METERS, /* u32 number of meters supported. */ | ||
| 911 | OVS_METER_ATTR_MAX_BANDS, /* u32 max number of bands per meter. */ | ||
| 912 | OVS_METER_ATTR_PAD, | ||
| 913 | __OVS_METER_ATTR_MAX | ||
| 914 | }; | ||
| 915 | |||
| 916 | #define OVS_METER_ATTR_MAX (__OVS_METER_ATTR_MAX - 1) | ||
| 917 | |||
| 918 | enum ovs_band_attr { | ||
| 919 | OVS_BAND_ATTR_UNSPEC, | ||
| 920 | OVS_BAND_ATTR_TYPE, /* u32 OVS_METER_BAND_TYPE_* constant. */ | ||
| 921 | OVS_BAND_ATTR_RATE, /* u32 band rate in meter units (see above). */ | ||
| 922 | OVS_BAND_ATTR_BURST, /* u32 burst size in meter units. */ | ||
| 923 | OVS_BAND_ATTR_STATS, /* struct ovs_flow_stats for the band. */ | ||
| 924 | __OVS_BAND_ATTR_MAX | ||
| 925 | }; | ||
| 926 | |||
| 927 | #define OVS_BAND_ATTR_MAX (__OVS_BAND_ATTR_MAX - 1) | ||
| 928 | |||
| 929 | enum ovs_meter_band_type { | ||
| 930 | OVS_METER_BAND_TYPE_UNSPEC, | ||
| 931 | OVS_METER_BAND_TYPE_DROP, /* Drop exceeding packets. */ | ||
| 932 | __OVS_METER_BAND_TYPE_MAX | ||
| 933 | }; | ||
| 934 | |||
| 935 | #define OVS_METER_BAND_TYPE_MAX (__OVS_METER_BAND_TYPE_MAX - 1) | ||
| 936 | |||
| 886 | #endif /* _LINUX_OPENVSWITCH_H */ | 937 | #endif /* _LINUX_OPENVSWITCH_H */ |
