12 Jan, 2012

1 commit

  • No need to lock soft irqs under bond_alb_xmit()
    which already has softirq disabled.

    Changes:
    1. add non-bh/bh version to tlb_clear_slave()

    2. represent BH and non BH hash table locks
    _lock_rx_hashtbl_bh/_unlock_rx_hashtbl_bh
    _lock_rx_hashtbl/_unlock_rx_hashtbl
    _lock_tx_hashtbl_bh/_unlock_tx_hashtbl_bh
    _lock_tx_hashtbl/_unlock_tx_hashtbl

    Signed-off-by: Maxim Uvarov
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Maxim Uvarov
     

08 Jan, 2012

1 commit

  • * 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (73 commits)
    arm: fix up some samsung merge sysdev conversion problems
    firmware: Fix an oops on reading fw_priv->fw in sysfs loading file
    Drivers:hv: Fix a bug in vmbus_driver_unregister()
    driver core: remove __must_check from device_create_file
    debugfs: add missing #ifdef HAS_IOMEM
    arm: time.h: remove device.h #include
    driver-core: remove sysdev.h usage.
    clockevents: remove sysdev.h
    arm: convert sysdev_class to a regular subsystem
    arm: leds: convert sysdev_class to a regular subsystem
    kobject: remove kset_find_obj_hinted()
    m86k: gpio - convert sysdev_class to a regular subsystem
    mips: txx9_sram - convert sysdev_class to a regular subsystem
    mips: 7segled - convert sysdev_class to a regular subsystem
    sh: dma - convert sysdev_class to a regular subsystem
    sh: intc - convert sysdev_class to a regular subsystem
    power: suspend - convert sysdev_class to a regular subsystem
    power: qe_ic - convert sysdev_class to a regular subsystem
    power: cmm - convert sysdev_class to a regular subsystem
    s390: time - convert sysdev_class to a regular subsystem
    ...

    Fix up conflicts with 'struct sysdev' removal from various platform
    drivers that got changed:
    - arch/arm/mach-exynos/cpu.c
    - arch/arm/mach-exynos/irq-eint.c
    - arch/arm/mach-s3c64xx/common.c
    - arch/arm/mach-s3c64xx/cpu.c
    - arch/arm/mach-s5p64x0/cpu.c
    - arch/arm/mach-s5pv210/common.c
    - arch/arm/plat-samsung/include/plat/cpu.h
    - arch/powerpc/kernel/sysfs.c
    and fix up cpu_is_hotpluggable() as per Greg in include/linux/cpu.h

    Linus Torvalds
     

07 Jan, 2012

1 commit

  • This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file,
    and it fixes the build error in the arch/x86/kernel/microcode_core.c
    file, that the merge did not catch.

    The microcode_core.c patch was provided by Stephen Rothwell
    who was invaluable in the merge issues involved
    with the large sysdev removal process in the driver-core tree.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

04 Jan, 2012

1 commit

  • If slave device already has a receive handler registered, then the
    error unwind of bonding device enslave function is broken.

    The following will leave a pointer to freed memory in the slave
    device list, causing a later kernel panic.
    # modprobe dummy
    # ip li add dummy0-1 link dummy0 type macvlan
    # modprobe bonding
    # echo +dummy0 >/sys/class/net/bond0/bonding/slaves

    The fix is to detach the slave (which removes it from the list)
    in the unwind path.

    Signed-off-by: Stephen Hemminger
    Reviewed-by: Nicolas de Pesloüan
    Signed-off-by: David S. Miller

    stephen hemminger
     

22 Dec, 2011

1 commit

  • The sysdev.h file should not be needed by any in-kernel code, so remove
    the .h file from these random files that seem to still want to include
    it.

    The sysdev code will be going away soon, so this include needs to be
    removed no matter what.

    Cc: Jiandong Zheng
    Cc: Scott Branden
    Cc: Russell King
    Cc: Kukjin Kim
    Cc: David Brown
    Cc: Daniel Walker
    Cc: Bryan Huntsman
    Cc: Ben Dooks
    Cc: Wan ZongShun
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Guan Xuetao
    Cc: "Venkatesh Pallipadi
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Grant Likely
    Cc: Richard Purdie
    Cc: Matthew Garrett
    Signed-off-by: Kay Sievers

    Kay Sievers
     

09 Dec, 2011

2 commits


03 Dec, 2011

1 commit


