20 Oct, 2014

1 commit

  • Pull networking fixes from David Miller:
    "A quick batch of bug fixes:

    1) Fix build with IPV6 disabled, from Eric Dumazet.

    2) Several more cases of caching SKB data pointers across calls to
    pskb_may_pull(), thus referencing potentially free'd memory. From
    Li RongQing.

    3) DSA phy code tests operation presence improperly, instead of going:

    if (x->ops->foo)
    r = x->ops->foo(args);

    it was going:

    if (x->ops->foo(args))
    r = x->ops->foo(args);

    Fix from Andew Lunn"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
    Net: DSA: Fix checking for get_phy_flags function
    ipv6: fix a potential use after free in sit.c
    ipv6: fix a potential use after free in ip6_offload.c
    ipv4: fix a potential use after free in gre_offload.c
    tcp: fix build error if IPv6 is not enabled

    Linus Torvalds
     

19 Oct, 2014

2 commits

  • pskb_may_pull() may change skb->data and make greh pointer oboslete;
    so need to reassign greh;
    but since first calling pskb_may_pull already ensured that skb->data
    has enough space for greh, so move the reference of greh before second
    calling pskb_may_pull(), to avoid reassign greh.

    Fixes: 7a7ffbabf9("ipv4: fix tunneled VM traffic over hw VXLAN/GRE GSO NIC")
    Cc: Wei-Chun Chao
    Signed-off-by: Li RongQing
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Li RongQing
     
  • Pull networking fixes from David Miller:

    1) Include fixes for netrom and dsa (Fabian Frederick and Florian
    Fainelli)

    2) Fix FIXED_PHY support in stmmac, from Giuseppe CAVALLARO.

    3) Several SKB use after free fixes (vxlan, openvswitch, vxlan,
    ip_tunnel, fou), from Li ROngQing.

    4) fec driver PTP support fixes from Luwei Zhou and Nimrod Andy.

    5) Use after free in virtio_net, from Michael S Tsirkin.

    6) Fix flow mask handling for megaflows in openvswitch, from Pravin B
    Shelar.

    7) ISDN gigaset and capi bug fixes from Tilman Schmidt.

    8) Fix route leak in ip_send_unicast_reply(), from Vasily Averin.

    9) Fix two eBPF JIT bugs on x86, from Alexei Starovoitov.

    10) TCP_SKB_CB() reorganization caused a few regressions, fixed by Cong
    Wang and Eric Dumazet.

    11) Don't overwrite end of SKB when parsing malformed sctp ASCONF
    chunks, from Daniel Borkmann.

    12) Don't call sock_kfree_s() with NULL pointers, this function also has
    the side effect of adjusting the socket memory usage. From Cong Wang.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (90 commits)
    bna: fix skb->truesize underestimation
    net: dsa: add includes for ethtool and phy_fixed definitions
    openvswitch: Set flow-key members.
    netrom: use linux/uaccess.h
    dsa: Fix conversion from host device to mii bus
    tipc: fix bug in bundled buffer reception
    ipv6: introduce tcp_v6_iif()
    sfc: add support for skb->xmit_more
    r8152: return -EBUSY for runtime suspend
    ipv4: fix a potential use after free in fou.c
    ipv4: fix a potential use after free in ip_tunnel_core.c
    hyperv: Add handling of IP header with option field in netvsc_set_hash()
    openvswitch: Create right mask with disabled megaflows
    vxlan: fix a free after use
    openvswitch: fix a use after free
    ipv4: dst_entry leak in ip_send_unicast_reply()
    ipv4: clean up cookie_v4_check()
    ipv4: share tcp_v4_save_options() with cookie_v4_check()
    ipv4: call __ip_options_echo() in cookie_v4_check()
    atm: simplify lanai.c by using module_pci_driver
    ...

    Linus Torvalds
     

18 Oct, 2014

