- Packets are classified (internal classifier or external) on flows.
- This is a Stochastic model (as we use a hash, several flows might
be hashed on same slot)
- Each flow has a CoDel managed queue.
- Flows are linked onto two (Round Robin) lists,
so that new flows have priority on old ones.
- For a given flow, packets are not reordered (CoDel uses a FIFO)
- head drops only.
- ECN capability is on by default.
- Very low memory footprint (64 bytes per flow)
I should note that this is different than CoDel. This code is GPL,
CoDel is Dual BSD/GPL licensed. This goes only compile tested against
all the below kernels, run time test results would be appreciated.
This is taken from next-20120524. This does not yet
add any backport code to it, not have we integrated
it into the build system. The backport work will be
done next to make the changes more easily visible to
reviewers.
This also adds flow_dissector.c from net/core/ as well,
but we'll backport any changes required next.
This just drags in the code and dumps it in place, without
adding it to the build system. We'll add backport support next
to make the changes required more easily visible to reviewers.
From 3a3bfb61e64476ff1e4ac3122cb6dec9c79b795c Mon Sep 17 00:00:00 2001
From: Joe Perches <joe@perches.com>
Date: Sun, 13 May 2012 21:56:25 +0000
Subject: [PATCH] net: Add net_ratelimited_function and
net_<level>_ratelimited macros
__ratelimit() can be considered an inverted bool test because
it returns true when not ratelimited. Several tests in the
kernel tree use this __ratelimit() function incorrectly.
No net_ratelimit uses are incorrect currently though.
Most uses of net_ratelimit are to log something via printk or
pr_<level>.
In order to minimize the uses of net_ratelimit, and to start
standardizing the code style used for __ratelimit() and net_ratelimit(),
add a net_ratelimited_function() macro and net_<level>_ratelimited()
logging macros similar to pr_<level>_ratelimited that use the global
net_ratelimit instead of a static per call site "struct ratelimit_state".
I'm going to start adding tags to compat.git. This tag will
also be printed upon loading of the compat module. This is
useful to annotating what release of compat.git was used
exactly.
Moving forward the goal will be to try to add a tag only
once a full version of linux-next.git with a respective
date tag from that release has been addressed for backporting.
Right now the only consumer of compat.git that I am aware of
is compat-wireless (soon to be renamed to compat-drivers) so
what this means in practice is I will only add a tag to
compat.git once ckmake is used to verify compilation against
all supported kernels. This means there are two tasks when
backporting:
* compat.git work
* compat-wireless.git work
The compat.git work will likely be finished first than the
compat-wireless.git work. Older compat.git versions should
work with newer versions of tags from compat-wireless.git,
however, I may still add tags to compat.git to annotate
that that release (even if no changes were made) has also
been used and tested.
Every single release of compat.git and compat-wireless.git
that has a tag means that that tag has been tested with
ckmake to cross compile against all supported kernels.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Eliad Peller [Wed, 16 May 2012 15:28:00 +0000 (18:28 +0300)]
compat: backport IS_ENABLED macro
IS_ENABLED(option) was backported as defined(option), but
because of the indirection, option was evaluated too early,
resulting in #if defined(1) for defined options, which failed
the compilation with the following error:
error: operator "defined" requires an identifier
Backport IS_ENABLED from the current kernel instead.
Tested-by: Luis R. Rodriguez <mcgrof@frijolero.org> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Add a boolean function to check if 2 ethernet addresses
are the same.
This is to avoid any confusion about compare_ether_addr
returning an unsigned, and not being able to use the
compare_ether_addr function for sorting ala memcmp.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
[root@ozzyfedora compat]# bin/ckmake
Trying kernel 3.3.4-5.fc17.x86_64 [OK]
Tested-by: Luis R. Rodriguez <mcgrof@frijolero.org> Signed-off-by: Ozan Çağlayan <ozancag@gmail.com> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
In each remaining case the tty_lock is associated with a specific tty. This
means we can now lock on a per tty basis. We do need tty_lock_pair() for
the pty case. Uglier but still a step in the right direction.
sdio: introduce API for special power management features
This patch series provides the core changes needed to allow SDIO cards to
remain powered and active while the host system is suspended, and let them
wake up the host system when needed. This is used to implement
wake-on-lan with SDIO wireless cards at the moment. Patches to add that
support to the libertas driver will be posted separately.
This patch:
Some SDIO cards have the ability to keep on running autonomously when the
host system is suspended, and wake it up when needed. This however
requires that the host controller preserve power to the card, and
configure itself appropriately for wake-up.
There is however 4 layers of abstractions involved: the host controller
driver, the MMC core code, the SDIO card management code, and the actual
SDIO function driver. To make things simple and manageable, host drivers
must advertise their PM capabilities with a feature bitmask, then function
drivers can query and set those features from their suspend method. Then
each layer in the suspend call chain is expected to act upon those bits
accordingly.
To backport b718989d correctly which added pci_enable_device_mem()
the routine pcibios_enable_device() is required but we don't
have access to it on modules as its an architecture specific
routine that is not exported and as such only core kernel code
has access to it. We implement a sloppy work around for
backporting this.
This helps reduce the delta on backporting calls of the
netdev's ioctl callback. Instead of ifdef'ing on where
the ioctl callback lies in different kernels we take
care of that for all kernels.
This lets us for example change this backport:
@@ -925,8 +954,13 @@ static int wireless_process_ioctl(struct
return private(dev, iwr, cmd, info, handler);
}
/* Old driver API : call driver ioctl handler */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
if (dev->netdev_ops->ndo_do_ioctl)
return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
+#else
+ if (dev->do_ioctl)
+ return dev->do_ioctl(dev, ifr, cmd);
+#endif
return -EOPNOTSUPP;
}
Johannes Berg [Fri, 6 Apr 2012 10:41:07 +0000 (12:41 +0200)]
compat: properly handle tracing
We have to disable tracing on old kernels, but should
disable it only on old kernels. Since 2.6.33 it pretty
much hasn't changed at all, so we can keep it. Prior
to 2.6.33, there are various different reasons for not
supporting tracing, as noted in the tracepoint.h file.
This fixes tracing as the previous attempts here at
backporting it completely disabled it for all kernels,
not just for those where it's not possible.
Tested compilation of compat-wireless with tracing in
mac80211 against 2.6.24 through 3.3, but some versions
didn't compile due to unrelated issues.
Cc: stable@orbit-lab.org Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Avoid printing anything other than errors. This
*should* speed up compiling a bit more although
current tests show no improvements yet. The real
benefit is a smaller and cleaner ckmake.log which
will only have warnings and errors.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: backport truesize arg increase on skb_add_rx_frag()
This backports 50269e19 by just calling the older kernel routine,
and discarding the new argument. We treat kernels older than 2.6.28
a bit differently, given that those kernels lacked this routine
completely.
net: add a truesize parameter to skb_add_rx_frag()
skb_add_rx_frag() API is misleading.
Network skbs built with this helper can use uncharged kernel memory and
eventually stress/crash machine in OOM.
Add a 'truesize' parameter and then fix drivers in followup patches.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
mcgrof@tux ~/linux-stable (git::master)$ git describe --contains 50269e19
v3.4-rc1~84^2~1
debugfs and a few other drivers use an open-coded version of simple_open()
to pass a pointer from the file to the read/write file ops. Add support
for this simple case to libfs so that we can remove the many duplicate
copies of this simple function.
This skips non-PPA kernels for Ubuntu with ckmake.
This lets a machine host as many kernelas it wants but
we stick to only using the PPA mainline vanilla kernels.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
USB: add asynchronous autosuspend/autoresume support
This patch (as1160b) adds support routines for asynchronous autosuspend
and autoresume, with accompanying documentation updates. There
already are several potential users of this interface, and others are
likely to arise as autosuspend support becomes more widespread.
Run-time power management cannot really be backported
given that the implementation added bus specific
callbacks that we won't have on older kernels. If
you really want run-time power management or good
power management upgrade your kernel. We'll just
compile this out as if run-time power management was
disabled just as the kernel disables run-time power
management when CONFIG_PM_RUNTIME is disabled.
compat: fix compat_firmware_class.c compilation on older kernels
CONFIG_COMPAT_FIRMWARE_CLASS is defined explicitly for any kernel >= 2.6.33
but CONFIG_FW_LOADER) || CONFIG_FW_LOADER_MODULE may still be disabled,
and in those cases we should still compile.
Lets clean this up by being explicit about the exported symbols within
compat_firmware_class.c instead of relying on the header file to rename them
for us at compile time. At the same time be consistent and use the
CONFIG_FW_LOADER) || CONFIG_FW_LOADER_MODULE checks on the header
to see which declarations to use.
Johannes Berg [Fri, 30 Mar 2012 09:52:59 +0000 (11:52 +0200)]
compat-3.3: include module.h
compat/compat-3.3.c:172:1: warning: data definition has no type or storage class [enabled by default]
compat/compat-3.3.c:172:1: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL_GPL’ [-Wimplicit-int]
compat/compat-3.3.c:172:1: warning: parameter names (without types) in function declaration [enabled by default]
In newer kernels we should include export.h, but
not all kernels have that so use module.h which
always works.
Tested-by: Arend Van Spriel <arend@broadcom.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Its not really easy to backport the tracing stuff, but
lets give it a shot. We should simply review how many
subsystems we want tracing for and for what target kernels
we want that enabled for. It doesn't make sense to
backport tracing if we won't have much users.
For now add some code that at least does not break building.
The CONFIG_COMPAT_KFIFO config option must be defined
to CONFIG_COMPAT_KFIFO=y instead of CONFIG_COMPAT_KFIFO=m
as the kfifo object is not a module, its simply part of
the compat module. This should fix users of the kfifo
backport on kernels older than 2.6.36.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
The commit d320c038 added some new system workqueues to allow us
to categorize order of priority on workqueue items. We had already
backported usage of system_nrt_wq but hadn't backported usage of
system_wq or system_long_wq. We address this now in this patch
by also ensuring that flush_workqueue() will flush these as
designed, that is only prioritizing system_wq. Given that older
kernels would be using the older keventd_wq for now we flush
that and then system_wq, allowing users of the system_long_wq
to be delayed as intended for backported kernel code using this
framework.
workqueue: s/__create_workqueue()/alloc_workqueue()/, and add system workqueues
This patch makes changes to make new workqueue features available to
its users.
* Now that workqueue is more featureful, there should be a public
workqueue creation function which takes paramters to control them.
Rename __create_workqueue() to alloc_workqueue() and make 0
max_active mean WQ_DFL_ACTIVE. In the long run, all
create_workqueue_*() will be converted over to alloc_workqueue().
* To further unify access interface, rename keventd_wq to system_wq
and export it.
* Add system_long_wq and system_nrt_wq. The former is to host long
running works separately (so that flush_scheduled_work() dosen't
take so long) and the latter guarantees any queued work item is
never executed in parallel by multiple CPUs. These will be used by
future patches to update workqueue users.
Signed-off-by: Tejun Heo <tj@kernel.org>
The ckmake [documented on 0] log:
We cannot backport this given that the IRQ data structure
was changed so simply treat this hint as if the system was
uniprocessor. This backports this commit:
This patch adds a cpumask affinity hint to the irq_desc structure,
along with a registration function and a read-only proc entry for each
interrupt.
This affinity_hint handle for each interrupt can be used by underlying
drivers that need a better mechanism to control interrupt affinity.
The underlying driver can register a cpumask for the interrupt, which
will allow the driver to provide the CPU mask for the interrupt to
anything that requests it. The intent is to extend the userspace
daemon, irqbalance, to help hint to it a preferred CPU mask to balance
the interrupt into.
[ tglx: Fixed compile warnings, added WARN_ON, made SMP only ]
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Cc: davem@davemloft.net Cc: arjan@linux.jf.intel.com Cc: bhutchings@solarflare.com
LKML-Reference: <20100430214445.3992.41647.stgit@ppwaskie-hc2.jf.intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
ckmake log:
compat: Fix module_init return type from void to int.
086f3a1 overrode module_init to make it depend on compat, but the
overriding module_init has return type 'void', so strange things would
happen when the module loading code see that init_module() returns
positive values. This patch makes it return the value returned by
the overriden module_init.
Signed-off-by: Nicolas Cavallari <cavallar@lri.fr> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Johannes Berg [Sun, 4 Mar 2012 05:03:22 +0000 (21:03 -0800)]
compat: make all modules depend on compat
Sometimes, compat based drivers do not depend on
compat.ko because the base kernel is new enough.
This causes compat to not be loaded and makes it
harder to identify that the modules were based
on compat.
Re-define module_init() to make all modules that
were compiled against compat also require to be
linked against compat.ko.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: makes all compat symbols EXPORT_SYMBOL_GPL()
The Linux kernel is being backported here and a lot of code
is completely derivative works of the the Linux kernel, as such
only GPL-Compatible modules are intended to be used with this
framework, given that users of this framework are considered
completely derivative works of the Linux kernel.
Only upstream Linux kernel modules or kernel modules on their
way upstream are intended to be used by this.
Tested with ckmake:
I've started reading make -d output to realize that GNU Make
is pretty simple but darn stupid and needs a little help in
direction. Traditionally GNU Make will try to see if it needs
Makefile* generation. I can count 18 variations of Makefile it
looks for:
GNU Make will look for targets in the Makefile for each of these...
GNU Make will also look for these 18 variations of files for each
target that it does not a target rule for. There are two ways to
help GNU Make do the right thing, write a simple empty target rule [0]
or just extend the target into the .PHONY target. Lets just extend
the .PHONY target with the items we see in make -d are not needed.
This simple change forces GNU Make to skip 36 lookups of false
targets.
[0] Makefile : ;
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: avoid unnecessary recursion to include a file
I added recursion call to the same Makefile after noticing that
GNU Make *will* fail if a file that is being included does not
exist. I also added the option that the file *may* not exist by
prepending the inclusion of the file with "-". It turns out that
GNU Make is smart enough to look for targets for header files that
are included and *will not fail* if it can successfully build that
file and include it. I will note that this target file *does not
need* to be a dependency to any of the final targets, GNU Make
will just assume and add it. It is important to highlight that
GNU Make *will* run make against itself again after it builds the
file it needs to include. If GNU Make runs into this situation,
where it can build the target file it needs to include, it will
not fail but you will see something like this pesky warning:
Makefile:16: /home/mcgrof/compat/.config: No such file or directory
Under new found knowledge of how GNU Make works we simplify the
reading and running of the compat Makefile by ensuring that the
file we need to include is defined as a target but for sanity and
reader's sake (although technically not necessary) we also add the
file as a dependency to the modules target building.
Furthermore the pesky warning can confuse developers / users and
as it turns out we only really need it at build time. We take
advantage of the fact that the kernel will use the same Makefile
later upon building the external module and that we can identify
when this happens in the Makefile [0] and only *require* including
the header file upon module building time.
[0] the part where ifeq ($(KERNELRELEASE),) is false
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
As noted in the previous commit a Linux kernel module's
Makefile will be read twice, during initial GNU make run,
and later for when the kernel will build the external module.
Variables that require path consideration must address in
which context it needs to be defined and do so by detecting
at which run time case it wants to instantiate variables. In
our case we want to ensure that both COMPAT_CONFIG and
COMPAT_AUTOCONF are defined within the context of the
directory of the external module we are building as otherwise
GNU Make will try to treat it as part of the kernel's build
directory's files.
We already have COMPAT_CONFIG and COMPAT_AUTOCONF defined
under a ifeq ($(KERNELRELEASE),) check, we now just need
to add the directory context and then remove the other
now superfluous uses of the $(PWD).
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: move definition of COMPAT_CONFIG and COMPAT_AUTOCONF
The Makefile for external modules are read twice, once during
the initial make command, and then later to build the modules
target *by the kernel*. This ensures that we define the variables
COMPAT_CONFIG and COMPAT_AUTOCONF are only defined once.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
We broke parallel builds by breaking GNU Make's heuristics.
GNU Make does not whether or not target commands are sub-make
commands or not, these must be explicitly annotated. To tell
GNU Make that target command is going to be a sub-process
we can use the $(MAKE) variable for a command. Another option
is to tell GNU Make that a target command is *not* a sub-make
command instead explicitly by prepending a command with a plus,
"+" prior to the command. This will force GNU Make to avoid
supporting certain flags for those targets but more importantly,
it will also ensure that during execution of commands that are
*not* sub-make commands it will yield the jobserver to ensure
file descriptor / job sanity.
Annotate to GNU Make two commands that we issue are *not* sub-make
commands. This avoids stop the job server for these commands but
also allows GNU Make to figure out the heuristics to run the job
server for further sub-make commands -- in this case the recursive
call to make.
Reported-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
modpost, the second part of module building, does not
use NOSTDINC_FLAGS and friends so all the hackery we did
to use it to prefer our header files and include compat-2.6.h
will not work during modpost for older kernels. We don't really
need all that stuff during modpost even for newer kernels so
just avoid it all together.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: fix compilation warning for compat_firmware_class on 2.6.26
This fixes this compilation issue:
CC [M] /home/mcgrof/compat/compat/compat_firmware_class.o
/home/mcgrof/compat/compat/compat_firmware_class.c:24:0: warning: "to_dev" redefined
include/linux/input.h:1218:0: note: this is the location of the previous definition
/home/mcgrof/compat/compat/compat_firmware_class.c:24:0: warning: "to_dev" redefined
include/linux/input.h:1218:0: note: this is the location of the previous definition
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
The variables wasn't being set in shell. By defining
the variables in shell and outputing them once onto
a .config we avoid having to do release kernel checks
every single time.
This adds a series of CONFIG_COMPAT_${RHEL_MAJOR}_${i} tags
for each known RHEL version that we supercede. I cannot
verify if this is correct but this is my translation of
this to script:
compat: fix few compilations by adding compat_autoconf.h support
The Makefile was generating the appropriate CONFIG_COMPAT_KERNEL_*
variables for our Makefiles but this was being ignored by C files
as compat had no compat_autoconf.h being generated. This patch
addresses this but also puhes out the CONFIG_COMPAT_KERNEL_* variable
generation to scripts. We have now two scripts:
scripts/gen-compat-config.sh - generates .config for Makefile propagation
scripts/gen-compat-autoconf.sh - generates compat_autoconf.h for code propagation
This fixes running ckmake on older kernels. This issue was present
only on compat and not compat_wireless as compat_wireless was generating
its own compat_autoconf.h. This fixes compilation against some older
kernels of just the compat module alone. Some work is still required
for some newer and really ancient kernels:
This commit moved atomic_t and atomic64_t to a generic
place, but some archs already had it defined. Just include
that header for the archs that had it.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
The CONFIG_PHYS_ADDR_T_64BIT was added as of v2.6.28-rc1~271^2^4~6,
this is either u32 or u64 dependent on 64BIT || ARCH_PHYS_ADDR_T_64BIT.
The ARCH_PHYS_ADDR_T_64BIT allows architectures to override the
value even if the platform does not have CONFIG_64BIT. We simplify
this check by just checking for all known architecture variables and
also the CONFIG_64BIT -- but we skip adding this if the arch is
x86 or PPC which already had phys_addr_t.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
This adds get-compat-kernels, a utility that is intended
to be Linux distribution agnostic that downloads and installs
all kernel headers for all supported kernel releases of compat.
You also have the option of specifying you want to also install
the actual kernel image (get-compat-kernels -i).
We start off by adding support for Ubuntu on x86_64 as that
is what a few of us maintaining compat and compat-wireless run.
Just for kernel headers (default run of get-compat-kernels),
you'll need currently 205 M of hard drive space.
Once done with running get-compat-kernels, you can then
start running ckmake to verify your compat kernel changes
won't bust compilation against any known supported kernel.
I'd like to start requiring runs against this script for
patch submissions. Eventually we can try to add the same
runs against compat-wireless so we can verify integrity
against compilation for different kernel versions.
Support for different Linux distributios is welcomed.
John W. Linville [Thu, 26 Jan 2012 18:00:56 +0000 (13:00 -0500)]
compat: use kconfig.h in compat-2.6.h for 3.1 and later kernels
This file was introduced in commit 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99
and included in 3.1 and later kernels. It includes <generated/autoconf.h>
itself, as well as some other definitions that are used elsewhere.
Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Hauke Mehrtens [Thu, 26 Jan 2012 22:51:45 +0000 (23:51 +0100)]
compat: move br_port_exists() to compat-2.6.36.h
br_port_exists() was moved to a new compat-*.h file for every new
kernel release, as it is not in mainline. This patch moves it to compat-
2.6.36.h so it has not to be moved any more for a new kernel version.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Hauke Mehrtens [Sat, 3 Dec 2011 14:49:25 +0000 (15:49 +0100)]
compat: add config var for CORDIC and CRC8
Sometimes the kernel version compat-wireless is build against has
support for cordic and crc8 in its source, but these modules were not
build when the kernel was build, because no one selected them. The modules are
needed for the bcmsmac driver and they should be build every time when
they were not already build while the kernel was build.