01 Dec, 2011

1 commit

  • Only use the primary address of the bond device
    for master_ip. This will prevent changing the ARP source
    address in Active-Backup mode whenever a secondry address
    is added to the bond device.

    Signed-off-by: Henrik Saavedra Persson
    Signed-off-by: Andy Gospodarek
    Signed-off-by: David S. Miller

    Henrik Saavedra Persson
     

27 Nov, 2011

1 commit


23 Nov, 2011

1 commit


22 Nov, 2011

1 commit


18 Nov, 2011

1 commit


17 Nov, 2011

2 commits


08 Nov, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (47 commits)
    forcedeth: fix a few sparse warnings (variable shadowing)
    forcedeth: Improve stats counters
    forcedeth: remove unneeded stats updates
    forcedeth: Acknowledge only interrupts that are being processed
    forcedeth: fix race when unloading module
    MAINTAINERS/rds: update maintainer
    wanrouter: Remove kernel_lock annotations
    usbnet: fix oops in usbnet_start_xmit
    ixgbe: Fix compile for kernel without CONFIG_PCI_IOV defined
    etherh: Add MAINTAINERS entry for etherh
    bonding: comparing a u8 with -1 is always false
    sky2: fix regression on Yukon Optima
    netlink: clarify attribute length check documentation
    netlink: validate NLA_MSECS length
    i825xx:xscale:8390:freescale: Fix Kconfig dependancies
    macvlan: receive multicast with local address
    tg3: Update version to 3.121
    tg3: Eliminate timer race with reset_task
    tg3: Schedule at most one tg3_reset_task run
    tg3: Obtain PCI function number from device
    ...

    Linus Torvalds
     

07 Nov, 2011

1 commit

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     

05 Nov, 2011

1 commit


02 Nov, 2011

1 commit

  • Zheng Liang(lzheng@redhat.com) found a bug that if we config bonding with
    arp monitor, sometimes bonding driver cannot get the speed and duplex from
    its slaves, it will assume them to be 100Mb/sec and Full, please see
    /proc/net/bonding/bond0.
    But there is no such problem when uses miimon.

    (Take igb for example)
    I find that the reason is that after dev_open() in bond_enslave(),
    bond_update_speed_duplex() will call igb_get_settings()
    , but in that function,
    it runs ethtool_cmd_speed_set(ecmd, -1); ecmd->duplex = -1;
    because igb get an error value of status.
    So even dev_open() is called, but the device is not really ready to get its
    settings.

    Maybe it is safe for us to call igb_get_settings() only after
    this message shows up, that is "igb: p4p1 NIC Link is Up 1000 Mbps Full Duplex,
    Flow Control: RX".

    So I prefer to update the speed and duplex for a slave when reseices
    NETDEV_CHANGE/NETDEV_UP event.

    Changelog
    V2:
    1 remove the "fake 100/Full" logic in bond_update_speed_duplex(),
    set speed and duplex to -1 when it gets error value of speed and duplex.
    2 delete the warning in bond_enslave() if bond_update_speed_duplex() returns
    error.
    3 make bond_info_show_slave() handle bad values of speed and duplex.

    Signed-off-by: Weiping Pan
    Signed-off-by: David S. Miller

    Weiping Pan
     

01 Nov, 2011

1 commit

  • These were getting the macros from an implicit module.h
    include via device.h, but we are planning to clean that up.

    Signed-off-by: Paul Gortmaker

    drivers/net: Add export.h to wireless/brcm80211/brcmfmac/bcmsdh.c

    This relatively recently added file uses EXPORT_SYMBOL and hence
    needs export.h included so that it is compatible with the module.h
    split up work.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

30 Oct, 2011