6 commits

  • pskb_may_pull() maybe change skb->data and make uh pointer oboslete,
    so reload uh and guehdr

    Fixes: 37dd0247 ("gue: Receive side for Generic UDP Encapsulation")
    Cc: Tom Herbert
    Signed-off-by: Li RongQing
    Signed-off-by: David S. Miller

    Li RongQing
     
  • pskb_may_pull() maybe change skb->data and make eth pointer oboslete,
    so set eth after pskb_may_pull()

    Fixes:3d7b46cd("ip_tunnel: push generic protocol handling to ip_tunnel module")
    Cc: Pravin B Shelar
    Signed-off-by: Li RongQing
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Li RongQing
     
  • ip_setup_cork() called inside ip_append_data() steals dst entry from rt to cork
    and in case errors in __ip_append_data() nobody frees stolen dst entry

    Fixes: 2e77d89b2fa8 ("net: avoid a pair of dst_hold()/dst_release() in ip_append_data()")
    Signed-off-by: Vasily Averin
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Vasily Averin
     
  • We can retrieve opt from skb, no need to pass it as a parameter.
    And opt should always be non-NULL, no need to check.

    Cc: Krzysztof Kolasa
    Cc: Eric Dumazet
    Tested-by: Krzysztof Kolasa
    Signed-off-by: Cong Wang
    Signed-off-by: Cong Wang
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Cong Wang
     
  • cookie_v4_check() allocates ip_options_rcu in the same way
    with tcp_v4_save_options(), we can just make it a helper function.

    Cc: Krzysztof Kolasa
    Cc: Eric Dumazet
    Signed-off-by: Cong Wang
    Signed-off-by: Cong Wang
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Cong Wang
     
  • commit 971f10eca186cab238c49da ("tcp: better TCP_SKB_CB layout to reduce cache line misses")
    missed that cookie_v4_check() still calls ip_options_echo() which uses
    IPCB(). It should use TCPCB() at TCP layer, so call __ip_options_echo()
    instead.

    Fixes: commit 971f10eca186cab238c49da ("tcp: better TCP_SKB_CB layout to reduce cache line misses")
    Cc: Krzysztof Kolasa
    Cc: Eric Dumazet
    Reported-by: Krzysztof Kolasa
    Tested-by: Krzysztof Kolasa
    Signed-off-by: Cong Wang
    Signed-off-by: Cong Wang
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Cong Wang
     

15 Oct, 2014

