12 Dec, 2013

1 commit

  • In vxlan_open, vxlan_group_used always returns true,
    because the state of the vxlan deivces which we want
    to open has alreay been running. and it has already
    in vxlan_list.

    Since ip_mc_join_group takes care of the reference
    of struct ip_mc_list. removing vxlan_group_used here
    is safe.

    Signed-off-by: Gao feng
    Signed-off-by: David S. Miller

    Gao feng
     

14 Nov, 2013

1 commit

  • Pull core locking changes from Ingo Molnar:
    "The biggest changes:

    - add lockdep support for seqcount/seqlocks structures, this
    unearthed both bugs and required extra annotation.

    - move the various kernel locking primitives to the new
    kernel/locking/ directory"

    * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
    block: Use u64_stats_init() to initialize seqcounts
    locking/lockdep: Mark __lockdep_count_forward_deps() as static
    lockdep/proc: Fix lock-time avg computation
    locking/doc: Update references to kernel/mutex.c
    ipv6: Fix possible ipv6 seqlock deadlock
    cpuset: Fix potential deadlock w/ set_mems_allowed
    seqcount: Add lockdep functionality to seqcount/seqlock structures
    net: Explicitly initialize u64_stats_sync structures for lockdep
    locking: Move the percpu-rwsem code to kernel/locking/
    locking: Move the lglocks code to kernel/locking/
    locking: Move the rwsem code to kernel/locking/
    locking: Move the rtmutex code to kernel/locking/
    locking: Move the semaphore core to kernel/locking/
    locking: Move the spinlock code to kernel/locking/
    locking: Move the lockdep code to kernel/locking/
    locking: Move the mutex code to kernel/locking/
    hung_task debugging: Add tracepoint to report the hang
    x86/locking/kconfig: Update paravirt spinlock Kconfig description
    lockstat: Report avg wait and hold times
    lockdep, x86/alternatives: Drop ancient lockdep fixup message
    ...

    Linus Torvalds
     

06 Nov, 2013

1 commit

  • In order to enable lockdep on seqcount/seqlock structures, we
    must explicitly initialize any locks.

    The u64_stats_sync structure, uses a seqcount, and thus we need
    to introduce a u64_stats_init() function and use it to initialize
    the structure.

    This unfortunately adds a lot of fairly trivial initialization code
    to a number of drivers. But the benefit of ensuring correctness makes
    this worth while.

    Because these changes are required for lockdep to be enabled, and the
    changes are quite trivial, I've not yet split this patch out into 30-some
    separate patches, as I figured it would be better to get the various
    maintainers thoughts on how to best merge this change along with
    the seqcount lockdep enablement.

    Feedback would be appreciated!

    Signed-off-by: John Stultz
    Acked-by: Julian Anastasov
    Signed-off-by: Peter Zijlstra
    Cc: Alexey Kuznetsov
    Cc: "David S. Miller"
    Cc: Eric Dumazet
    Cc: Hideaki YOSHIFUJI
    Cc: James Morris
    Cc: Jesse Gross
    Cc: Mathieu Desnoyers
    Cc: "Michael S. Tsirkin"
    Cc: Mirko Lindner
    Cc: Patrick McHardy
    Cc: Roger Luethi
    Cc: Rusty Russell
    Cc: Simon Horman
    Cc: Stephen Hemminger
    Cc: Steven Rostedt
    Cc: Thomas Petazzoni
    Cc: Wensong Zhang
    Cc: netdev@vger.kernel.org
    Link: http://lkml.kernel.org/r/1381186321-4906-2-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    John Stultz
     

05 Nov, 2013

1 commit


29 Oct, 2013

2 commits

  • This patch removes the burden from the NIC drivers to check if the
    vxlan driver is enabled in the kernel and also makes available
    the vxlan headrooms to them.

    Signed-off-by: Joseph Gasparakis
    Tested-by: Kavindya Deegala
    Signed-off-by: Jeff Kirsher

    Joseph Gasparakis
     
  • drivers/net/vxlan.c: In function ‘vxlan_sock_add’:
    drivers/net/vxlan.c:2298:11: warning: ‘sock’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    drivers/net/vxlan.c:2275:17: note: ‘sock’ was declared here
    LD drivers/net/built-in.o

    Signed-off-by: Zhi Yong Wu
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Zhi Yong Wu
     

