1. 06 2月, 2009 3 次提交
    • P
      ixgbe: Update link setup code to better support autonegotiation of speed · 3201d313
      Peter P Waskiewicz Jr 提交于
      The current code has some flaws in it when performing autonegotiation,
      especially on KX/KX4 links.  This patch updates the code to better handle
      the autonegotiation states on link setup.  The patch also removes a redundant
      link configuration call on driver load, and moves link configuration to
      the ->open() path.
      Signed-off-by: NPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3201d313
    • P
      ixgbe: Refactor set_num_queues() and cache_ring_register() · bc97114d
      Peter P Waskiewicz Jr 提交于
      The current code to determine the number of queues the device will want
      on driver initialization is ugly and difficult to maintain.  It also
      doesn't allow for easy expansion for future features or future hardware.
      This patch refactors these routines, and make them easier to deal with.
      Signed-off-by: NPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc97114d
    • H
      tun: Limit amount of queued packets per device · 33dccbb0
      Herbert Xu 提交于
      Unlike a normal socket path, the tuntap device send path does
      not have any accounting.  This means that the user-space sender
      may be able to pin down arbitrary amounts of kernel memory by
      continuing to send data to an end-point that is congested.
      
      Even when this isn't an issue because of limited queueing at
      most end points, this can also be a problem because its only
      response to congestion is packet loss.  That is, when those
      local queues at the end-point fills up, the tuntap device will
      start wasting system time because it will continue to send
      data there which simply gets dropped straight away.
      
      Of course one could argue that everybody should do congestion
      control end-to-end, unfortunately there are people in this world
      still hooked on UDP, and they don't appear to be going away
      anywhere fast.  In fact, we've always helped them by performing
      accounting in our UDP code, the sole purpose of which is to
      provide congestion feedback other than through packet loss.
      
      This patch attempts to apply the same bandaid to the tuntap device.
      It creates a pseudo-socket object which is used to account our
      packets just as a normal socket does for UDP.  Of course things
      are a little complex because we're actually reinjecting traffic
      back into the stack rather than out of the stack.
      
      The stack complexities however should have been resolved by preceding
      patches.  So this one can simply start using skb_set_owner_w.
      
      For now the accounting is essentially disabled by default for
      backwards compatibility.  In particular, we set the cap to INT_MAX.
      This is so that existing applications don't get confused by the
      sudden arrival EAGAIN errors.
      
      In future we may wish (or be forced to) do this by default.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      33dccbb0
  2. 05 2月, 2009 11 次提交
  3. 04 2月, 2009 10 次提交
  4. 03 2月, 2009 16 次提交
    • M
      tun: Check supplemental groups in TUN/TAP driver. · 1bded710
      Michael Tokarev 提交于
      Michael Tokarev wrote:
      []
      > 2, and this is the main one: How about supplementary groups?
      >
      > Here I have a valid usage case: a group of testers running various
      > versions of windows using KVM (kernel virtual machine), 1 at a time,
      > to test some software.  kvm is set up to use bridge with a tap device
      > (there should be a way to connect to the machine).  Anyone on that group
      > has to be able to start/stop the virtual machines.
      >
      > My first attempt - pretty obvious when I saw -g option of tunctl - is
      > to add group ownership for the tun device and add a supplementary group
      > to each user (their primary group should be different).  But that fails,
      > since kernel only checks for egid, not any other group ids.
      >
      > What's the reasoning to not allow supplementary groups and to only check
      > for egid?
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1bded710
    • M
      dca: redesign locks to fix deadlocks · eb4400e3
      Maciej Sosnowski 提交于
      Change spin_locks to irqsave to prevent dead-locks.
      Protect adding and deleting to/from dca_providers list.
      Drop the lock during dca_sysfs_add_req() and dca_sysfs_remove_req() calls
      as they might sleep (use GFP_KERNEL allocation).
      Signed-off-by: NMaciej Sosnowski <maciej.sosnowski@intel.com>
      Acked-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb4400e3
    • F
      connector: create connector workqueue only while needed once · 1a5645bc
      Frederic Weisbecker 提交于
      The netlink connector uses its own workqueue to relay the datas sent
      from userspace to the appropriate callback.  If you launch the test
      from Documentation/connector and change it a bit to send a high flow
      of data, you will see thousands of events coming to the "cqueue"
      workqueue by looking at the workqueue tracer.
      
      This flow of events can be sent very quickly. So, to not encumber the
      kevent workqueue and delay other jobs, the "cqueue" workqueue should
      remain.
      
      But this workqueue is pointless most of the time, it will always be
      created (assuming you have built it of course) although only
      developpers with specific needs will use it.
      
      So avoid this "most of the time useless task", this patch proposes to
      create this workqueue only when needed once.  The first jobs to be
      sent to connector callbacks will be sent to kevent while the "cqueue"
      thread creation will be scheduled to kevent too.
      
      The following jobs will continue to be scheduled to keventd until the
      cqueue workqueue is created, and then the rest of the jobs will
      continue to perform as usual, through this dedicated workqueue.
      
      Each time I tested this patch, only the first event was sent to
      keventd, the rest has been sent to cqueue which have been created
      quickly.
      
      Also, this patch fixes some trailing whitespaces on the connector files.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a5645bc
    • R
      cassini/sungem: limit reaches -1, but 0 tested · ff01b916
      Roel Kluin 提交于
      while (limit--)
      	if (test())
      		break;
      
      if (limit <= 0)
      	goto test_failed;
      
      In the last iteration, limit is decremented after the test to 0.
      If just thereafter test() succeeds and a break occurs, the goto
      still occurs because limit is 0.
      Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ff01b916
    • R
      net: variables reach -1, but 0 tested · 46578a69
      Roel Kluin 提交于
      while (timeout--) { ... }
      
      timeout becomes -1 if the loop isn't ended otherwise, not 0.
      Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46578a69
    • T
      libata: implement HORKAGE_1_5_GBPS and apply it to WD My Book · 9062712f
      Tejun Heo 提交于
      3Gbps is often much more prone to transmission failures.  It's usually
      okay to let EH handle speed down after transmission failures but some
      WD My Book drives completely shutdown after certain transmission
      failures and after it only power cycling can revive them.  Combined
      with the fact that external drives often end up with cable assembly
      which is longer than usual and more likely to have intervening gender,
      this makes these drives very likely to shutdown under certain
      configurations virtually rendering them unusable.
      
      This patch implements HOARKGE_1_5_GBPS and applies it to WD My Book
      such that 1.5Gbps is forced once the device is identified.
      
      Please take a look at the following bz for related reports.
      
        http://bugzilla.kernel.org/show_bug.cgi?id=9913Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      9062712f
    • T
      libata: add no penalty retry request for EH device handling routines · cf9a590a
      Tejun Heo 提交于
      Let -EAGAIN from EH device handling routines trigger EH retry without
      consuming its tries count.  This will be used to implement link SPD
      horkage which requires hardreset to adjust SPD without affecting other
      EH decisions.  As it bypasses the forward progress guarantee provided
      by the tries count, the requester is responsible for ensuring forward
      progress.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      cf9a590a
    • T
      libata: improve probe failure handling · c2c7a89c
      Tejun Heo 提交于
      When link is flaky at high speed, it isn't uncommon for a device to
      repeatedly fail probing sequence early after successfully negotiating
      high link speed.  This often leads to consecutive hotplug events
      without successful probing.
      
      This patch improves libata EH such that it remembers probing trials
      and if there have been more than two unsuccessful trials in the past
      60 seconds, slows down link speed to 1.5Gbps.
      
      As link speed negotiation is the duty of the PHY layer proper, the
      goal of this fallback mechanism is to provide the last resort when
      everything else fails, which unfortunately happens not too
      infrequently, so no fancy 6->3->1.5 speeding down or highest
      successful transmission speed seen kind of logics (yet).
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c2c7a89c
    • T
      libata: add @spd_limit to sata_down_spd_limit() · a07d499b
      Tejun Heo 提交于
      Add @spd_limit to sata_down_spd_limit() so that the caller can specify
      the SPD limit it wants.  This parameter doesn't get in the way even
      when it's too low.  The closest possible limit is applied.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      a07d499b
    • T
      libata: clear dev->ering in smarter way · 99cf610a
      Tejun Heo 提交于
      dev->ering used to be cleared together with the rest of ata_device in
      ata_dev_init() which is called whenever a probing event occurs.
      dev->ering is about to be used to track probing failures so it needs
      to remain persistent over multiple porbing events.  This patch
      achieves this by doing the following.
      
      * Instead of CLEAR_OFFSET, define CLEAR_BEGIN and CLEAR_END and only
        clear between BEGIN and END.  ering is moved after END.  The split
        of persistent area is to allow hotter items remain at the head.
      
      * ering is explicitly cleared on ata_dev_disable() and when device
        attach succeeds.  So, ering is persistent throug a device's life
        time (unless explicitly cleared of course) and also through periods
        inbetween disablement of an attached device and successful detection
        of the next one.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      99cf610a
    • T
      libata: check onlineness before using SPD in sata_down_spd_limit() · 9913ff8a
      Tejun Heo 提交于
      sata_down_spd_limit() should check whether the link is online before
      using the SPD value to determine how to limit the link speed.  Factor
      out onlineness test and test it from sata_down_spd_limit().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      9913ff8a
    • T
      libata: move ata_dev_disable() to libata-eh.c · 678afac6
      Tejun Heo 提交于
      ata_dev_disable() is about to be more tightly integrated into EH
      logic.  Move it to libata-eh.c.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      678afac6
    • T
      libata: fix EH device failure handling · d89293ab
      Tejun Heo 提交于
      The dev->pio_mode > XFER_PIO_0 test is there to avoid unnecessary
      speed down warning messages but it accidentally disabled SATA link spd
      down during configuration phase after reset where PIO mode is always
      zero.
      
      This patch fixes the problem by moving the test where it belongs.
      This makes libata probing sequence behave better when the connection
      is flaky at higher link speeds which isn't too uncommon for eSATA
      devices.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      d89293ab
    • T
      sata_nv: ck804 has borked hardreset too · 8d993eaa
      Tejun Heo 提交于
      While playing with nvraid, I found out that rmmoding and insmoding
      often trigger hardreset failure on the first port (the second one was
      always okay).  Seriously, how diverse can you get with hardreset
      behaviors?  Anyways, make ck804 use noclassify variant too.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      8d993eaa
    • R
      libata: fix kernel-doc warnings · 5eb66fe0
      Randy Dunlap 提交于
      Fix libata kernel-doc warnings:
      
      Warning(linux-next-20090120//drivers/ata/libata-core.c:4720): Excess function parameter 'dev' description in 'ata_qc_new'
      Warning(linux-next-20090120//drivers/ata/libata-scsi.c:428): No description found for parameter 'ap'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      5eb66fe0
    • A
      ahci: add a module parameter to ignore the SSS flags for async scanning · f3d7f23f
      Arjan van de Ven 提交于
      The SSS flag, which directs the OS to spin up one disk at a time
      to not have the PSU blow out, sometimes gets set even when not needed.
      The effect of this is a longer-than-needed boot time.
      
      This patch adds a module parameter that makes the driver ignore SSS
      at least as far as the parallel scan during boot is concerned...
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f3d7f23f