25 Mar, 2010

4 commits

  • The original code saved the error value but just returned 0 in the end.

    Signed-off-by: Dan Carpenter
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Dan Carpenter
     
  • The dma map fields in the skb_shared_info structure no longer has any users
    and can be dropped since it is making the skb_shared_info unecessarily larger.

    Running slabtop show that we were using 4K slabs for the skb->head on x86_64 w/
    an allocation size of 1522. It turns out that the dma_head and dma_maps array
    made skb_shared large enough that we had crossed over the 2k boundary with
    standard frames and as such we were using 4k blocks of memory for all skbs.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Jeff Kirsher
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • Updates real_num_tx_queues in case underlying real device
    has changed real_num_tx_queues.

    -v2
    As per Eric Dumazet comment:-
    -- adds BUG_ON to catch case of real_num_tx_queues exceeding num_tx_queues.
    -- created this self contained patch to just update real_num_tx_queues.

    Signed-off-by: Vasu Dev
    Signed-off-by: Jeff Kirsher
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Vasu Dev
     
  • This is required to correctly select vlan tx queue for a driver
    supporting multi tx queue with ndo_select_queue implemented since
    currently selected vlan tx queue is unaligned to selected queue by
    real net_devce ndo_select_queue.

    Unaligned vlan tx queue selection causes thrash with higher vlan
    tx lock contention for least fcoe traffic and wrong socket tx
    queue_mapping for ixgbe having ndo_select_queue implemented.

    -v2

    As per Eric Dumazet comments, mirrored
    vlan net_device_ops to have them with and without vlan_dev_select_queue
    and then select according to real dev ndo_select_queue present or not
    for a vlan net_device. This is to completely skip vlan_dev_select_queue
    calling for real net_device not supporting ndo_select_queue.

    Signed-off-by: Vasu Dev
    Signed-off-by: Jeff Kirsher
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Vasu Dev
     

24 Mar, 2010

7 commits

  • This change makes it so that vlan_gro_receive is only used if vlans have been
    registered to the adapter structure. Previously we were just sending all vlan
    tagged frames in via this function but this results in a null pointer
    dereference when vlans are not registered.

    [ This fixes bugzilla entry 15582 -Eric Dumazet]

    Signed-off-by: Alexander Duyck
    Signed-off-by: Jeff Kirsher
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • Previously the driver tweaked txqueuelen to avoid false Tx hang reports seen at half duplex.
    This had the effect of overriding user set values on link change/reset. Testing shows that
    adjusting only the timeout factor is sufficient to prevent Tx hang reports at half duplex.

    Based on e1000e patch by Franco Fichtner

    Signed-off-by: Emil Tantilov
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Emil Tantilov
     
  • Don't aggregate rx_no_buffer_count into rx_fifo_errors. RNBC counts
    packets that get queued temporarily in the adapter's FIFO. These
    packets are not dropped and are not errors. The correct counter
    is rx_missed_errors (MPC).

    Signed-off-by: Mitch Williams
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Mitch Williams
     
  • Netpoll needs to call the proper handler depending on the IRQ mode
    and the vector.

    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Michael Chan
     
  • The bnx2 driver calls netif_napi_add() for all the NAPI structs during
    ->probe() time but not all of them will be used if we're not in MSI-X
    mode. This creates a problem for netpoll since it will poll all the
    NAPI structs in the dev_list whether or not they are scheduled, resulting
    in a crash when we access structure fields not initialized for that vector.

    We fix it by moving the netif_napi_add() call to ->open() after the number
    of IRQ vectors has been determined.

    Signed-off-by: Benjamin Li
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Benjamin Li
     
  • ksz884x: fix return value of netdev_set_eeprom

    netdev_set_eeprom() confused ethtool by just returning 1 on error
    instead of a proper -EINVAL.

    Signed-off-by: Jens Rottmann
    Signed-off-by: David S. Miller

    Jens Rottmann
     
  • Allows the net_cls cgroup subsystem to be compiled as a module

    This patch modifies net/sched/cls_cgroup.c to allow the net_cls subsystem
    to be optionally compiled as a module instead of builtin. The
    cgroup_subsys struct is moved around a bit to allow the subsys_id to be
    either declared as a compile-time constant by the cgroup_subsys.h include
    in cgroup.h, or, if it's a module, initialized within the struct by
    cgroup_load_subsys.

    Signed-off-by: Ben Blum
    Acked-by: Li Zefan
    Cc: Paul Menage
    Cc: "David S. Miller"
    Cc: KAMEZAWA Hiroyuki
    Cc: Lai Jiangshan
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Ben Blum
     