5 commits

  • Pull percpu consistent-ops changes from Tejun Heo:
    "Way back, before the current percpu allocator was implemented, static
    and dynamic percpu memory areas were allocated and handled separately
    and had their own accessors. The distinction has been gone for many
    years now; however, the now duplicate two sets of accessors remained
    with the pointer based ones - this_cpu_*() - evolving various other
    operations over time. During the process, we also accumulated other
    inconsistent operations.

    This pull request contains Christoph's patches to clean up the
    duplicate accessor situation. __get_cpu_var() uses are replaced with
    with this_cpu_ptr() and __this_cpu_ptr() with raw_cpu_ptr().

    Unfortunately, the former sometimes is tricky thanks to C being a bit
    messy with the distinction between lvalues and pointers, which led to
    a rather ugly solution for cpumask_var_t involving the introduction of
    this_cpu_cpumask_var_ptr().

    This converts most of the uses but not all. Christoph will follow up
    with the remaining conversions in this merge window and hopefully
    remove the obsolete accessors"

    * 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (38 commits)
    irqchip: Properly fetch the per cpu offset
    percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t -fix
    ia64: sn_nodepda cannot be assigned to after this_cpu conversion. Use __this_cpu_write.
    percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t
    Revert "powerpc: Replace __get_cpu_var uses"
    percpu: Remove __this_cpu_ptr
    clocksource: Replace __this_cpu_ptr with raw_cpu_ptr
    sparc: Replace __get_cpu_var uses
    avr32: Replace __get_cpu_var with __this_cpu_write
    blackfin: Replace __get_cpu_var uses
    tile: Use this_cpu_ptr() for hardware counters
    tile: Replace __get_cpu_var uses
    powerpc: Replace __get_cpu_var uses
    alpha: Replace __get_cpu_var
    ia64: Replace __get_cpu_var uses
    s390: cio driver &__get_cpu_var replacements
    s390: Replace __get_cpu_var uses
    mips: Replace __get_cpu_var uses
    MIPS: Replace __get_cpu_var uses in FPU emulator.
    arm: Replace __this_cpu_ptr with raw_cpu_ptr
    ...

    Linus Torvalds
     
  • TCP Small queues tries to keep number of packets in qdisc
    as small as possible, and depends on a tasklet to feed following
    packets at TX completion time.
    Choice of tasklet was driven by latencies requirements.

    Then, TCP stack tries to avoid reorders, by locking flows with
    outstanding packets in qdisc in a given TX queue.

    What can happen is that many flows get attracted by a low performing
    TX queue, and cpu servicing TX completion has to feed packets for all of
    them, making this cpu 100% busy in softirq mode.

    This became particularly visible with latest skb->xmit_more support

    Strategy adopted in this patch is to detect when tcp_wfree() is called
    from ksoftirqd and let the outstanding queue for this flow being drained
    before feeding additional packets, so that skb->ooo_okay can be set
    to allow select_queue() to select the optimal queue :

    Incoming ACKS are normally handled by different cpus, so this patch
    gives more chance for these cpus to take over the burden of feeding
    qdisc with future packets.

    Tested:

    lpaa23:~# ./super_netperf 1400 --google-pacing-rate 3028000 -H lpaa24 -l 3600 &

    lpaa23:~# sar -n DEV 1 10 | grep eth1
    06:16:18 AM eth1 595448.00 1190564.00 38381.09 1760253.12 0.00 0.00 1.00
    06:16:19 AM eth1 594858.00 1189686.00 38340.76 1758952.72 0.00 0.00 0.00
    06:16:20 AM eth1 597017.00 1194019.00 38480.79 1765370.29 0.00 0.00 1.00
    06:16:21 AM eth1 595450.00 1190936.00 38380.19 1760805.05 0.00 0.00 0.00
    06:16:22 AM eth1 596385.00 1193096.00 38442.56 1763976.29 0.00 0.00 1.00
    06:16:23 AM eth1 598155.00 1195978.00 38552.97 1768264.60 0.00 0.00 0.00
    06:16:24 AM eth1 594405.00 1188643.00 38312.57 1757414.89 0.00 0.00 1.00
    06:16:25 AM eth1 593366.00 1187154.00 38252.16 1755195.83 0.00 0.00 0.00
    06:16:26 AM eth1 593188.00 1186118.00 38232.88 1753682.57 0.00 0.00 1.00
    06:16:27 AM eth1 596301.00 1192241.00 38440.94 1762733.09 0.00 0.00 0.00
    Average: eth1 595457.30 1190843.50 38381.69 1760664.84 0.00 0.00 0.50
    lpaa23:~# ./tc -s -d qd sh dev eth1 | grep backlog
    backlog 7606336b 2513p requeues 167982
    backlog 224072b 74p requeues 566
    backlog 581376b 192p requeues 5598
    backlog 181680b 60p requeues 1070
    backlog 5305056b 1753p requeues 110166 // Here, this TX queue is attracting flows
    backlog 157456b 52p requeues 1758
    backlog 672216b 222p requeues 3025
    backlog 60560b 20p requeues 24541
    backlog 448144b 148p requeues 21258

    lpaa23:~# echo 1 >/proc/sys/net/ipv4/tcp_tsq_enable_tcp_wfree_ksoftirqd_detect

    Immediate jump to full bandwidth, and traffic is properly
    shard on all tx queues.

    lpaa23:~# sar -n DEV 1 10 | grep eth1
    06:16:46 AM eth1 1397632.00 2795397.00 90081.87 4133031.26 0.00 0.00 1.00
    06:16:47 AM eth1 1396874.00 2793614.00 90032.99 4130385.46 0.00 0.00 0.00
    06:16:48 AM eth1 1395842.00 2791600.00 89966.46 4127409.67 0.00 0.00 1.00
    06:16:49 AM eth1 1395528.00 2791017.00 89946.17 4126551.24 0.00 0.00 0.00
    06:16:50 AM eth1 1397891.00 2795716.00 90098.74 4133497.39 0.00 0.00 1.00
    06:16:51 AM eth1 1394951.00 2789984.00 89908.96 4125022.51 0.00 0.00 0.00
    06:16:52 AM eth1 1394608.00 2789190.00 89886.90 4123851.36 0.00 0.00 1.00
    06:16:53 AM eth1 1395314.00 2790653.00 89934.33 4125983.09 0.00 0.00 0.00
    06:16:54 AM eth1 1396115.00 2792276.00 89984.25 4128411.21 0.00 0.00 1.00
    06:16:55 AM eth1 1396829.00 2793523.00 90030.19 4130250.28 0.00 0.00 0.00
    Average: eth1 1396158.40 2792297.00 89987.09 4128439.35 0.00 0.00 0.50

    lpaa23:~# tc -s -d qd sh dev eth1 | grep backlog
    backlog 7900052b 2609p requeues 173287
    backlog 878120b 290p requeues 589
    backlog 1068884b 354p requeues 5621
    backlog 996212b 329p requeues 1088
    backlog 984100b 325p requeues 115316
    backlog 956848b 316p requeues 1781
    backlog 1080996b 357p requeues 3047
    backlog 975016b 322p requeues 24571
    backlog 990156b 327p requeues 21274

    (All 8 TX queues get a fair share of the traffic)

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • fib_nh_match does not match nexthops correctly. Example:

    ip route add 172.16.10/24 nexthop via 192.168.122.12 dev eth0 \
    nexthop via 192.168.122.13 dev eth0
    ip route del 172.16.10/24 nexthop via 192.168.122.14 dev eth0 \
    nexthop via 192.168.122.15 dev eth0

    Del command is successful and route is removed. After this patch
    applied, the route is correctly matched and result is:
    RTNETLINK answers: No such process

    Please consider this for stable trees as well.

    Fixes: 4e902c57417c4 ("[IPv4]: FIB configuration using struct fib_config")
    Signed-off-by: Jiri Pirko
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • We worked hard to improve tcp_ack() performance, by not accessing
    skb_shinfo() in fast path (cd7d8498c9a5 tcp: change tcp_skb_pcount()
    location)

    We still have one spurious access because of ACK timestamping,
    added in commit e1c8a607b281 ("net-timestamp: ACK timestamp for
    bytestreams")

    By checking if sk_tsflags has SOF_TIMESTAMPING_TX_ACK set,
    we can avoid two cache line misses for the common case.

    While we are at it, add two prefetchw() :

    One in tcp_ack() to bring skb at the head of write queue.

    One in tcp_clean_rtx_queue() loop to bring following skb,
    as we will delete skb from the write queue and dirty skb->next->prev.

    Add a couple of [un]likely() clauses.

    After this patch, tcp_ack() is no longer the most consuming
    function in tcp stack.

    Signed-off-by: Eric Dumazet
    Cc: Willem de Bruijn
    Cc: Neal Cardwell
    Cc: Yuchung Cheng
    Cc: Van Jacobson
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • TCP Small Queues (tcp_tsq_handler()) can hold one reference on
    sk->sk_wmem_alloc, preventing skb->ooo_okay being set.

    We should relax test done to set skb->ooo_okay to take care
    of this extra reference.

    Minimal truesize of skb containing one byte of payload is
    SKB_TRUESIZE(1)

    Without this fix, we have more chance locking flows into the wrong
    transmit queue.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

10 Oct, 2014

1 commit

  • Pull percpu updates from Tejun Heo:
    "A lot of activities on percpu front. Notable changes are...

    - percpu allocator now can take @gfp. If @gfp doesn't contain
    GFP_KERNEL, it tries to allocate from what's already available to
    the allocator and a work item tries to keep the reserve around
    certain level so that these atomic allocations usually succeed.

    This will replace the ad-hoc percpu memory pool used by
    blk-throttle and also be used by the planned blkcg support for
    writeback IOs.

    Please note that I noticed a bug in how @gfp is interpreted while
    preparing this pull request and applied the fix 6ae833c7fe0c
    ("percpu: fix how @gfp is interpreted by the percpu allocator")
    just now.

    - percpu_ref now uses longs for percpu and global counters instead of
    ints. It leads to more sparse packing of the percpu counters on
    64bit machines but the overhead should be negligible and this
    allows using percpu_ref for refcnting pages and in-memory objects
    directly.

    - The switching between percpu and single counter modes of a
    percpu_ref is made independent of putting the base ref and a
    percpu_ref can now optionally be initialized in single or killed
    mode. This allows avoiding percpu shutdown latency for cases where
    the refcounted objects may be synchronously created and destroyed
    in rapid succession with only a fraction of them reaching fully
    operational status (SCSI probing does this when combined with
    blk-mq support). It's also planned to be used to implement forced
    single mode to detect underflow more timely for debugging.

    There's a separate branch percpu/for-3.18-consistent-ops which cleans
    up the duplicate percpu accessors. That branch causes a number of
    conflicts with s390 and other trees. I'll send a separate pull
    request w/ resolutions once other branches are merged"

    * 'for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (33 commits)
    percpu: fix how @gfp is interpreted by the percpu allocator
    blk-mq, percpu_ref: start q->mq_usage_counter in atomic mode
    percpu_ref: make INIT_ATOMIC and switch_to_atomic() sticky
    percpu_ref: add PERCPU_REF_INIT_* flags
    percpu_ref: decouple switching to percpu mode and reinit
    percpu_ref: decouple switching to atomic mode and killing
    percpu_ref: add PCPU_REF_DEAD
    percpu_ref: rename things to prepare for decoupling percpu/atomic mode switch
    percpu_ref: replace pcpu_ prefix with percpu_
    percpu_ref: minor code and comment updates
    percpu_ref: relocate percpu_ref_reinit()
    Revert "blk-mq, percpu_ref: implement a kludge for SCSI blk-mq stall during probe"
    Revert "percpu: free percpu allocation info for uniprocessor system"
    percpu-refcount: make percpu_ref based on longs instead of ints
    percpu-refcount: improve WARN messages
    percpu: fix locking regression in the failure path of pcpu_alloc()
    percpu-refcount: add @gfp to percpu_ref_init()
    proportions: add @gfp to init functions
    percpu_counter: add @gfp to percpu_counter_init()
    percpu_counter: make percpu_counters_lock irq-safe
    ...

    Linus Torvalds
     

09 Oct, 2014

1 commit

  • Pull networking updates from David Miller:
    "Most notable changes in here:

    1) By far the biggest accomplishment, thanks to a large range of
    contributors, is the addition of multi-send for transmit. This is
    the result of discussions back in Chicago, and the hard work of
    several individuals.

    Now, when the ->ndo_start_xmit() method of a driver sees
    skb->xmit_more as true, it can choose to defer the doorbell
    telling the driver to start processing the new TX queue entires.

    skb->xmit_more means that the generic networking is guaranteed to
    call the driver immediately with another SKB to send.

    There is logic added to the qdisc layer to dequeue multiple
    packets at a time, and the handling mis-predicted offloads in
    software is now done with no locks held.

    Finally, pktgen is extended to have a "burst" parameter that can
    be used to test a multi-send implementation.

    Several drivers have xmit_more support: i40e, igb, ixgbe, mlx4,
    virtio_net

    Adding support is almost trivial, so export more drivers to
    support this optimization soon.

    I want to thank, in no particular or implied order, Jesper
    Dangaard Brouer, Eric Dumazet, Alexander Duyck, Tom Herbert, Jamal
    Hadi Salim, John Fastabend, Florian Westphal, Daniel Borkmann,
    David Tat, Hannes Frederic Sowa, and Rusty Russell.

    2) PTP and timestamping support in bnx2x, from Michal Kalderon.

    3) Allow adjusting the rx_copybreak threshold for a driver via
    ethtool, and add rx_copybreak support to enic driver. From
    Govindarajulu Varadarajan.

    4) Significant enhancements to the generic PHY layer and the bcm7xxx
    driver in particular (EEE support, auto power down, etc.) from
    Florian Fainelli.

    5) Allow raw buffers to be used for flow dissection, allowing drivers
    to determine the optimal "linear pull" size for devices that DMA
    into pools of pages. The objective is to get exactly the
    necessary amount of headers into the linear SKB area pre-pulled,
    but no more. The new interface drivers use is eth_get_headlen().
    From WANG Cong, with driver conversions (several had their own
    by-hand duplicated implementations) by Alexander Duyck and Eric
    Dumazet.

    6) Support checksumming more smoothly and efficiently for
    encapsulations, and add "foo over UDP" facility. From Tom
    Herbert.

    7) Add Broadcom SF2 switch driver to DSA layer, from Florian
    Fainelli.

    8) eBPF now can load programs via a system call and has an extensive
    testsuite. Alexei Starovoitov and Daniel Borkmann.

    9) Major overhaul of the packet scheduler to use RCU in several major
    areas such as the classifiers and rate estimators. From John
    Fastabend.

    10) Add driver for Intel FM10000 Ethernet Switch, from Alexander
    Duyck.

    11) Rearrange TCP_SKB_CB() to reduce cache line misses, from Eric
    Dumazet.

    12) Add Datacenter TCP congestion control algorithm support, From
    Florian Westphal.

    13) Reorganize sk_buff so that __copy_skb_header() is significantly
    faster. From Eric Dumazet"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1558 commits)
    netlabel: directly return netlbl_unlabel_genl_init()
    net: add netdev_txq_bql_{enqueue, complete}_prefetchw() helpers
    net: description of dma_cookie cause make xmldocs warning
    cxgb4: clean up a type issue
    cxgb4: potential shift wrapping bug
    i40e: skb->xmit_more support
    net: fs_enet: Add NAPI TX
    net: fs_enet: Remove non NAPI RX
    r8169:add support for RTL8168EP
    net_sched: copy exts->type in tcf_exts_change()
    wimax: convert printk to pr_foo()
    af_unix: remove 0 assignment on static
    ipv6: Do not warn for informational ICMP messages, regardless of type.
    Update Intel Ethernet Driver maintainers list
    bridge: Save frag_max_size between PRE_ROUTING and POST_ROUTING
    tipc: fix bug in multicast congestion handling
    net: better IFF_XMIT_DST_RELEASE support
    net/mlx4_en: remove NETDEV_TX_BUSY
    3c59x: fix bad split of cpu_to_le32(pci_map_single())
    net: bcmgenet: fix Tx ring priority programming
    ...

    Linus Torvalds
     