1 commit

  • This patch resolves two sets of race conditions.

    Mitsuo Hayasaka reported the
    first, as follows:

    The bond_close() calls cancel_delayed_work() to cancel delayed works.
    It, however, cannot cancel works that were already queued in workqueue.
    The bond_open() initializes work->data, and proccess_one_work() refers
    get_work_cwq(work)->wq->flags. The get_work_cwq() returns NULL when
    work->data has been initialized. Thus, a panic occurs.

    He included a patch that converted the cancel_delayed_work calls
    in bond_close to flush_delayed_work_sync, which eliminated the above
    problem.

    His patch is incorporated, at least in principle, into this
    patch. In this patch, we use cancel_delayed_work_sync in place of
    flush_delayed_work_sync, and also convert bond_uninit in addition to
    bond_close.

    This conversion to _sync, however, opens new races between
    bond_close and three periodically executing workqueue functions:
    bond_mii_monitor, bond_alb_monitor and bond_activebackup_arp_mon.

    The race occurs because bond_close and bond_uninit are always
    called with RTNL held, and these workqueue functions may acquire RTNL to
    perform failover-related activities. If bond_close or bond_uninit is
    waiting in cancel_delayed_work_sync, deadlock occurs.

    These deadlocks are resolved by having the workqueue functions
    acquire RTNL conditionally. If the rtnl_trylock() fails, the functions
    reschedule and return immediately. For the cases that are attempting to
    perform link failover, a delay of 1 is used; for the other cases, the
    normal interval is used (as those activities are not as time critical).

    Additionally, the bond_mii_monitor function now stores the delay
    in a variable (mimicing the structure of activebackup_arp_mon).

    Lastly, all of the above renders the kill_timers sentinel moot,
    and therefore it has been removed.

    Tested-by: Mitsuo Hayasaka
    Signed-off-by: Jay Vosburgh
    Signed-off-by: David S. Miller

    Jay Vosburgh
     

26 Oct, 2011

1 commit


25 Oct, 2011

1 commit


22 Oct, 2011

1 commit

  • When I made class_attr_bonding_matters per network namespace and dynamically
    allocated I overlooked the need for calling sysfs_attr_init. Oops.

    This fixes the following lockdep splat:

    [ 5.749651] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
    [ 5.749655] bonding: MII link monitoring set to 100 ms
    [ 5.749676] BUG: key f49a831c not in .data!
    [ 5.749677] ------------[ cut here ]------------
    [ 5.749752] WARNING: at kernel/lockdep.c:2897 lockdep_init_map+0x1c3/0x460()
    [ 5.749809] Hardware name: ProLiant BL460c G1
    [ 5.749862] Modules linked in: bonding(+)
    [ 5.749978] Pid: 3177, comm: modprobe Not tainted 3.1.0-rc9-02177-gf2d1a4e-dirty #1157
    [ 5.750066] Call Trace:
    [ 5.750120] [] ? printk+0x18/0x21
    [ 5.750176] [] warn_slowpath_common+0x6d/0xa0
    [ 5.750231] [] ? lockdep_init_map+0x1c3/0x460
    [ 5.750287] [] ? lockdep_init_map+0x1c3/0x460
    [ 5.750342] [] warn_slowpath_null+0x1d/0x20
    [ 5.750398] [] lockdep_init_map+0x1c3/0x460
    [ 5.750453] [] ? _raw_spin_unlock+0x1d/0x20
    [ 5.750510] [] ? sysfs_new_dirent+0x68/0x110
    [ 5.750565] [] sysfs_add_file_mode+0x8b/0xe0
    [ 5.750621] [] sysfs_add_file+0x13/0x20
    [ 5.750675] [] sysfs_create_file+0x1c/0x20
    [ 5.750737] [] class_create_file+0x19/0x20
    [ 5.750794] [] netdev_class_create_file+0xf/0x20
    [ 5.750853] [] bond_create_sysfs+0x44/0x90 [bonding]
    [ 5.750911] [] ? bond_create_proc_dir+0x1e/0x3e [bonding]
    [ 5.750970] [] bond_net_init+0x7e/0x87 [bonding]
    [ 5.751026] [] ? 0xf840ffff
    [ 5.751080] [] ops_init.clone.4+0xba/0x100
    [ 5.751135] [] ? register_pernet_subsys+0x12/0x30
    [ 5.751191] [] register_pernet_operations.clone.3+0x43/0x80
    [ 5.751249] [] register_pernet_subsys+0x19/0x30
    [ 5.751306] [] bonding_init+0x832/0x8a2 [bonding]
    [ 5.751363] [] do_one_initcall+0x30/0x160
    [ 5.751420] [] ? bond_net_init+0x87/0x87 [bonding]
    [ 5.751477] [] sys_init_module+0xef/0x1890
    [ 5.751533] [] sysenter_do_call+0x12/0x36
    [ 5.751588] ---[ end trace 89f492d83a7f5006 ]---

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

    Eric W. Biederman
     

20 Oct, 2011

