1. 23 5月, 2008 1 次提交
  2. 09 1月, 2008 1 次提交
  3. 11 10月, 2007 1 次提交
    • S
      [NET]: Make NAPI polling independent of struct net_device objects. · bea3348e
      Stephen Hemminger 提交于
      Several devices have multiple independant RX queues per net
      device, and some have a single interrupt doorbell for several
      queues.
      
      In either case, it's easier to support layouts like that if the
      structure representing the poll is independant from the net
      device itself.
      
      The signature of the ->poll() call back goes from:
      
      	int foo_poll(struct net_device *dev, int *budget)
      
      to
      
      	int foo_poll(struct napi_struct *napi, int budget)
      
      The caller is returned the number of RX packets processed (or
      the number of "NAPI credits" consumed if you want to get
      abstract).  The callee no longer messes around bumping
      dev->quota, *budget, etc. because that is all handled in the
      caller upon return.
      
      The napi_struct is to be embedded in the device driver private data
      structures.
      
      Furthermore, it is the driver's responsibility to disable all NAPI
      instances in it's ->stop() device close handler.  Since the
      napi_struct is privatized into the driver's private data structures,
      only the driver knows how to get at all of the napi_struct instances
      it may have per-device.
      
      With lots of help and suggestions from Rusty Russell, Roland Dreier,
      Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
      
      Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
      Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
      
      [ Ported to current tree and all drivers converted.  Integrated
        Stephen's follow-on kerneldoc additions, and restored poll_list
        handling to the old style to fix mutual exclusion issues.  -DaveM ]
      Signed-off-by: NStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bea3348e
  4. 11 7月, 2007 1 次提交
  5. 07 7月, 2007 1 次提交
    • Y
      potential compiler error, irqfunc caller sites update · 0da2f0f1
      Yoann Padioleau 提交于
      In 7d12e780 David Howells performed
      this evolution:
       "IRQ: Maintain regs pointer globally rather than passing to IRQ handlers"
      
      He correctly updated many of the function definitions that were using this
      extra regs pointer parameter but forgot to update some caller sites of
      those functions.  The reason the modifications was not properly done on all
      drivers is that some drivers were rarely compiled because they are for
      AMIGA, or that some code sites were inside #ifdefs where the option is not
      set or inside #if 0.
      
      Here is the semantic patch that found the occurences
      and fixed the problem.
      
      @ rule1 @
      identifier fn;
      identifier irq, dev_id;
      typedef irqreturn_t;
      @@
      
      static irqreturn_t fn(int irq, void *dev_id)
      {
         ...
      }
      
      @@
      identifier rule1.fn;
      expression E1, E2, E3;
      @@
      
       fn(E1, E2
      -   ,E3
         )
      Signed-off-by: NYoann Padioleau <padator@wanadoo.fr>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0da2f0f1
  6. 26 4月, 2007 1 次提交
  7. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  8. 03 7月, 2006 1 次提交
  9. 01 7月, 2006 1 次提交
  10. 30 3月, 2006 1 次提交
  11. 22 3月, 2006 1 次提交
  12. 04 12月, 2005 1 次提交
  13. 01 12月, 2005 5 次提交
  14. 19 11月, 2005 1 次提交
    • L
      [PATCH] intel ixp2000 network driver · 15d014d1
      Lennert Buytenhek 提交于
      The way the hardware and firmware work is that there is one shared RX
      queue and IRQ for a number of different network interfaces.  Due to this,
      we would like to process received packets for every interface in the same
      NAPI poll handler, so we need a pseudo-device to schedule polling on.
      
      What the driver currently does is that it always schedules polling for
      the first network interface in the list, and processes packets for every
      interface in the poll handler for that first interface -- however, this
      scheme breaks down if the first network interface happens to not be up,
      since netif_rx_schedule_prep() checks netif_running().
      
      sky2 apparently has the same issue, and Stephen Hemminger suggested a
      way to work around this: create a variant of netif_rx_schedule_prep()
      that does not check netif_running().  I implemented this locally and
      called it netif_rx_schedule_prep_notup(), and it seems to work well,
      but it's something that probably not everyone would be happy with.
      
      The ixp2000 is an ARM CPU with a high-speed network interface in the
      CPU itself (full duplex 4Gb/s or 10Gb/s depending on the IXP model.)
      The CPU package also contains 8 or 16 (again depending on the IXP
      model) 'microengines', which are somewhat primitive but very fast
      and efficient processor cores which can be used to offload various
      things from the main CPU.
      
      This driver makes the high-speed network interface in the CPU visible
      and usable as a regular linux network device.  Currently, it only
      supports the Radisys ENP2611 IXP board, but adding support for other
      board types should be fairly easy.
      Signed-off-by: NLennert Buytenhek <buytenh@wantstofly.org>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      15d014d1