* [PATCH] compat: deal with backported codel
@ 2012-08-04 15:58 Johannes Berg
2012-08-04 16:08 ` Johannes Berg
2012-08-05 10:29 ` [PATCH v2] " Johannes Berg
0 siblings, 2 replies; 9+ messages in thread
From: Johannes Berg @ 2012-08-04 15:58 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: Hauke Mehrtens, linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Some distro kernels (in particular the Debian 3.2.0-3
kernel I'm running) backport codel already, so trying
to backport it again causes issues. Protect the compat
backport with #ifdef TCA_CODEL_MAX.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
include/linux/compat-3.5.h | 2 ++
include/net/codel.h | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h
index 6bb450d..7fadbf2 100644
--- a/include/linux/compat-3.5.h
+++ b/include/linux/compat-3.5.h
@@ -147,6 +147,7 @@ static inline int compat_vga_switcheroo_register_client(struct pci_dev *dev,
* Subject: [PATCH] codel: Controlled Delay AQM
*/
+#ifndef TCA_CODEL_MAX
/* CODEL */
enum {
@@ -234,6 +235,7 @@ struct tc_fq_codel_xstats {
struct tc_fq_codel_cl_stats class_stats;
};
};
+#endif /* TCA_CODEL_MAX */
/* Backports tty_lock: Localise the lock */
diff --git a/include/net/codel.h b/include/net/codel.h
index 128082e..ab901c5 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -1,6 +1,7 @@
#include <linux/version.h>
+#include <linux/pkt_sched.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) || defined(TCA_CODEL_MAX)
#include_next <net/codel.h>
#else
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] compat: deal with backported codel
2012-08-04 15:58 [PATCH] compat: deal with backported codel Johannes Berg
@ 2012-08-04 16:08 ` Johannes Berg
2012-08-05 10:29 ` [PATCH v2] " Johannes Berg
1 sibling, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2012-08-04 16:08 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: Hauke Mehrtens, linux-wireless
On Sat, 2012-08-04 at 17:58 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Some distro kernels (in particular the Debian 3.2.0-3
> kernel I'm running) backport codel already, so trying
> to backport it again causes issues. Protect the compat
> backport with #ifdef TCA_CODEL_MAX.
Nope, this isn't sufficient -- it still causes issues because I still
build codel and the flow_dissector, and thus I get skb_flow_dissect() in
compat.ko which the kernel already defines ...
johannes
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2] compat: deal with backported codel
2012-08-04 15:58 [PATCH] compat: deal with backported codel Johannes Berg
2012-08-04 16:08 ` Johannes Berg
@ 2012-08-05 10:29 ` Johannes Berg
2012-08-06 19:06 ` Luis R. Rodriguez
2012-08-06 19:53 ` Luis R. Rodriguez
1 sibling, 2 replies; 9+ messages in thread
From: Johannes Berg @ 2012-08-05 10:29 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: Hauke Mehrtens, linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Some distro kernels (in particular the Debian 3.2.0-3
kernel I'm running) backport codel already, so trying
to backport it again causes issues. Protect the compat
backport with #ifdef TCA_CODEL_MAX.
Also link the flow_dissector code into the codel module
which then won't be loaded on kernels that already have
codel backported.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
compat/Makefile | 6 ++++--
compat/flow_dissector.c | 1 -
compat/{sch_fq_codel.c => sch_fq_codel_core.c} | 0
include/linux/compat-3.5.h | 2 ++
include/net/codel.h | 3 ++-
5 files changed, 8 insertions(+), 4 deletions(-)
rename compat/{sch_fq_codel.c => sch_fq_codel_core.c} (100%)
diff --git a/compat/Makefile b/compat/Makefile
index c661f5d..23c1296 100644
--- a/compat/Makefile
+++ b/compat/Makefile
@@ -3,6 +3,9 @@ obj-m += compat.o
obj-$(CONFIG_COMPAT_FIRMWARE_CLASS) += compat_firmware_class.o
obj-$(CONFIG_COMPAT_NET_SCH_CODEL) += sch_codel.o
+
+sch_fq_codel-y = sch_fq_codel_core.o flow_dissector.o
+
obj-$(CONFIG_COMPAT_NET_SCH_FQ_CODEL) += sch_fq_codel.o
compat-y += main.o
@@ -40,8 +43,7 @@ compat-$(CONFIG_COMPAT_KERNEL_3_0) += compat-3.0.o
compat-$(CONFIG_COMPAT_KERNEL_3_1) += compat-3.1.o
compat-$(CONFIG_COMPAT_KERNEL_3_2) += compat-3.2.o
compat-$(CONFIG_COMPAT_KERNEL_3_3) += \
- compat-3.3.o \
- flow_dissector.o
+ compat-3.3.o
compat-$(CONFIG_COMPAT_KERNEL_3_4) += compat-3.4.o
compat-$(CONFIG_COMPAT_CORDIC) += cordic.o
diff --git a/compat/flow_dissector.c b/compat/flow_dissector.c
index 8affda0..7dd7ec1 100644
--- a/compat/flow_dissector.c
+++ b/compat/flow_dissector.c
@@ -141,4 +141,3 @@ ipv6:
return true;
}
-EXPORT_SYMBOL_GPL(skb_flow_dissect);
diff --git a/compat/sch_fq_codel.c b/compat/sch_fq_codel_core.c
similarity index 100%
rename from compat/sch_fq_codel.c
rename to compat/sch_fq_codel_core.c
diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h
index 6bb450d..7fadbf2 100644
--- a/include/linux/compat-3.5.h
+++ b/include/linux/compat-3.5.h
@@ -147,6 +147,7 @@ static inline int compat_vga_switcheroo_register_client(struct pci_dev *dev,
* Subject: [PATCH] codel: Controlled Delay AQM
*/
+#ifndef TCA_CODEL_MAX
/* CODEL */
enum {
@@ -234,6 +235,7 @@ struct tc_fq_codel_xstats {
struct tc_fq_codel_cl_stats class_stats;
};
};
+#endif /* TCA_CODEL_MAX */
/* Backports tty_lock: Localise the lock */
diff --git a/include/net/codel.h b/include/net/codel.h
index 128082e..ab901c5 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -1,6 +1,7 @@
#include <linux/version.h>
+#include <linux/pkt_sched.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) || defined(TCA_CODEL_MAX)
#include_next <net/codel.h>
#else
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2] compat: deal with backported codel
2012-08-05 10:29 ` [PATCH v2] " Johannes Berg
@ 2012-08-06 19:06 ` Luis R. Rodriguez
2012-08-06 19:53 ` Luis R. Rodriguez
1 sibling, 0 replies; 9+ messages in thread
From: Luis R. Rodriguez @ 2012-08-06 19:06 UTC (permalink / raw)
To: Johannes Berg; +Cc: Hauke Mehrtens, linux-wireless
On Sun, Aug 5, 2012 at 3:29 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Some distro kernels (in particular the Debian 3.2.0-3
> kernel I'm running) backport codel already, so trying
> to backport it again causes issues. Protect the compat
> backport with #ifdef TCA_CODEL_MAX.
>
> Also link the flow_dissector code into the codel module
> which then won't be loaded on kernels that already have
> codel backported.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Neat, thanks, only one comment below:
> diff --git a/compat/flow_dissector.c b/compat/flow_dissector.c
> index 8affda0..7dd7ec1 100644
> --- a/compat/flow_dissector.c
> +++ b/compat/flow_dissector.c
> @@ -141,4 +141,3 @@ ipv6:
>
> return true;
> }
> -EXPORT_SYMBOL_GPL(skb_flow_dissect);
Why is this change required?
Luis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] compat: deal with backported codel
2012-08-05 10:29 ` [PATCH v2] " Johannes Berg
2012-08-06 19:06 ` Luis R. Rodriguez
@ 2012-08-06 19:53 ` Luis R. Rodriguez
2012-08-06 20:33 ` Hauke Mehrtens
1 sibling, 1 reply; 9+ messages in thread
From: Luis R. Rodriguez @ 2012-08-06 19:53 UTC (permalink / raw)
To: Johannes Berg; +Cc: Hauke Mehrtens, linux-wireless, Ben Hutchings
On Sun, Aug 5, 2012 at 3:29 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Some distro kernels (in particular the Debian 3.2.0-3
> kernel I'm running) backport codel already, so trying
> to backport it again causes issues. Protect the compat
> backport with #ifdef TCA_CODEL_MAX.
>
> Also link the flow_dissector code into the codel module
> which then won't be loaded on kernels that already have
> codel backported.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Applied and pushed, thanks!
Luis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] compat: deal with backported codel
2012-08-06 19:53 ` Luis R. Rodriguez
@ 2012-08-06 20:33 ` Hauke Mehrtens
2012-08-06 21:15 ` Luis R. Rodriguez
2012-08-06 21:45 ` Hauke Mehrtens
0 siblings, 2 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2012-08-06 20:33 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: Johannes Berg, linux-wireless, Ben Hutchings
On 08/06/2012 09:53 PM, Luis R. Rodriguez wrote:
> On Sun, Aug 5, 2012 at 3:29 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
>> From: Johannes Berg <johannes.berg@intel.com>
>>
>> Some distro kernels (in particular the Debian 3.2.0-3
>> kernel I'm running) backport codel already, so trying
>> to backport it again causes issues. Protect the compat
>> backport with #ifdef TCA_CODEL_MAX.
>>
>> Also link the flow_dissector code into the codel module
>> which then won't be loaded on kernels that already have
>> codel backported.
>>
>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>
> Applied and pushed, thanks!
>
> Luis
>
This breaks my build if net/codel.h is not in the kernel headers:
In file included from
/home/hauke/compat-wireless/compat-wireless/compat/sch_fq_codel_core.c:27:0:
/home/hauke/compat-wireless/compat-wireless/include/net/codel.h:5:28:
fatal error: net/codel.h: No such file or directory
compilation terminated.
TCA_CODEL_MAX is defined in include/linux/compat-3.5.h and this file is
included ever time, so the check around #include_next <net/codel.h> is
never false.
You could define something like COMPAT_CODEL_BACKPORT in
include/linux/compat-3.5.h and extend the check in include/net/codel.h
that this has to be unset.
Hauke
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] compat: deal with backported codel
2012-08-06 20:33 ` Hauke Mehrtens
@ 2012-08-06 21:15 ` Luis R. Rodriguez
2012-08-06 21:45 ` Hauke Mehrtens
1 sibling, 0 replies; 9+ messages in thread
From: Luis R. Rodriguez @ 2012-08-06 21:15 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: Johannes Berg, linux-wireless, Ben Hutchings
On Mon, Aug 6, 2012 at 1:33 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> On 08/06/2012 09:53 PM, Luis R. Rodriguez wrote:
>> On Sun, Aug 5, 2012 at 3:29 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
>>> From: Johannes Berg <johannes.berg@intel.com>
>>>
>>> Some distro kernels (in particular the Debian 3.2.0-3
>>> kernel I'm running) backport codel already, so trying
>>> to backport it again causes issues. Protect the compat
>>> backport with #ifdef TCA_CODEL_MAX.
>>>
>>> Also link the flow_dissector code into the codel module
>>> which then won't be loaded on kernels that already have
>>> codel backported.
>>>
>>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>>
>> Applied and pushed, thanks!
>>
>> Luis
>>
> This breaks my build if net/codel.h is not in the kernel headers:
>
> In file included from
> /home/hauke/compat-wireless/compat-wireless/compat/sch_fq_codel_core.c:27:0:
> /home/hauke/compat-wireless/compat-wireless/include/net/codel.h:5:28:
> fatal error: net/codel.h: No such file or directory
> compilation terminated.
>
> TCA_CODEL_MAX is defined in include/linux/compat-3.5.h and this file is
> included ever time, so the check around #include_next <net/codel.h> is
> never false.
>
> You could define something like COMPAT_CODEL_BACKPORT in
> include/linux/compat-3.5.h and extend the check in include/net/codel.h
> that this has to be unset.
Dah, reverting for now, I need to get some compiles through.
Luis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] compat: deal with backported codel
2012-08-06 20:33 ` Hauke Mehrtens
2012-08-06 21:15 ` Luis R. Rodriguez
@ 2012-08-06 21:45 ` Hauke Mehrtens
2012-08-07 17:09 ` Luis R. Rodriguez
1 sibling, 1 reply; 9+ messages in thread
From: Hauke Mehrtens @ 2012-08-06 21:45 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: Johannes Berg, linux-wireless, Ben Hutchings
[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]
On 08/06/2012 10:33 PM, Hauke Mehrtens wrote:
> On 08/06/2012 09:53 PM, Luis R. Rodriguez wrote:
>> On Sun, Aug 5, 2012 at 3:29 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
>>> From: Johannes Berg <johannes.berg@intel.com>
>>>
>>> Some distro kernels (in particular the Debian 3.2.0-3
>>> kernel I'm running) backport codel already, so trying
>>> to backport it again causes issues. Protect the compat
>>> backport with #ifdef TCA_CODEL_MAX.
>>>
>>> Also link the flow_dissector code into the codel module
>>> which then won't be loaded on kernels that already have
>>> codel backported.
>>>
>>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>>
>> Applied and pushed, thanks!
>>
>> Luis
>>
> This breaks my build if net/codel.h is not in the kernel headers:
>
> In file included from
> /home/hauke/compat-wireless/compat-wireless/compat/sch_fq_codel_core.c:27:0:
> /home/hauke/compat-wireless/compat-wireless/include/net/codel.h:5:28:
> fatal error: net/codel.h: No such file or directory
> compilation terminated.
>
> TCA_CODEL_MAX is defined in include/linux/compat-3.5.h and this file is
> included ever time, so the check around #include_next <net/codel.h> is
> never false.
>
> You could define something like COMPAT_CODEL_BACKPORT in
> include/linux/compat-3.5.h and extend the check in include/net/codel.h
> that this has to be unset.
>
> Hauke
With the attached patch in addition to Johannes' patch it works for me.
Anyone feel free to integrate it or use it in any other way.
Hauke
[-- Attachment #2: codel.patch --]
[-- Type: text/x-patch, Size: 823 bytes --]
diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h
index 7fadbf2..3aec3bd 100644
--- a/include/linux/compat-3.5.h
+++ b/include/linux/compat-3.5.h
@@ -150,6 +150,8 @@ static inline int compat_vga_switcheroo_register_client(struct pci_dev *dev,
#ifndef TCA_CODEL_MAX
/* CODEL */
+#define COMPAT_CODEL_BACKPORT
+
enum {
TCA_CODEL_UNSPEC,
TCA_CODEL_TARGET,
diff --git a/include/net/codel.h b/include/net/codel.h
index ab901c5..eee0359 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -1,7 +1,7 @@
#include <linux/version.h>
#include <linux/pkt_sched.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) || defined(TCA_CODEL_MAX)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) || (defined(TCA_CODEL_MAX) && !defined(COMPAT_CODEL_BACKPORT))
#include_next <net/codel.h>
#else
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2] compat: deal with backported codel
2012-08-06 21:45 ` Hauke Mehrtens
@ 2012-08-07 17:09 ` Luis R. Rodriguez
0 siblings, 0 replies; 9+ messages in thread
From: Luis R. Rodriguez @ 2012-08-07 17:09 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: Johannes Berg, linux-wireless, Ben Hutchings
On Mon, Aug 6, 2012 at 2:45 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> On 08/06/2012 10:33 PM, Hauke Mehrtens wrote:
>> On 08/06/2012 09:53 PM, Luis R. Rodriguez wrote:
>>> On Sun, Aug 5, 2012 at 3:29 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
>>>> From: Johannes Berg <johannes.berg@intel.com>
>>>>
>>>> Some distro kernels (in particular the Debian 3.2.0-3
>>>> kernel I'm running) backport codel already, so trying
>>>> to backport it again causes issues. Protect the compat
>>>> backport with #ifdef TCA_CODEL_MAX.
>>>>
>>>> Also link the flow_dissector code into the codel module
>>>> which then won't be loaded on kernels that already have
>>>> codel backported.
>>>>
>>>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>>>
>>> Applied and pushed, thanks!
>>>
>>> Luis
>>>
>> This breaks my build if net/codel.h is not in the kernel headers:
>>
>> In file included from
>> /home/hauke/compat-wireless/compat-wireless/compat/sch_fq_codel_core.c:27:0:
>> /home/hauke/compat-wireless/compat-wireless/include/net/codel.h:5:28:
>> fatal error: net/codel.h: No such file or directory
>> compilation terminated.
>>
>> TCA_CODEL_MAX is defined in include/linux/compat-3.5.h and this file is
>> included ever time, so the check around #include_next <net/codel.h> is
>> never false.
>>
>> You could define something like COMPAT_CODEL_BACKPORT in
>> include/linux/compat-3.5.h and extend the check in include/net/codel.h
>> that this has to be unset.
>>
>> Hauke
>
> With the attached patch in addition to Johannes' patch it works for me.
> Anyone feel free to integrate it or use it in any other way.
I've merged the two patches together and applied, thanks! Also
throwing this into the linux-3.5.y branch.
Luis
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-08-07 17:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-04 15:58 [PATCH] compat: deal with backported codel Johannes Berg
2012-08-04 16:08 ` Johannes Berg
2012-08-05 10:29 ` [PATCH v2] " Johannes Berg
2012-08-06 19:06 ` Luis R. Rodriguez
2012-08-06 19:53 ` Luis R. Rodriguez
2012-08-06 20:33 ` Hauke Mehrtens
2012-08-06 21:15 ` Luis R. Rodriguez
2012-08-06 21:45 ` Hauke Mehrtens
2012-08-07 17:09 ` Luis R. Rodriguez
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.