2 commits

  • This fixes a network namespace misfeature that bonding_masters looked at
    current instead of the remembering the context where in which
    /sys/class/net/bonding_masters was opened in to see which network
    namespace to act upon.

    This removes the need for sysfs to handle tagged directories with
    untagged members allowing for a conceptually simpler sysfs
    implementation.

    Signed-off-by: Eric W. Biederman
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • The port shouldn't be enabled unless its current MUX
    state is DISTRIBUTING which is correctly handled by
    ad_mux_machine(), otherwise the packet sent can be
    lost because the other end may not be ready.

    The issue happens on every port initialization, but
    as the ports are expected to move quickly to DISTRIBUTING,
    it doesn't cause much problem. However, it does cause
    constant packet loss if the other peer has the port
    configured to stay in STANDBY (i.e. SYNC set to OFF).

    Signed-off-by: Flavio Leitner
    Signed-off-by: David S. Miller

    Flavio Leitner
     

19 Oct, 2011

1 commit

  • The bond->recv_probe is called in bond_handle_frame() when
    a packet is received, but bond_close() sets it to NULL. So,
    a panic occurs when both functions work in parallel.

    Why this happen:
    After null pointer check of bond->recv_probe, an sk_buff is
    duplicated and bond->recv_probe is called in bond_handle_frame.
    So, a panic occurs when bond_close() is called between the
    check and call of bond->recv_probe.

    Patch:
    This patch uses a local function pointer of bond->recv_probe
    in bond_handle_frame(). So, it can avoid the null pointer
    dereference.

    Signed-off-by: Mitsuo Hayasaka
    Cc: Jay Vosburgh
    Cc: Andy Gospodarek
    Cc: Eric Dumazet
    Cc: WANG Cong
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Mitsuo Hayasaka
     

08 Oct, 2011

1 commit


04 Oct, 2011

1 commit

  • During a test where a pair of bonding interfaces using ARP monitoring
    were both brought up and torn down (with an rmmod) repeatedly, a panic
    in the timer code was noticed. I tracked this down and determined that
    any of the bonding functions that ran as workqueue handlers and requeued
    more work might not properly exit when the module was removed.

    There was a flag protected by the bond lock called kill_timers that is
    set when the interface goes down or the module is removed, but many of
    the functions that monitor link status now unlock the bond lock to take
    rtnl first. There is a chance that another CPU running the rmmod could
    get the lock and set kill_timers after the first check has passed.

    This patch does not allow any function to queue work that will make
    itself run unless kill_timers is not set. I also noticed while doing
    this work that bond_resend_igmp_join_requests did not have a check for
    kill_timers, so I added the needed call there as well.

    Signed-off-by: Andy Gospodarek
    Reported-by: Liang Zheng
    Signed-off-by: David S. Miller

    Andy Gospodarek
     

16 Sep, 2011

1 commit

  • This patch does several things:
    - introduces __ethtool_get_settings which is called from ethtool code and
    from drivers as well. Put ASSERT_RTNL there.
    - dev_ethtool_get_settings() is replaced by __ethtool_get_settings()
    - changes calling in drivers so rtnl locking is respected. In
    iboe_get_rate was previously ->get_settings() called unlocked. This
    fixes it. Also prb_calc_retire_blk_tmo() in af_packet.c had the same
    problem. Also fixed by calling __dev_get_by_index() instead of
    dev_get_by_index() and holding rtnl_lock for both calls.
    - introduces rtnl_lock in bnx2fc_vport_create() and fcoe_vport_create()
    so bnx2fc_if_create() and fcoe_if_create() are called locked as they
    are from other places.
    - use __ethtool_get_settings() in bonding code

    Signed-off-by: Jiri Pirko

    v2->v3:
    -removed dev_ethtool_get_settings()
    -added ASSERT_RTNL into __ethtool_get_settings()
    -prb_calc_retire_blk_tmo - use __dev_get_by_index() and lock
    around it and __ethtool_get_settings() call
    v1->v2:
    add missing export_symbol
    Reviewed-by: Ben Hutchings [except FCoE bits]
    Acked-by: Ralf Baechle
    Signed-off-by: David S. Miller

    Jiri Pirko
     

21 Aug, 2011

1 commit


18 Aug, 2011

