1. 31 May, 2010 2 commits
  2. 25 May, 2010 1 commit
    • Kay Sievers's avatar
      driver core: add devname module aliases to allow module on-demand auto-loading · 578454ff
      Kay Sievers authored
      This adds:
        alias: devname:<name>
      to some common kernel modules, which will allow the on-demand loading
      of the kernel module when the device node is accessed.
      Ideally all these modules would be compiled-in, but distros seems too
      much in love with their modularization that we need to cover the common
      cases with this new facility. It will allow us to remove a bunch of pretty
      useless init scripts and modprobes from init scripts.
      The static device node aliases will be carried in the module itself. The
      program depmod will extract this information to a file in the module directory:
        $ cat /lib/modules/2.6.34-00650-g537b60d1
        # Device nodes to trigger on-demand module loading.
        microcode cpu/microcode c10:184
        fuse fuse c10:229
        ppp_generic ppp c108:0
        tun net/tun c10:200
        dm_mod mapper/control c10:235
      Udev will pick up the depmod created file on startup and create all the
      static device nodes which the kernel modules specify, so that these modules
      get automatically loaded when the device node is accessed:
        $ /sbin/udevd --debug
        static_dev_create_from_modules: mknod '/dev/cpu/microcode' c10:184
        static_dev_create_from_modules: mknod '/dev/fuse' c10:229
        static_dev_create_from_modules: mknod '/dev/ppp' c108:0
        static_dev_create_from_modules: mknod '/dev/net/tun' c10:200
        static_dev_create_from_modules: mknod '/dev/mapper/control' c10:235
        udev_rules_apply_static_dev_perms: chmod '/dev/net/tun' 0666
        udev_rules_apply_static_dev_perms: chmod '/dev/fuse' 0666
      A few device nodes are switched to statically allocated numbers, to allow
      the static nodes to work. This might also useful for systems which still run
      a plain static /dev, which is completely unsafe to use with any dynamic minor
      The devname aliases must be limited to the *common* and *single*instance*
      device nodes, like the misc devices, and never be used for conceptually limited
      systems like the loop devices, which should rather get fixed properly and get a
      control node for losetup to talk to, instead of creating a random number of
      device nodes in advance, regardless if they are ever used.
      This facility is to hide the mess distros are creating with too modualized
      kernels, and just to hide that these modules are not compiled-in, and not to
      paper-over broken concepts. Thanks! :)
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Alasdair G Kergon <agk@redhat.com>
      Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
      Cc: Ian Kent <raven@themaw.net>
      Signed-Off-By: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  3. 03 May, 2010 2 commits
  4. 03 Apr, 2010 1 commit
  5. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      The script does the followings.
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
      The conversion was done in the following steps.
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
      6. percpu.h was updated not to include slab.h.
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
  6. 19 Jan, 2010 1 commit
    • Lennart Sorensen's avatar
      ppp_generic.c severly whitespace damanged by 9c705260 · fa44a73c
      Lennart Sorensen authored
      I was just looking at ppp_generic, and noticed that it fairly recently
      (as in the last year) got rather mangled with many spaces turned into tabs
      in places they very much shouldn't have been.  I tracked it down to commit
       (ppp: ppp_mp_explode() redesign).
      I am amazed if that patch passed the patch checking script.  I have no
      idea what kind of weird editor setting did this, but it has to have been a
      weird editor setting or a very unfortunate search and replace gone wrong.
      I only found it trying to apply a patch I was playing with and wondering
      why it wouldn't apply.  Then I found there were tabs in the middle of
      comments that used to be spaces.
      Well here is a patch that should fix it up as far as I can tell.
      Purely whitespace repair.  No actual code changes.
      Signed-off-by: default avatarLen Sorensen <lsorense@csclub.uwaterloo.ca>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  7. 03 Dec, 2009 1 commit
  8. 01 Dec, 2009 1 commit
  9. 18 Nov, 2009 1 commit
  10. 17 Nov, 2009 1 commit
    • Ben McKeegan's avatar
      ppp: fix BUG on non-linear SKB (multilink receive) · 82b3cc1a
      Ben McKeegan authored
      PPP does not correctly call pskb_may_pull() on all necessary receive paths
      before reading the PPP protocol, thus causing PPP to report seemingly
      random 'unsupported protocols' and eventually trigger BUG_ON(skb->len <
      skb->data_len) in skb_pull_rcsum() when receiving multilink protocol in
      non-linear skbs.
      ppp_receive_nonmp_frame() does not call pskb_may_pull() before reading the
      protocol number.  For the non-mp receive path this is not a problem, as
      this check is done in ppp_receive_frame().  For the mp receive path,
      ppp_mp_reconstruct() usually copies the data into a new linear skb.
      However, in the case where the frame is made up of a single mp fragment,
      the mp header is pulled and the existing skb used.  This skb was then
      passed to ppp_receive_nonmp_frame() without checking if the encapsulated
      protocol header could safely be read.
      Signed-off-by: default avatarBen McKeegan <ben@netservers.co.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  11. 01 Sep, 2009 1 commit
  12. 19 Aug, 2009 1 commit
    • David S. Miller's avatar
      ppp_generic: Help GCC see that 'flen' is always initialized. · 886f9fe6
      David S. Miller authored
      It's too stupid to see that we always set flen to something
      before we use it in ppp_mp_explode():
      drivers/net/ppp_generic.c: In function 'ppp_push':
      drivers/net/ppp_generic.c:1314: warning: 'flen' may be used uninitialized in this function
      drivers/net/ppp_generic.c:1314: note: 'flen' was declared here
      This started warning after commit a53a8b56
      ("ppp: fix lost fragments in ppp_mp_explode() (resubmit)")
      So just put an explicit unconditional initialization there to
      hush it up.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  13. 02 Aug, 2009 1 commit
    • Ben McKeegan's avatar
      ppp: fix lost fragments in ppp_mp_explode() (resubmit) · a53a8b56
      Ben McKeegan authored
      This patch fixes the corner cases where the sum of MTU of the free
      channels (adjusted for fragmentation overheads) is less than the MTU
      of PPP link.  There are at least 3 situations where this case might
      - some of the channels are busy
      - the multilink session is running in a degraded state (i.e. with less
      than its full complement of active channels)
      - by design, where multilink protocol is being used to artificially
      increase the effective link MTU of a single link.
      Without this patch, at most 1 fragment is ever sent per free channel
      for a given PPP frame and any remaining part of the PPP frame that
      does not fit into those fragments is silently discarded.
      This patch restores the original behaviour which was broken by commit
      redesign'.  Once all 'free' channels have been given a fragment, an
      additional fragment is queued to each available channel in turn, as many
      times as necessary, until the entire PPP frame has been consumed.
      Signed-off-by: default avatarBen McKeegan <ben@netservers.co.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  14. 05 Jul, 2009 1 commit
  15. 19 May, 2009 1 commit
  16. 13 Mar, 2009 1 commit
    • Gabriele Paoloni's avatar
      ppp: ppp_mp_explode() redesign · 9c705260
      Gabriele Paoloni authored
      I found the PPP subsystem to not work properly when connecting channels
      with different speeds to the same bundle.
      Problem Description:
      As the "ppp_mp_explode" function fragments the sk_buff buffer evenly
      among the PPP channels that are connected to a certain PPP unit to
      make up a bundle, if we are transmitting using an upper layer protocol
      that requires an Ack before sending the next packet (like TCP/IP for
      example), we will have a bandwidth bottleneck on the slowest channel
      of the bundle.
      Let's clarify by an example. Let's consider a scenario where we have
      two PPP links making up a bundle: a slow link (10KB/sec) and a fast
      link (1000KB/sec) working at the best (full bandwidth). On the top we
      have a TCP/IP stack sending a 1000 Bytes sk_buff buffer down to the
      PPP subsystem. The "ppp_mp_explode" function will divide the buffer in
      two fragments of 500B each (we are neglecting all the headers, crc,
      flags etc?.). Before the TCP/IP stack sends out the next buffer, it
      will have to wait for the ACK response from the remote peer, so it
      will have to wait for both fragments to have been sent over the two
      PPP links, received by the remote peer and reconstructed. The
      resulting behaviour is that, rather than having a bundle working
      @1010KB/sec (the sum of the channels bandwidths), we'll have a bundle
      working @20KB/sec (the double of the slowest channels bandwidth).
      Problem Solution:
      The problem has been solved by redesigning the "ppp_mp_explode"
      function in such a way to make it split the sk_buff buffer according
      to the speeds of the underlying PPP channels (the speeds of the serial
      interfaces respectively attached to the PPP channels). Referring to
      the above example, the redesigned "ppp_mp_explode" function will now
      divide the 1000 Bytes buffer into two fragments whose sizes are set
      according to the speeds of the channels where they are going to be
      sent on (e.g .  10 Byets on 10KB/sec channel and 990 Bytes on
      1000KB/sec channel).  The reworked function grants the same
      performances of the original one in optimal working conditions (i.e. a
      bundle made up of PPP links all working at the same speed), while
      greatly improving performances on the bundles made up of channels
      working at different speeds.
      Signed-off-by: default avatarGabriele Paoloni <gabriele.paoloni@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  17. 27 Feb, 2009 2 commits
  18. 17 Feb, 2009 1 commit
  19. 09 Feb, 2009 1 commit
  20. 21 Jan, 2009 1 commit
  21. 12 Jan, 2009 1 commit
    • Cyrill Gorcunov's avatar
      net: ppp_generic - fix regressions caused by IDR conversion · 85997576
      Cyrill Gorcunov authored
      The commits:
      	("net: ppp_generic - use idr technique instead of cardmaps")
      	("net: ppp_generic - use DEFINE_IDR for static initialization")
      introduced usage of IDR functionality but broke userspace side.
      Before this commits it was possible to allocate new ppp interface with
      specified number. Now it fails with EINVAL.  Fix it by trying to
      allocate interface with specified unit number and return EEXIST if
      fail which allow pppd to ask us to allocate new unit number.
      And fix messages on memory allocation fails - add details that it's
      PPP module who is complaining.
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  22. 18 Dec, 2008 2 commits
  23. 17 Dec, 2008 1 commit
  24. 20 Nov, 2008 2 commits
  25. 19 Nov, 2008 1 commit
  26. 03 Nov, 2008 1 commit
  27. 16 Oct, 2008 2 commits
  28. 09 Oct, 2008 1 commit
  29. 23 Sep, 2008 1 commit
  30. 21 Sep, 2008 1 commit
  31. 26 Jul, 2008 1 commit
  32. 21 Jul, 2008 1 commit
  33. 20 Jun, 2008 2 commits