23 Mar, 2010

13 commits

  • I haven't been able to get link up on a NX_P3_B1 since 2.6.31. The
    driver complains about a firmware hang instead. When I asked I was
    told rev 0x41 was a preproduction rev. So disable support in the
    driver so no one is surprised the code doesn't work.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • v2: update according to Frans' comments.

    Currently, if we leave spaces before dst port,
    netconsole will silently accept it as 0. Warn about this.

    Also, when spaces appear in other places, make them
    visible in error messages.

    Signed-off-by: WANG Cong
    Cc: David Miller
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Amerigo Wang
     
  • The MMR bits are being moved to this header, so include it.

    Signed-off-by: Mike Frysinger
    Acked-by: Wolfgang Grandegger
    Signed-off-by: David S. Miller

    Mike Frysinger
     
  • David S. Miller
     
  • Commit 45575f5a426c ("ppc64 sys_ipc breakage in 2.6.34-rc2") fixed the
    definition of the sys_ipc() helper, but didn't fix the prototype in

    Reported-and-tested-by: Andreas Schwab
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • alloc_skb() can return NULL.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    Tetsuo Handa
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    virtio: console: Check if port is valid in resize_console
    virtio: console: Generate a kobject CHANGE event on adding 'name' attribute

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (38 commits)
    ip_gre: include route header_len in max_headroom calculation
    if_tunnel.h: add missing ams/byteorder.h include
    ipv4: Don't drop redirected route cache entry unless PTMU actually expired
    net: suppress lockdep-RCU false positive in FIB trie.
    Bluetooth: Fix kernel crash on L2CAP stress tests
    Bluetooth: Convert debug files to actually use debugfs instead of sysfs
    Bluetooth: Fix potential bad memory access with sysfs files
    netfilter: ctnetlink: fix reliable event delivery if message building fails
    netlink: fix NETLINK_RECV_NO_ENOBUFS in netlink_set_err()
    NET_DMA: free skbs periodically
    netlink: fix unaligned access in nla_get_be64()
    tcp: Fix tcp_mark_head_lost() with packets == 0
    net: ipmr/ip6mr: fix potential out-of-bounds vif_table access
    KS8695: update ksp->next_rx_desc_read at the end of rx loop
    igb: Add support for 82576 ET2 Quad Port Server Adapter
    ixgbevf: Message formatting cleanups
    ixgbevf: Shorten up delay timer for watchdog task
    ixgbevf: Fix VF Stats accounting after reset
    ixgbe: Set IXGBE_RSC_CB(skb)->DMA field to zero after unmapping the address
    ixgbe: fix for real_num_tx_queues update issue
    ...

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
    edac, mce: Filter out invalid values

    Linus Torvalds
     
  • alloc_skb() can return NULL.

    Signed-off-by: Tetsuo Handa
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Tetsuo Handa
     
  • It seems clear from the surrounding code that xpermits is allowed to be
    NULL here.

    Signed-off-by: Dan Carpenter
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     
  • I chased down a fail on ppc64 on 2.6.34-rc2 where an application that
    uses shared memory was getting a SEGV.

    Commit baed7fc9b580bd3fb8252ff1d9b36eaf1f86b670 ("Add generic sys_ipc
    wrapper") changed the second argument from an unsigned long to an int.
    When we call shmget the system call wrappers for sys_ipc will sign
    extend second (ie the size) which truncates it. It took a while to
    track down because the call succeeds and strace shows the untruncated
    size :)

    The patch below changes second from an int to an unsigned long which
    fixes shmget on ppc64 (and I assume s390, sparc64 and mips64).

    Signed-off-by: Anton Blanchard
    --

    I assume the function prototypes for the other IPC methods would cause us
    to sign or zero extend second where appropriate (avoiding any security
    issues). Come to think of it, the syscall wrappers for each method should do
    that for us as well.
    Signed-off-by: Linus Torvalds

    Anton Blanchard
     
  • Commit 3f6da3905398826d85731247e7fbcf53400c18bd
    (perf: Rework and fix the arch CPU-hotplug hooks) broke suspend to
    RAM on my HP nx6325 (and most likely on other AMD-based boxes too)
    by allowing amd_pmu_cpu_offline() to be executed for CPUs that are
    going offline as part of the suspend process. The problem is that
    cpuhw->amd_nb may be NULL already, so the function should make sure
    it's not NULL before accessing the object pointed to by it.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