08 Oct, 2014

2 commits

  • Pull dmaengine updates from Dan Williams:
    "Even though this has fixes marked for -stable, given the size and the
    needed conflict resolutions this is 3.18-rc1/merge-window material.

    These patches have been languishing in my tree for a long while. The
    fact that I do not have the time to do proper/prompt maintenance of
    this tree is a primary factor in the decision to step down as
    dmaengine maintainer. That and the fact that the bulk of drivers/dma/
    activity is going through Vinod these days.

    The net_dma removal has not been in -next. It has developed simple
    conflicts against mainline and net-next (for-3.18).

    Continuing thanks to Vinod for staying on top of drivers/dma/.

    Summary:

    1/ Step down as dmaengine maintainer see commit 08223d80df38
    "dmaengine maintainer update"

    2/ Removal of net_dma, as it has been marked 'broken' since 3.13
    (commit 77873803363c "net_dma: mark broken"), without reports of
    performance regression.

    3/ Miscellaneous fixes"

    * tag 'dmaengine-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/dmaengine:
    net: make tcp_cleanup_rbuf private
    net_dma: revert 'copied_early'
    net_dma: simple removal
    dmaengine maintainer update
    dmatest: prevent memory leakage on error path in thread
    ioat: Use time_before_jiffies()
    dmaengine: fix xor sources continuation
    dma: mv_xor: Rename __mv_xor_slot_cleanup() to mv_xor_slot_cleanup()
    dma: mv_xor: Remove all callers of mv_xor_slot_cleanup()
    dma: mv_xor: Remove unneeded mv_xor_clean_completed_slots() call
    ioat: Use pci_enable_msix_exact() instead of pci_enable_msix()
    drivers: dma: Include appropriate header file in dca.c
    drivers: dma: Mark functions as static in dma_v3.c
    dma: mv_xor: Add DMA API error checks
    ioat/dca: Use dev_is_pci() to check whether it is pci device

    Linus Torvalds
     
  • Testing xmit_more support with netperf and connected UDP sockets,
    I found strange dst refcount false sharing.

    Current handling of IFF_XMIT_DST_RELEASE is not optimal.

    Dropping dst in validate_xmit_skb() is certainly too late in case
    packet was queued by cpu X but dequeued by cpu Y

    The logical point to take care of drop/force is in __dev_queue_xmit()
    before even taking qdisc lock.

    As Julian Anastasov pointed out, need for skb_dst() might come from some
    packet schedulers or classifiers.

    This patch adds new helper to cleanly express needs of various drivers
    or qdiscs/classifiers.

    Drivers that need skb_dst() in their ndo_start_xmit() should call
    following helper in their setup instead of the prior :

    dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
    ->
    netif_keep_dst(dev);

    Instead of using a single bit, we use two bits, one being
    eventually rebuilt in bonding/team drivers.

    The other one, is permanent and blocks IFF_XMIT_DST_RELEASE being
    rebuilt in bonding/team. Eventually, we could add something
    smarter later.

    Signed-off-by: Eric Dumazet
    Cc: Julian Anastasov
    Signed-off-by: David S. Miller

    Eric Dumazet
     

