2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

netdev-linux: Fix build with old kernel headers.

Commit 677d9158fc (netdev-linux: Support for SFQ, FQ_CoDel and CoDel
qdiscs.) added support for new qdiscs.  The commit uses TCA_CODEL_* and
TCA_FQ_CODEL_* not in old kernel headers, causing a build failure against
such headers.  This commit should fix the problem by defining these values
ourselves.  (I haven't tested it against old headers, so I might have
missed something, but it's a straightforward change and at worst won't do
harm.)

It appears that sfq (also added by the same commit) was in Linux before
2.6.32, so it seems unlikely that we need any compatibility code there.

CC: Jonathan Vestin <jonavest@kau.se>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2015-03-24 10:51:56 -07:00
parent 4752cc0c26
commit 2f4298ce26

View 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;