02 Oct, 2013

1 commit

  • Conflicts:
    drivers/net/ethernet/emulex/benet/be.h
    drivers/net/usb/qmi_wwan.c
    drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
    include/net/netfilter/nf_conntrack_synproxy.h
    include/net/secure_seq.h

    The conflicts are of two varieties:

    1) Conflicts with Joe Perches's 'extern' removal from header file
    function declarations. Usually it's an argument signature change
    or a function being added/removed. The resolutions are trivial.

    2) Some overlapping changes in qmi_wwan.c and be.h, one commit adds
    a new value, another changes an existing value. That sort of
    thing.

    Signed-off-by: David S. Miller

    David S. Miller
     

01 Oct, 2013

2 commits

  • - Move sysctl_local_ports from a global variable into struct netns_ipv4.
    - Modify inet_get_local_port_range to take a struct net, and update all
    of the callers.
    - Move the initialization of sysctl_local_ports into
    sysctl_net_ipv4.c:ipv4_sysctl_init_net from inet_connection_sock.c

    v2:
    - Ensure indentation used tabs
    - Fixed ip.h so it applies cleanly to todays net-next

    v3:
    - Compile fixes of strange callers of inet_get_local_port_range.
    This patch now successfully passes an allmodconfig build.
    Removed manual inlining of inet_get_local_port_range in ipv4_local_port_range

    Originally-by: Samya
    Acked-by: Nicolas Dichtel
    Signed-off-by: "Eric W. Biederman"
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • Use of RCU api makes vxlan code easier to understand. It also
    fixes bug due to missing ACCESS_ONCE() on sk_user_data dereference.
    In rare case without ACCESS_ONCE() compiler might omit vs on
    sk_user_data dereference.
    Compiler can use vs as alias for sk->sk_user_data, resulting in
    multiple sk_user_data dereference in rcu read context which
    could change.

    CC: Jesse Gross
    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar
     

18 Sep, 2013

1 commit

  • Commit afbd8bae9c798c5cdbe4439d3a50536b5438247c
    vxlan: add implicit fdb entry for default destination
    creates an implicit fdb entry for default destination. This results
    in an invalid fdb entry if default destination is not specified.
    For ex:
    ip link add vxlan1 type vxlan id 100
    creates the following fdb entry
    00:00:00:00:00:00 dev vxlan1 dst 0.0.0.0 self permanent

    This patch fixes this issue by creating an fdb entry only if a
    valid default destination is specified.

    Signed-off-by: Sridhar Samudrala
    Signed-off-by: David S. Miller

    Sridhar Samudrala
     

16 Sep, 2013

1 commit

  • This patch fixes sparse warnings when incorrectly handling the port number
    and using int instead of unsigned int iterating through &vn->sock_list[].
    Keeping the port as __be16 also makes things clearer wrt endianess.
    Also, it was pointed out that vxlan_get_rx_port() had unnecessary checks
    which got removed.

    Signed-off-by: Joseph Gasparakis
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Joseph Gasparakis
     

06 Sep, 2013

1 commit

  • This patch adds two more ndo ops: ndo_add_rx_vxlan_port() and
    ndo_del_rx_vxlan_port().

    Drivers can get notifications through the above functions about changes
    of the UDP listening port of VXLAN. Also, when physical ports come up,
    now they can call vxlan_get_rx_port() in order to obtain the port number(s)
    of the existing VXLAN interface in case they already up before them.

    This information about the listening UDP port would be used for VXLAN
    related offloads.

    A big thank you to John Fastabend (john.r.fastabend@intel.com) for his
    input and his suggestions on this patch set.

    CC: John Fastabend
    CC: Stephen Hemminger
    Signed-off-by: Joseph Gasparakis
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Joseph Gasparakis
     

05 Sep, 2013

1 commit

  • vxlan-udp-recv function lookup vxlan_sock struct on every packet
    recv by using udp-port number. we can use sk->sk_user_data to
    store vxlan_sock and avoid lookup.
    I have open coded rcu-api to store and read vxlan_sock from
    sk_user_data to avoid sparse warning as sk_user_data is not
    __rcu pointer.

    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar
     