07 Oct, 2014

3 commits

  • Fix a openvswitch compilation error when CONFIG_INET is not set:

    =====================================================
    In file included from include/net/geneve.h:4:0,
    from net/openvswitch/flow_netlink.c:45:
    include/net/udp_tunnel.h: In function 'udp_tunnel_handle_offloads':
    >> include/net/udp_tunnel.h:100:2: error: implicit declaration of function 'iptunnel_handle_offloads' [-Werror=implicit-function-declaration]
    >> return iptunnel_handle_offloads(skb, udp_csum, type);
    >> ^
    >> >> include/net/udp_tunnel.h:100:2: warning: return makes pointer from integer without a cast
    >> >> cc1: some warnings being treated as errors

    =====================================================

    Reported-by: kbuild test robot
    Signed-off-by: Andy Zhou
    Signed-off-by: David S. Miller

    Andy Zhou
     
  • Fix a sparse warning introduced by Commit
    0b5e8b8eeae40bae6ad7c7e91c97c3c0d0e57882 (net: Add Geneve tunneling
    protocol driver) caught by kbuild test robot:

    # apt-get install sparse
    # git checkout 0b5e8b8eeae40bae6ad7c7e91c97c3c0d0e57882
    # make ARCH=x86_64 allmodconfig
    # make C=1 CF=-D__CHECK_ENDIAN__
    #
    #
    # sparse warnings: (new ones prefixed by >>)
    #
    # >> net/ipv4/geneve.c:230:42: sparse: incorrect type in assignment (different base types)
    # net/ipv4/geneve.c:230:42: expected restricted __be32 [addressable] [assigned] [usertype] s_addr
    # net/ipv4/geneve.c:230:42: got unsigned long [unsigned]
    #

    Reported-by: kbuild test robot
    Signed-off-by: Andy Zhou
    Signed-off-by: David S. Miller

    Andy Zhou
     
  • In case we find a general query with non-zero number of sources, we
    are dropping the skb as it's malformed.

    RFC3376, section 4.1.8. Number of Sources (N):

    This number is zero in a General Query or a Group-Specific Query,
    and non-zero in a Group-and-Source-Specific Query.

    Therefore, reflect that by using kfree_skb() instead of consume_skb().

    Fixes: d679c5324d9a ("igmp: avoid drop_monitor false positives")
    Signed-off-by: Daniel Borkmann
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