22 Mar, 2010

8 commits

  • Print the CPU associated with the error only when the field is valid.

    Cc: # .32.x .33.x
    Signed-off-by: Borislav Petkov

    Borislav Petkov
     
  • The console port could have been hot-unplugged. Check if it is valid
    before working on it.

    Signed-off-by: Amit Shah
    Signed-off-by: Michael S. Tsirkin

    Amit Shah
     
  • When the host lets us know what 'name' a port is assigned, we create the
    sysfs 'name' attribute. Generate a 'change' event after this so that
    udev wakes up and acts on the rules for virtio-ports (currently there's
    only one rule that creates a symlink from the 'name' to the actual char
    device).

    Signed-off-by: Amit Shah
    Signed-off-by: Michael S. Tsirkin

    Amit Shah
     
  • Taking route's header_len into account, and updating gre device
    needed_headroom will give better hints on upper bound of required
    headroom. This is useful if the gre traffic is xfrm'ed.

    Signed-off-by: Timo Teras
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Timo Teräs
     
  • When compiling userspace application which includes
    if_tunnel.h and uses GRE_* defines you will get undefined
    reference to __cpu_to_be16.

    Fix this by adding missing #include

    Cc: stable@kernel.org
    Signed-off-by: Paulius Zaleckas
    Signed-off-by: David S. Miller

    Paulius Zaleckas
     
  • TCP sessions over IPv4 can get stuck if routers between endpoints
    do not fragment packets but implement PMTU instead, and we are using
    those routers because of an ICMP redirect.

    Setup is as follows

    MTU1 MTU2 MTU1
    A--------B------C------D

    with MTU1 > MTU2. A and D are endpoints, B and C are routers. B and C
    implement PMTU and drop packets larger than MTU2 (for example because
    DF is set on all packets). TCP sessions are initiated between A and D.
    There is packet loss between A and D, causing frequent TCP
    retransmits.

    After the number of retransmits on a TCP session reaches tcp_retries1,
    tcp calls dst_negative_advice() prior to each retransmit. This results
    in route cache entries for the peer to be deleted in
    ipv4_negative_advice() if the Path MTU is set.

    If the outstanding data on an affected TCP session is larger than
    MTU2, packets sent from the endpoints will be dropped by B or C, and
    ICMP NEEDFRAG will be returned. A and D receive NEEDFRAG messages and
    update PMTU.

    Before the next retransmit, tcp will again call dst_negative_advice(),
    causing the route cache entry (with correct PMTU) to be deleted. The
    retransmitted packet will be larger than MTU2, causing it to be
    dropped again.

    This sequence repeats until the TCP session aborts or is terminated.

    Problem is fixed by removing redirected route cache entries in
    ipv4_negative_advice() only if the PMTU is expired.

    Signed-off-by: Guenter Roeck
    Signed-off-by: David S. Miller

    Guenter Roeck
     
  • David S. Miller
     
  • Allow fib_find_node() to be called either under rcu_read_lock()
    protection or with RTNL held.

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Paul E. McKenney
     

21 Mar, 2010