04 Sep, 2013

4 commits

  • The goal of this patch is to harmonize cleanup done on a skbuff on xmit path.
    Before this patch, behaviors were different depending of the tunnel type.

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • This argument is not used, let's remove it.

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • This argument is not used, let's remove it.

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • Use the new bool function ether_addr_equal to add
    some clarity and reduce the likelihood for misuse
    of compare_ether_addr for sorting.

    Done via cocci script: (and a little typing)

    $ cat compare_ether_addr.cocci
    @@
    expression a,b;
    @@
    - !compare_ether_addr(a, b)
    + ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - compare_ether_addr(a, b)
    + !ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - !ether_addr_equal(a, b) == 0
    + ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - !ether_addr_equal(a, b) != 0
    + !ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - ether_addr_equal(a, b) == 0
    + !ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - ether_addr_equal(a, b) != 0
    + ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - !!ether_addr_equal(a, b)
    + ether_addr_equal(a, b)

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

03 Sep, 2013

2 commits


01 Sep, 2013

3 commits

  • This patch adds the IPv6 version of "arp_reduce", ndisc_send_na()
    will be needed.

    Cc: David S. Miller
    Cc: David Stevens
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     
  • route short circuit only has IPv4 part, this patch adds
    the IPv6 part. nd_tbl will be needed.

    Cc: David S. Miller
    Cc: David Stevens
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     
  • This patch adds IPv6 support to vxlan device, as the new version
    RFC already mentions it:

    http://tools.ietf.org/html/draft-mahalingam-dutt-dcops-vxlan-03

    Cc: David Stevens
    Cc: Stephen Hemminger
    Cc: David S. Miller
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

21 Aug, 2013

1 commit


20 Aug, 2013

7 commits


17 Aug, 2013

1 commit


10 Aug, 2013

2 commits

  • This is a regression introduced by:

    commit fe5c3561e6f0ac7c9546209f01351113c1b77ec8
    Author: stephen hemminger
    Date: Sat Jul 13 10:18:18 2013 -0700

    vxlan: add necessary locking on device removal

    The problem is that vxlan_dellink(), which is called with RTNL lock
    held, tries to flush the workqueue synchronously, but apparently
    igmp_join and igmp_leave work need to hold RTNL lock too, therefore we
    have a soft lockup!

    As suggested by Stephen, probably the flush_workqueue can just be
    removed and let the normal refcounting work. The workqueue has a
    reference to device and socket, therefore the cleanups should work
    correctly.

    Suggested-by: Stephen Hemminger
    Cc: Stephen Hemminger
    Cc: David S. Miller
    Tested-by: Cong Wang
    Signed-off-by: Cong Wang
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Cong Wang
     
  • This is a regression introduced by:

    commit 3fc2de2faba387218bdf9dbc6b13f513ac3b060a
    Author: stephen hemminger
    Date: Thu Jul 18 08:40:15 2013 -0700

    vxlan: fix igmp races

    Before this commit, the old code was:

    if (vxlan_group_used(vn, vxlan->default_dst.remote_ip))
    ip_mc_join_group(sk, &mreq);
    else
    ip_mc_leave_group(sk, &mreq);

    therefore we shoud check vxlan_group_used(), not its opposite,
    for igmp_join.

    Cc: Stephen Hemminger
    Cc: David S. Miller
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

05 Aug, 2013

1 commit


04 Aug, 2013

1 commit


24 Jul, 2013

1 commit

  • Add support to replace an existing entry found in the
    vxlan fdb database. The entry in question is identified
    by its unicast mac address and the destination information
    is changed. If the entry is not found, it is added in the
    forwarding database. This is similar to changing an entry
    in the neighbour table.

    Multicast mac addresses can not be changed with the replace
    option.

    This is useful for virtual machine migration when the
    destination of a target virtual machine changes. The replace
    feature can be used instead of delete followed by add.

    Resubmitted because net-next was closed last week.

    Signed-off-by: Thomas Richter
    Signed-off-by: David S. Miller

    Thomas Richter
     

20 Jul, 2013