06 Oct, 2014

2 commits

  • This adds a device level support for Geneve -- Generic Network
    Virtualization Encapsulation. The protocol is documented at
    http://tools.ietf.org/html/draft-gross-geneve-01

    Only protocol layer Geneve support is provided by this driver.
    Openvswitch can be used for configuring, set up and tear down
    functional Geneve tunnels.

    Signed-off-by: Jesse Gross
    Signed-off-by: Andy Zhou
    Signed-off-by: David S. Miller

    Andy Zhou
     
  • Pablo Neira Ayuso says:

    ====================
    Netfilter/IPVS updates for net-next

    The following patchset contains another batch with Netfilter/IPVS updates
    for net-next, they are:

    1) Add abstracted ICMP codes to the nf_tables reject expression. We
    introduce four reasons to reject using ICMP that overlap in IPv4
    and IPv6 from the semantic point of view. This should simplify the
    maintainance of dual stack rule-sets through the inet table.

    2) Move nf_send_reset() functions from header files to per-family
    nf_reject modules, suggested by Patrick McHardy.

    3) We have to use IS_ENABLED(CONFIG_BRIDGE_NETFILTER) everywhere in the
    code now that br_netfilter can be modularized. Convert remaining spots
    in the network stack code.

    4) Use rcu_barrier() in the nf_tables module removal path to ensure that
    we don't leave object that are still pending to be released via
    call_rcu (that may likely result in a crash).

    5) Remove incomplete arch 32/64 compat from nft_compat. The original (bad)
    idea was to probe the word size based on the xtables match/target info
    size, but this assumption is wrong when you have to dump the information
    back to userspace.

    6) Allow to filter from prerouting and postrouting in the nf_tables bridge.
    In order to emulate the ebtables NAT chains (which are actually simple
    filter chains with no special semantics), we have support filtering from
    this hooks too.

    7) Add explicit module dependency between xt_physdev and br_netfilter.
    This provides a way to detect if the user needs br_netfilter from
    the configuration path. This should reduce the breakage of the
    br_netfilter modularization.

    8) Cleanup coding style in ip_vs.h, from Simon Horman.

    9) Fix crash in the recently added nf_tables masq expression. We have
    to register/unregister the notifiers to clean up the conntrack table
    entries from the module init/exit path, not from the rule addition /
    deletion path. From Arturo Borrero.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

04 Oct, 2014

4 commits

  • This patch allows configuring IPIP, sit, and GRE tunnels to use GUE.
    This is very similar to fou excpet that we need to insert the GUE header
    in addition to the UDP header on transmit.

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

    Tom Herbert
     
  • This patch adds support receiving for GUE packets in the fou module. The
    fou module now supports direct foo-over-udp (no encapsulation header)
    and GUE. To support this a type parameter is added to the fou netlink
    parameters.

    For a GUE socket we define gue_udp_recv, gue_gro_receive, and
    gue_gro_complete to handle the specifics of the GUE protocol. Most
    of the code to manage and configure sockets is common with the fou.

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

    Tom Herbert
     
  • This patch removes fou[46]_gro_receive and fou[46]_gro_complete
    functions. The v4 or v6 variants were chosen for the UDP offloads
    based on the address family of the socket this is not necessary
    or correct. Alternatively, this patch adds is_ipv6 to napi_gro_skb.
    This is set in udp6_gro_receive and unset in udp4_gro_receive. In
    fou_gro_receive the value is used to select the correct inet_offloads
    for the protocol of the outer IP header.

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

    Tom Herbert
     
  • When adjusting max_header for the tunnel interface based on egress
    device we need to account for any extra bytes in secondary encapsulation
    (e.g. FOU).

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

    Tom Herbert
     

03 Oct, 2014

5 commits


02 Oct, 2014

8 commits

  • Call skb_set_inner_protocol to set inner Ethernet protocol to
    protocol being encapsulation by GRE before tunnel_xmit. This is
    needed for GSO if UDP encapsulation (fou) is being done.

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

    Tom Herbert
     
  • Call skb_set_inner_ipproto to set inner IP protocol to IPPROTO_IPV4
    before tunnel_xmit. This is needed if UDP encapsulation (fou) is
    being done.

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

    Tom Herbert
     
  • skb_udp_segment is the function called from udp4_ufo_fragment to
    segment a UDP tunnel packet. This function currently assumes
    segmentation is transparent Ethernet bridging (i.e. VXLAN
    encapsulation). This patch generalizes the function to
    operate on either Ethertype or IP protocol.

    The inner_protocol field must be set to the protocol of the inner
    header. This can now be either an Ethertype or an IP protocol
    (in a union). A new flag in the skbuff indicates which type is
    effective. skb_set_inner_protocol and skb_set_inner_ipproto
    helper functions were added to set the inner_protocol. These
    functions are called from the point where the tunnel encapsulation
    is occuring.

    When skb_udp_tunnel_segment is called, the function to segment the
    inner packet is selected based on the inner IP or Ethertype. In the
    case of an IP protocol encapsulation, the function is derived from
    inet[6]_offloads. In the case of Ethertype, skb->protocol is
    set to the inner_protocol and skb_mac_gso_segment is called. (GRE
    currently does this, but it might be possible to lookup the protocol
    in offload_base and call the appropriate segmenation function
    directly).

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

    Tom Herbert
     
  • Lets use a proper structure to clearly document and implement
    skb fast clones.

    Then, we might experiment more easily alternative layouts.

    This patch adds a new skb_fclone_busy() helper, used by tcp and xfrm,
    to stop leaking of implementation details.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Currently we have two different policies for orphan sockets
    that repeatedly stall on zero window ACKs. If a socket gets
    a zero window ACK when it is transmitting data, the RTO is
    used to probe the window. The socket is aborted after roughly
    tcp_orphan_retries() retries (as in tcp_write_timeout()).

    But if the socket was idle when it received the zero window ACK,
    and later wants to send more data, we use the probe timer to
    probe the window. If the receiver always returns zero window ACKs,
    icsk_probes keeps getting reset in tcp_ack() and the orphan socket
    can stall forever until the system reaches the orphan limit (as
    commented in tcp_probe_timer()). This opens up a simple attack
    to create lots of hanging orphan sockets to burn the memory
    and the CPU, as demonstrated in the recent netdev post "TCP
    connection will hang in FIN_WAIT1 after closing if zero window is
    advertised." http://www.spinics.net/lists/netdev/msg296539.html

    This patch follows the design in RTO-based probe: we abort an orphan
    socket stalling on zero window when the probe timer reaches both
    the maximum backoff and the maximum RTO. For example, an 100ms RTT
    connection will timeout after roughly 153 seconds (0.3 + 0.6 +
    .... + 76.8) if the receiver keeps the window shut. If the orphan
    socket passes this check, but the system already has too many orphans
    (as in tcp_out_of_resources()), we still abort it but we'll also
    send an RST packet as the connection may still be active.

    In addition, we change TCP_USER_TIMEOUT to cover (life or dead)
    sockets stalled on zero-window probes. This changes the semantics
    of TCP_USER_TIMEOUT slightly because it previously only applies
    when the socket has pending transmission.

    Signed-off-by: Yuchung Cheng
    Signed-off-by: Eric Dumazet
    Signed-off-by: Neal Cardwell
    Reported-by: Andrey Dmitrov
    Signed-off-by: David S. Miller

    Yuchung Cheng
     
  • cipso_v4_cache_init is only called by __init cipso_v4_init

    Signed-off-by: Fabian Frederick
    Signed-off-by: David S. Miller

    Fabian Frederick
     
  • ip4_frags_ctl_register is only called by __init ipfrag_init

    Signed-off-by: Fabian Frederick
    Signed-off-by: David S. Miller

    Fabian Frederick
     
  • tcp_init_mem is only called by __init tcp_init.

    Signed-off-by: Fabian Frederick
    Signed-off-by: David S. Miller

    Fabian Frederick