netdev-linux: Fix build with old kernel headers.
[cascardo/ovs.git] / lib / netdev-linux.c
index 8253dfb..5e6f01e 100644 (file)
@@ -2841,6 +2841,14 @@ const struct netdev_class netdev_internal_class =
 
 #define CODEL_N_QUEUES 0x0000
 
+/* In sufficiently new kernel headers these are defined as enums in
+ * <linux/pkt_sched.h>.  Define them here as macros to help out with older
+ * kernels.  (This overrides any enum definition in the header file but that's
+ * harmless.) */
+#define TCA_CODEL_TARGET   1
+#define TCA_CODEL_LIMIT    2
+#define TCA_CODEL_INTERVAL 3
+
 struct codel {
     struct tc tc;
     uint32_t target;
@@ -3052,6 +3060,17 @@ static const struct tc_ops tc_ops_codel = {
 
 #define FQCODEL_N_QUEUES 0x0000
 
+/* In sufficiently new kernel headers these are defined as enums in
+ * <linux/pkt_sched.h>.  Define them here as macros to help out with older
+ * kernels.  (This overrides any enum definition in the header file but that's
+ * harmless.) */
+#define TCA_FQ_CODEL_TARGET     1
+#define TCA_FQ_CODEL_LIMIT      2
+#define TCA_FQ_CODEL_INTERVAL   3
+#define TCA_FQ_CODEL_ECN        4
+#define TCA_FQ_CODEL_FLOWS      5
+#define TCA_FQ_CODEL_QUANTUM    6
+
 struct fqcodel {
     struct tc tc;
     uint32_t target;