2 commits

  • There are two race conditions in existing code for doing IGMP
    management in workqueue in vxlan. First, the vxlan_group_used
    function checks the list of vxlan's without any protection, and
    it is possible for open followed by close to occur before the
    igmp work queue runs.

    To solve these move the check into vxlan_open/stop so it is
    protected by RTNL. And split into two work structures so that
    there is no racy reference to underlying device state.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • Fix memory leaks and other badness from VXLAN network namespace
    teardown. When network namespace is removed, all the vxlan devices should
    be unregistered (not closed).

    Signed-off-by: Stephen Hemminger
    Reviewed-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    stephen hemminger
     

18 Jul, 2013

1 commit

  • The socket management is now done in workqueue (outside of RTNL)
    and protected by vn->sock_lock. There were two possible bugs, first
    the vxlan device was removed from the VNI hash table per socket without
    holding lock. And there was a race when device is created and the workqueue
    could run after deletion.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

12 Jul, 2013

1 commit

  • vxlan exit module unregisters vxlan net and then it unregisters
    rtnl ops which triggers vxlan_dellink() from __rtnl_kill_links().
    vxlan_dellink() deletes vxlan-dev from vxlan_list which has
    list-head in vxlan-net-struct but that is already gone due to
    net-unregister. That is how we are getting following crash.

    Following commit fixes the crash by fixing module exit path.

    BUG: unable to handle kernel paging request at ffff8804102c8000
    IP: [] __list_del_entry+0x29/0xd0
    PGD 2972067 PUD 83e019067 PMD 83df97067 PTE 80000004102c8060
    Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
    Modules linked in: ---
    CPU: 19 PID: 6712 Comm: rmmod Tainted: GF 3.10.0+ #95
    Hardware name: Dell Inc. PowerEdge R620/0KCKR5, BIOS 1.4.8 10/25/2012
    task: ffff88080c47c580 ti: ffff88080ac50000 task.ti: ffff88080ac50000
    RIP: 0010:[] []
    __list_del_entry+0x29/0xd0
    RSP: 0018:ffff88080ac51e08 EFLAGS: 00010206
    RAX: ffff8804102c8000 RBX: ffff88040f0d4b10 RCX: dead000000200200
    RDX: ffff8804102c8000 RSI: ffff88080ac51e58 RDI: ffff88040f0d4b10
    RBP: ffff88080ac51e08 R08: 0000000000000001 R09: 2222222222222222
    R10: 2222222222222222 R11: 2222222222222222 R12: ffff88080ac51e58
    R13: ffffffffa07b8840 R14: ffffffff81ae48c0 R15: ffff88080ac51e58
    FS: 00007f9ef105c700(0000) GS:ffff88082a800000(0000)
    knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: ffff8804102c8000 CR3: 00000008227e5000 CR4: 00000000000407e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Stack:
    ffff88080ac51e28 ffffffff812cc6a1 2222222222222222 ffff88040f0d4000
    ffff88080ac51e48 ffffffffa07b3311 ffff88040f0d4000 ffffffff81ae49c8
    ffff88080ac51e98 ffffffff81492fc2 ffff88080ac51e58 ffff88080ac51e58
    Call Trace:
    [] list_del+0x11/0x40
    [] vxlan_dellink+0x51/0x70 [vxlan]
    [] __rtnl_link_unregister+0xa2/0xb0
    [] rtnl_link_unregister+0x1e/0x30
    [] vxlan_cleanup_module+0x1c/0x2f [vxlan]
    [] SyS_delete_module+0x1d1/0x2c0
    [] ? trace_hardirqs_on_thunk+0x3a/0x3f
    [] system_call_fastpath+0x16/0x1b
    Code: eb 9f 55 48 8b 17 48 b9 00 01 10 00 00 00 ad de 48 8b 47 08 48 89
    e5 48 39 ca 74 29 48 b9 00 02 20 00 00 00 ad de 48 39 c8 74 7a 8b
    00 4c 39 c7 75 53 4c 8b 42 08 4c 39 c7 75 2b 48 89 42 08
    RIP [] __list_del_entry+0x29/0xd0
    RSP
    CR2: ffff8804102c8000

    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar