21 Apr, 2009

18 commits


20 Apr, 2009

15 commits

  • As the sk_sleep wait queue actually lives in tfile, which may be
    detached from the tun device, bad things will happen when we use
    sk_sleep after detaching.

    Since the tun device is the persistent data structure here (when
    requested by the user), it makes much more sense to have the wait
    queue live there. There is no reason to have it in tfile at all
    since the only time we can wait is if we have a tun attached.
    In fact we already have a wait queue in tun_struct, so we might
    as well use it.

    Reported-by: Eric W. Biederman
    Tested-by: Christian Borntraeger
    Tested-by: Patrick McHardy
    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • The commit c70f182940f988448f3c12a209d18b1edc276e33 ("tun: Fix
    races between tun_net_close and free_netdev") fixed a race where
    an asynchronous deletion of a tun device can hose a poll(2) on
    a tun fd attached to that device.

    However, this came at the cost of moving the tun wait queue into
    the tun file data structure. The problem with this is that it
    imposes restrictions on when and where the tun device can access
    the wait queue since the tun file may change at any time due to
    detaching and reattaching.

    In particular, now that we need to use the wait queue on the
    receive path it becomes difficult to properly synchronise this
    with the detachment of the tun device.

    This patch solves the original race in a different way. Since
    the race is only because the underlying memory gets freed, we
    can prevent it simply by ensuring that we don't do that until
    all tun descriptors ever attached to the device (even if they
    have since be detached because they may still be sitting in poll)
    have been closed.

    This is done by using reference counting the attached tun file
    descriptors. The refcount in tun->sk has been reappropriated
    for this purpose since it was already being used for that, albeit
    from the opposite angle.

    Note that we no longer zero tfile->tun since tun_get will return
    NULL anyway after the refcount on tfile hits zero. Instead it
    represents whether this device has ever been attached to a device.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This loop over fragments in napi_fraginfo_skb() was "interesting".

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • David S. Miller
     
  • Signed-off-by: Marcin Slusarz
    Signed-off-by: David S. Miller

    Marcin Slusarz
     
  • Just noticed while doing some new work that the recent
    mid-wq adjustment logic will misbehave when FACK is not
    in use (happens either due sysctl'ed off or auto-detected
    reordering) because I forgot the relevant TCPCB tagbit.

    Signed-off-by: Ilpo Järvinen
    Signed-off-by: David S. Miller

    Ilpo Järvinen
     
  • Alex Sidorenko reported:

    "while experimenting with 'netem' we have found some strange behaviour. It
    seemed that ingress delay as measured by 'ping' command shows up on some
    hosts but not on others.

    After some investigation I have found that the problem is that skbuff->tstamp
    field value depends on whether there are any packet sniffers enabled. That
    is:

    - if any ptype_all handler is registered, the tstamp field is as expected
    - if there are no ptype_all handlers, the tstamp field does not show the delay"

    This patch prevents unnecessary update of tstamp in dev_queue_xmit_nit()
    on ingress path (with act_mirred) adding a check, so minimal overhead on
    the fast path, but only when sniffers etc. are active.

    Since netem at ingress seems to logically emulate a network before a host,
    tstamp is zeroed to trigger the update and pretend delays are from the
    outside.

    Reported-by: Alex Sidorenko
    Tested-by: Alex Sidorenko
    Signed-off-by: Jarek Poplawski
    Signed-off-by: David S. Miller

    Jarek Poplawski
     
  • This has been broken for a while. I happened to catch it testing because one
    app "knew" that the top line of the calls data was the policy line and got
    confused.

    Put the header back.

    Signed-off-by: Alan Cox
    Signed-off-by: David S. Miller

    Alan Cox
     
  • EEH attempts to recover up 6 times.
    The last attempt leaves all the ports and adapter down.hen
    The driver is then unloaded, bringing the adapter down again
    unconditionally. The unload will hang.
    Check if the adapter is already down before trying to bring it down again.

    Signed-off-by: Divy Le Ray
    Signed-off-by: David S. Miller

    Divy Le Ray
     
  • Release vectors when a MSI-X allocation fails.

    Signed-off-by: Divy Le Ray
    Signed-off-by: David S. Miller

    Divy Le Ray
     
  • The fatal error task can be scheduled while processing an offload packet
    in NAPI context when the connection handle is bogus. this can race
    with the ports being brought down and the cxgb3 workqueue being flushed.
    Stop napi processing before flushing the work queue.

    The ULP drivers (iSCSI, iWARP) might also schedule a task on keventd_wk
    while releasing a connection handle (cxgb3_offload.c::cxgb3_queue_tid_release()).
    The driver however does not flush any work on keventd_wq while being unloaded.
    This patch also fixes this.

    Also call cancel_delayed_work_sync in place of the the deprecated
    cancel_rearming_delayed_workqueue.

    Signed-off-by: Divy Le Ray
    Signed-off-by: David S. Miller

    Divy Le Ray
     
  • Use the existing periodic task to handle link faults.
    The link fault interrupt handler is also called in work queue context,
    which is wrong and might cause potential deadlocks.

    Signed-off-by: Divy Le Ray
    Signed-off-by: David S. Miller

    Divy Le Ray
     
  • The Broadcom chips with 2.1 firmware handle the fallback case to a SCO
    link wrongly when setting up eSCO connections.

    < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
    handle 11 voice setting 0x0060
    > HCI Event: Command Status (0x0f) plen 4
    Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
    > HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 1 bdaddr 00:1E:3A:xx:xx:xx type SCO encrypt 0x01

    The Link Manager negotiates the fallback to SCO, but then sends out
    a Connect Complete event. This is wrong and the Link Manager should
    actually send a Synchronous Connection Complete event if the Setup
    Synchronous Connection has been used. Only the remote side is allowed
    to use Connect Complete to indicate the missing support for eSCO in
    the host stack.

    This patch adds a workaround for this which clearly should not be
    needed, but reality is that broken Broadcom devices are deployed.

    Based on a report by Ville Tervo

    Signed-off-by: Marcel Holtman

    Marcel Holtmann
     
  • Some Bluetooth chips (like the ones from Texas Instruments) don't do
    proper eSCO negotiations inside the Link Manager. They just return an
    error code and in case of the Kyocera ED-8800 headset it is just a
    random error.

    < HCI Command: Setup Synchronous Connection 0x01|0x0028) plen 17
    handle 1 voice setting 0x0060
    > HCI Event: Command Status (0x0f) plen 4
    Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
    > HCI Event: Synchronous Connect Complete (0x2c) plen 17
    status 0x1f handle 257 bdaddr 00:14:0A:xx:xx:xx type eSCO
    Error: Unspecified Error

    In these cases it is up to the host stack to fallback to a SCO setup
    and so retry with SCO parameters.

    Based on a report by Nick Pelly

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • There is a missing call to rfcomm_dlc_clear_timer in the case that
    DEFER_SETUP is used and so the connection gets disconnected after the
    timeout even if it was successfully accepted previously.

    This patch adds a call to rfcomm_dlc_clear_timer to rfcomm_dlc_accept
    which will get called when the user accepts the connection by calling
    read() on the socket.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     

18 Apr, 2009

7 commits