7 commits

  • Added very simple check that req buffer has enough space to
    fit configuration parameters. Shall be enough to reject packets
    with configuration size more than req buffer.

    Crash trace below

    [ 6069.659393] Unable to handle kernel paging request at virtual address 02000205
    [ 6069.673034] Internal error: Oops: 805 [#1] PREEMPT
    ...
    [ 6069.727172] PC is at l2cap_add_conf_opt+0x70/0xf0 [l2cap]
    [ 6069.732604] LR is at l2cap_recv_frame+0x1350/0x2e78 [l2cap]
    ...
    [ 6070.030303] Backtrace:
    [ 6070.032806] [] (l2cap_add_conf_opt+0x0/0xf0 [l2cap]) from
    [] (l2cap_recv_frame+0x1350/0x2e78 [l2cap])
    [ 6070.043823] r8:dc5d3100 r7:df2a91d6 r6:00000001 r5:df2a8000 r4:00000200
    [ 6070.050659] [] (l2cap_recv_frame+0x0/0x2e78 [l2cap]) from
    [] (l2cap_recv_acldata+0x2bc/0x350 [l2cap])
    [ 6070.061798] [] (l2cap_recv_acldata+0x0/0x350 [l2cap]) from
    [] (hci_rx_task+0x244/0x478 [bluetooth])
    [ 6070.072631] r6:dc647700 r5:00000001 r4:df2ab740
    [ 6070.077362] [] (hci_rx_task+0x0/0x478 [bluetooth]) from
    [] (tasklet_action+0x78/0xd8)
    [ 6070.087005] [] (tasklet_action+0x0/0xd8) from []

    Signed-off-by: Andrei Emeltchenko
    Acked-by: Gustavo F. Padovan
    Signed-off-by: Marcel Holtmann

    Andrei Emeltchenko
     
  • Some of the debug files ended up wrongly in sysfs, because at that point
    of time, debugfs didn't exist. Convert these files to use debugfs and
    also seq_file. This patch converts all of these files at once and then
    removes the exported symbol for the Bluetooth sysfs class.

    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • When creating a high number of Bluetooth sockets (L2CAP, SCO
    and RFCOMM) it is possible to scribble repeatedly on arbitrary
    pages of memory. Ensure that the content of these sysfs files is
    always less than one page. Even if this means truncating. The
    files in question are scheduled to be moved over to debugfs in
    the future anyway.

    Based on initial patches from Neil Brown and Linus Torvalds

    Reported-by: Neil Brown
    Signed-off-by: Marcel Holtmann

    Marcel Holtmann
     
  • David S. Miller
     
  • This patch fixes a bug that allows to lose events when reliable
    event delivery mode is used, ie. if NETLINK_BROADCAST_SEND_ERROR
    and NETLINK_RECV_NO_ENOBUFS socket options are set.

    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: David S. Miller

    Pablo Neira Ayuso
     
  • Currently, ENOBUFS errors are reported to the socket via
    netlink_set_err() even if NETLINK_RECV_NO_ENOBUFS is set. However,
    that should not happen. This fixes this problem and it changes the
    prototype of netlink_set_err() to return the number of sockets that
    have set the NETLINK_RECV_NO_ENOBUFS socket option. This return
    value is used in the next patch in these bugfix series.

    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: David S. Miller

    Pablo Neira Ayuso
     
  • Under NET_DMA, data transfer can grind to a halt when userland issues a
    large read on a socket with a high RCVLOWAT (i.e., 512 KB for both).
    This appears to be because the NET_DMA design queues up lots of memcpy
    operations, but doesn't issue or wait for them (and thus free the
    associated skbs) until it is time for tcp_recvmesg() to return.
    The socket hangs when its TCP window goes to zero before enough data is
    available to satisfy the read.

    Periodically issue asynchronous memcpy operations, and free skbs for ones
    that have completed, to prevent sockets from going into zero-window mode.

    Signed-off-by: Steven J. Magnani
    Signed-off-by: David S. Miller

    Steven J. Magnani
     

20 Mar, 2010

1 commit