3 commits

  • replace it by ndo_set_rx_mode

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Benefit from use of ndo_change_rx_flags in handling change of promisc
    and allmulti. No need to store previous state locally.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • Eduard Sinelnikov (eduard.sinelnikov@gmail.com) found that if we change
    bonding mode from active backup to round robin, some slaves are still keeping
    "backup", and won't transmit packets.

    As Jay Vosburgh(fubar@us.ibm.com) pointed out that we can work around that by
    removing the bond_is_active_slave() check, because the "backup" flag is only
    meaningful for active backup mode.

    But if we just simply ignore the bond_is_active_slave() check,
    the transmission will work fine, but we can't maintain the correct value of
    "backup" flag for each slaves, though it is meaningless for other mode than
    active backup.

    I'd like to reset "backup" and "inactive" flag in bond_open,
    thus we can keep the correct value of them.

    As for bond_is_active_slave(), I'd like to prepare another patch to handle it.

    V2:
    Use C style comment.
    Move read_lock(&bond->curr_slave_lock).
    Replace restore with reset, for active backup mode, it means "restore",
    but for other modes, it means "reset".

    Signed-off-by: Weiping Pan
    Reviewed-by: WANG Cong
    Signed-off-by: David S. Miller

    Peter Pan(潘卫平)
     

11 Aug, 2011

1 commit

  • If bonding device is created via rtnl, it is created with default number
    of rx/tx queues. This patch implements callback in bonding so the
    correct value (previously specified by bonding module param) is used.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

28 Jul, 2011

3 commits

  • On Tue, Jul 26, 2011 at 05:40:27PM -0700, Joe Perches wrote:
    > On Tue, 2011-07-26 at 17:37 -0700, Jay Vosburgh wrote:
    > > Joe Perches wrote:
    > > >I'd prefer you don't separate the format string
    > > >into multiple pieces.
    > > Why not? To me, it looks easier to read split into sections
    > > that don't wrap lines.
    >
    > Harder to grep for a dmesg and the
    > defect rate of these split formats is
    > typically higher than single strings
    > because of bad spacing between string
    > segments.
    >

    I noticed that you took some time back in late 2009 to 'consolidate' the
    split format-strings present in the bonding driver at the time and I've
    decided I'm fine to leave them the way they are. The main point of my
    patch was to change the output and I would like to get that included.
    Here is my updated patch...

    Subject: [PATCH net-next-2.6 v2] bonding: reduce noise during init

    Many are using sysfs to configure bonding rather than module options, so
    there is no need for bonding to throw this warning in normal cases.

    Keep the message around when debugging is enabled as it might be useful
    for someone desperate enough to enable debugging, but eliminate it
    otherwise.

    Signed-off-by: Andy Gospodarek
    Signed-off-by: David S. Miller

    Andy Gospodarek
     
  • When a bond contains a device where one name is the subset of another
    (eth1 and eth10, for example), one cannot properly set the primary
    device or the currently active device.

    This was reported and based on work by Takuma Umeya. I also verified
    the problem and tested that this fix resolves it.

    V2: A few did not like the the current code or my changes, so I
    refactored bonding_store_primary and bonding_store_active_slave to be a
    bit cleaner, dropped the use of strnicmp since we did not really need
    the comparison to be case insensitive, and formatted the input string
    from sysfs so a comparison to IFNAMSIZ could be used.

    I also discovered an error in bonding_store_active_slave that would
    modify bond->primary_slave rather than bond->curr_active_slave before
    forcing the bonding driver to choose a new active slave.

    V3: Actually sending the proper patch....

    Signed-off-by: Andy Gospodarek
    Reported-by: Takuma Umeya
    Signed-off-by: David S. Miller

    Andy Gospodarek
     
  • After the last patch, We are left in a state in which only drivers calling
    ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
    hardware call ether_setup for their net_devices and don't hold any state in
    their skbs. There are a handful of drivers that violate this assumption of
    course, and need to be fixed up. This patch identifies those drivers, and marks
    them as not being able to support the safe transmission of skbs by clearning the
    IFF_TX_SKB_SHARING flag in priv_flags

    Signed-off-by: Neil Horman
    CC: Karsten Keil
    CC: "David S. Miller"
    CC: Jay Vosburgh
    CC: Andy Gospodarek
    CC: Patrick McHardy
    CC: Krzysztof Halasa
    CC: "John W. Linville"
    CC: Greg Kroah-Hartman
    CC: Marcel Holtmann
    CC: Johannes Berg
    Signed-off-by: David S. Miller

    Neil Horman
     

22 Jul, 2011

2 commits