1. 06 Jan, 2011 1 commit
  2. 18 Oct, 2010 1 commit
  3. 06 May, 2010 1 commit
    • WANG Cong's avatar
      netpoll: add generic support for bridge and bonding devices · 0e34e931
      WANG Cong authored
      
      
      This whole patchset is for adding netpoll support to bridge and bonding
      devices. I already tested it for bridge, bonding, bridge over bonding,
      and bonding over bridge. It looks fine now.
      
      To make bridge and bonding support netpoll, we need to adjust
      some netpoll generic code. This patch does the following things:
      
      1) introduce two new priv_flags for struct net_device:
         IFF_IN_NETPOLL which identifies we are processing a netpoll;
         IFF_DISABLE_NETPOLL is used to disable netpoll support for a device
         at run-time;
      
      2) introduce one new method for netdev_ops:
         ->ndo_netpoll_cleanup() is used to clean up netpoll when a device is
           removed.
      
      3) introduce netpoll_poll_dev() which takes a struct net_device * parameter;
         export netpoll_send_skb() and netpoll_poll_dev() which will be used later;
      
      4) hide a pointer to struct netpoll in struct netpoll_info, ditto.
      
      5) introduce ->real_dev for struct netpoll.
      
      6) introduce a new status NETDEV_BONDING_DESLAE, which is used to disable
         netconsole before releasing a slave, to avoid deadlocks.
      
      Cc: David Miller <davem@davemloft.net>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarWANG Cong <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0e34e931
  4. 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.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      
      
      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
        file.
      
      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
         files.
      
      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
         necessary.
      
      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>
      5a0e3ad6
  5. 01 May, 2009 1 commit
    • Bruno Prémont's avatar
      netconsole: take care of NETDEV_UNREGISTER event · 2382b15b
      Bruno Prémont authored
      
      
      When netconsole is loaded and a network interface fades away (e.g. on
      rmmod $interface_driver_module) the rmmod remains stuck and some locks
      are taken that prevent any additional module loading/unloading as well
      as interface up/down changes.
      In addition kernel logs (and console) get flooded at 10s interval with
      
      [  122.464065] unregister_netdevice: waiting for eth0 to become free. Usage count = 1
      [  132.704059] unregister_netdevice: waiting for eth0 to become free. Usage count = 1
      
      This patch lets netconsole take NETDEV_UNREGISTER event into account
      and release the affected interface if it was in use.
      Signed-off-by: default avatarBruno Prémont <bonbons@linux-vserver.org>
      Acked-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2382b15b
  6. 29 Mar, 2009 1 commit
  7. 27 Oct, 2008 1 commit
  8. 01 Aug, 2008 1 commit
  9. 17 Jul, 2008 2 commits
  10. 14 Jul, 2008 1 commit
    • Joel Becker's avatar
      configfs: Allow ->make_item() and ->make_group() to return detailed errors. · 11c3b792
      Joel Becker authored
      
      
      The configfs operations ->make_item() and ->make_group() currently
      return a new item/group.  A return of NULL signifies an error.  Because
      of this, -ENOMEM is the only return code bubbled up the stack.
      
      Multiple folks have requested the ability to return specific error codes
      when these operations fail.  This patch adds that ability by changing the
      ->make_item/group() ops to return an int.
      
      Also updated are the in-kernel users of configfs.
      Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
      11c3b792
  11. 15 Apr, 2008 1 commit
    • Michael Ellerman's avatar
      netconsole: only set CON_PRINTBUFFER if the user specifies a netconsole · 0517deed
      Michael Ellerman authored
      Since 0bcc1816
      
       (netconsole: Support
      dynamic reconfiguration using configfs), the netconsole is always
      registered, regardless of whether the user actually specified a
      netconsole configuration on the command line.
      
      However because netconsole has CON_PRINTBUFFER set, when it is
      registered it causes the printk buffer to be replayed to all consoles.
      When there is no netconsole configured this is a) pointless, and b)
      somewhat annoying for the user of the existing console.
      
      So instead we should only set CON_PRINTBUFFER if there is a netconsole
      configuration found on the command line. This retains the existing
      behaviour if a netconsole is setup by the user, and avoids spamming
      other consoles when we're only registering for the dynamic
      netconsole case.
      Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0517deed
  12. 15 Feb, 2008 1 commit
  13. 28 Jan, 2008 1 commit
  14. 10 Oct, 2007 9 commits
    • Joe Perches's avatar
      [NET]: Introduce and use print_mac() and DECLARE_MAC_BUF() · 0795af57
      Joe Perches authored
      
      
      This is nicer than the MAC_FMT stuff.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0795af57
    • Satyam Sharma's avatar
      [NET] netconsole: Support dynamic reconfiguration using configfs · 0bcc1816
      Satyam Sharma authored
      
      
      Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.
      
      This patch introduces support for dynamic reconfiguration (adding, removing
      and/or modifying parameters of netconsole targets at runtime) using a
      userspace interface exported via configfs.  Documentation is also updated
      accordingly.
      
      Issues and brief design overview:
      
      (1) Kernel-initiated creation / destruction of kernel objects is not
          possible with configfs -- the lifetimes of the "config items" is managed
          exclusively from userspace.  But netconsole must support boot/module
          params too, and these are parsed in kernel and hence netpolls must be
          setup from the kernel.  Joel Becker suggested to separately manage the
          lifetimes of the two kinds of netconsole_target objects -- those created
          via configfs mkdir(2) from userspace and those specified from the
          boot/module option string.  This adds complexity and some redundancy here
          and also means that boot/module param-created targets are not exposed
          through the configfs namespace (and hence cannot be updated / destroyed
          dynamically).  However, this saves us from locking / refcounting
          complexities that would need to be introduced in configfs to support
          kernel-initiated item creation / destroy there.
      
      (2) In configfs, item creation takes place in the call chain of the
          mkdir(2) syscall in the driver subsystem.  If we used an ioctl(2) to
          create / destroy objects from userspace, the special userspace program is
          able to fill out the structure to be passed into the ioctl and hence
          specify attributes such as local interface that are required at the time
          we set up the netpoll.  For configfs, this information is not available at
          the time of mkdir(2).  So, we keep all newly-created targets (via
          configfs) disabled by default.  The user is expected to set various
          attributes appropriately (including the local network interface if
          required) and then write(2) "1" to the "enabled" attribute.  Thus,
          netpoll_setup() is then called on the set parameters in the context of
          _this_ write(2) on the "enabled" attribute itself.  This design enables
          the user to reconfigure existing netconsole targets at runtime to be
          attached to newly-come-up interfaces that may not have existed when
          netconsole was loaded or when the targets were actually created.  All this
          effectively enables us to get rid of custom ioctls.
      
      (3) Ultra-paranoid configfs attribute show() and store() operations, with
          sanity and input range checking, using only safe string primitives, and
          compliant with the recommendations in Documentation/filesystems/sysfs.txt.
      
      (4) A new function netpoll_print_options() is created in the netpoll API,
          that just prints out the configured parameters for a netpoll structure.
          netpoll_parse_options() is modified to use that and it is also exported to
          be used from netconsole.
      Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
      Acked-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0bcc1816
    • Satyam Sharma's avatar
      [NET] netconsole: Support multiple logging targets · b5427c27
      Satyam Sharma authored
      
      
      Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.
      
      This patch introduces support for multiple targets, independent of
      CONFIG_NETCONSOLE_DYNAMIC -- this is useful even in the default case and
      (including the infrastructure introduced in previous patches) doesn't really
      add too many bytes to module text.  All the complexity (and size) comes with
      the dynamic reconfigurability / userspace interface patch, and so it's
      plausible users may want to keep this enabled but that disabled (say to avoid
      a dependency on CONFIG_CONFIGFS_FS too).
      
      Also update documentation to mention the use of ";" separator to specify
      multiple logging targets in the boot/module option string.
      
      Brief overview:
      
      We maintain a target_list (and corresponding lock).  Get rid of the static
      "default_target" and introduce allocation and release functions for our
      netconsole_target objects (but keeping sure to preserve previous behaviour
      such as default values).  During init_netconsole(), ";" is used as the
      separator to identify multiple target specifications in the boot/module option
      string.  The target specifications are parsed and netpolls setup.  During
      exit, the target_list is torn down and all items released.
      Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
      Signed-off-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5427c27
    • Satyam Sharma's avatar
      [NET] netconsole: Introduce netconsole_netdev_notifier · 17951f34
      Satyam Sharma authored
      
      
      Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.
      
      To update fields of underlying netpoll structure at runtime on corresponding
      NETDEV_CHANGEADDR or NETDEV_CHANGENAME notifications.
      
      ioctl(SIOCSIFHWADDR or SIOCSIFNAME) could be used to change the hardware/MAC
      address or name of the local interface that our netpoll is attached to.
      Whenever this happens, netdev notifier chain is called out with the
      NETDEV_CHANGEADDR or NETDEV_CHANGENAME event message.  We respond to that and
      update the local_mac or dev_name field of the struct netpoll.  This makes
      sense anyway, but is especially required for dynamic netconsole because the
      netpoll structure's internal members become user visible files when either
      sysfs or configfs are used.  So this helps us to keep up with the MAC
      address/name changes and keep values in struct netpoll uptodate.
      
      [ Note that ioctl(SIOCSIFADDR) to change IP address of interface at
        runtime is not handled (to update local_ip of netpoll) on purpose --
        some setups may set the local_ip to a private address, not necessary
        the actual IP address of the sender host, as presently allowed. ]
      Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
      Signed-off-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      17951f34
    • Satyam Sharma's avatar
      [NET] netconsole: Introduce netconsole_target · df180e36
      Satyam Sharma authored
      
      
      Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.
      
      Introduce a wrapper structure over netpoll to represent logging targets
      configured in netconsole.  This will get extended with other members in
      further patches.
      
      This is done independent of the (to-be-introduced) NETCONSOLE_DYNAMIC config
      option so that we're able to drastically cut down on the #ifdef complexity of
      final netconsole.c.  Also, struct netconsole_target would be required for
      multiple targets support also, and not just dynamic reconfigurability.
      Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
      Signed-off-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      df180e36
    • Satyam Sharma's avatar
      [NET] netconsole: Use netif_running() in write_msg() · 0cc120be
      Satyam Sharma authored
      
      
      Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.
      
      Avoid unnecessarily disabling interrupts and calling netpoll_send_udp() if the
      corresponding local interface is not up.
      Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
      Acked-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0cc120be
    • Satyam Sharma's avatar
      [NET] netconsole: Simplify boot/module option setup logic · d2b60881
      Satyam Sharma authored
      
      
      Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.
      
      Presently, boot/module parameters are set up quite differently for the case of
      built-in netconsole (__setup() -> obsolete_checksetup() ->
      netpoll_parse_options() -> strlen(config) == 0 in init_netconsole()) vs
      modular netconsole (module_param_string() -> string copied to the config
      variable -> strlen(config) != 0 init_netconsole() -> netpoll_parse_options()).
      
      This patch makes both of them similar by doing exactly the equivalent of a
      module_param_string() in option_setup() also -- just copying the param string
      passed from the kernel command line into "config" variable.  So,
      strlen(config) != 0 in both cases, and netpoll_parse_options() is always
      called from init_netconsole(), thus making the setup logic for both cases
      similar.
      
      Now, option_setup() is only ever called / used for the built-in case, so we
      put it inside a #ifndef MODULE, otherwise gcc will complain about
      option_setup() being "defined but not used".  Also, the "configured" variable
      is redundant with this patch and hence removed.
      Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
      Signed-off-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
      Acked-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d2b60881
    • Satyam Sharma's avatar
      [NET] netconsole: Remove bogus check · d133ccbd
      Satyam Sharma authored
      
      
      Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.
      
      The (!np.dev) check in write_msg() is bogus (always false), because: np.dev is
      set by netpoll_setup(), which is called by init_netconsole() before
      register_console(), so write_msg() cannot be triggered unless netpoll_setup()
      successfully set np.dev.  Also np.dev cannot go away from under us, because
      netpoll_setup() grabs us reference on it.  So let's remove the bogus check.
      Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
      Acked-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
      Acked-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d133ccbd
    • Satyam Sharma's avatar
      [NET] netconsole: Cleanups, codingstyle, prettyfication · d39badf0
      Satyam Sharma authored
      
      
      Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.
      
      (1) Remove unwanted headers.
      (2) Mark __init and __exit as appropriate.
      (3) Various trivial codingstyle and prettification stuff.
      Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
      Signed-off-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
      Acked-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d39badf0
  15. 02 Dec, 2006 2 commits
    • Stephen Hemminger's avatar
      netpoll queue cleanup · 5de4a473
      Stephen Hemminger authored
      
      
      The beast had a long and not very happy history. At one
      point, a friend (netdump) had asked that he open up a little.
      Well, the friend was long gone now, and the beast had
      this dangling piece hanging (netpoll_queue).
      
      It wasn't hard to stitch the netpoll_queue back in
      where it belonged and make everything tidy.
      Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
      5de4a473
    • Stephen Hemminger's avatar
      netpoll setup error handling · b41848b6
      Stephen Hemminger authored
      
      
      The beast was not always healthy. When it was sick,
      it tended to be laconic and not tell anyone the real problem.
      A few small changes had it telling the world about its
      problems, if they really wanted to hear.
      Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
      b41848b6
  16. 05 Jun, 2006 1 commit
  17. 09 Apr, 2006 1 commit
  18. 31 Mar, 2006 1 commit
    • OGAWA Hirofumi's avatar
      [PATCH] Don't pass boot parameters to argv_init[] · 9b41046c
      OGAWA Hirofumi authored
      
      
      The boot cmdline is parsed in parse_early_param() and
      parse_args(,unknown_bootoption).
      
      And __setup() is used in obsolete_checksetup().
      
      	start_kernel()
      		-> parse_args()
      			-> unknown_bootoption()
      				-> obsolete_checksetup()
      
      If __setup()'s callback (->setup_func()) returns 1 in
      obsolete_checksetup(), obsolete_checksetup() thinks a parameter was
      handled.
      
      If ->setup_func() returns 0, obsolete_checksetup() tries other
      ->setup_func().  If all ->setup_func() that matched a parameter returns 0,
      a parameter is seted to argv_init[].
      
      Then, when runing /sbin/init or init=app, argv_init[] is passed to the app.
      If the app doesn't ignore those arguments, it will warning and exit.
      
      This patch fixes a wrong usage of it, however fixes obvious one only.
      Signed-off-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      9b41046c
  19. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4