16 Jul, 2014

1 commit


26 Jun, 2014

1 commit

  • It is trivial to add netpoll support to veth, since
    it is not a stacked device, we don't need to setup and
    clean up netpoll.

    Reported-by: Stefan Priebe
    Cc: "David S. Miller"
    Cc: Neil Horman
    Acked-by: Neil Horman
    Signed-off-by: Cong Wang
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    WANG Cong
     

30 Mar, 2014

1 commit


29 Mar, 2014

1 commit


15 Mar, 2014

1 commit

  • Replace the bh safe variant with the hard irq safe variant.

    We need a hard irq safe variant to deal with netpoll transmitting
    packets from hard irq context, and we need it in most if not all of
    the places using the bh safe variant.

    Except on 32bit uni-processor the code is exactly the same so don't
    bother with a bh variant, just have a hard irq safe variant that
    everyone can use.

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

    Eric W. Biederman
     

06 Mar, 2014

1 commit

  • Conflicts:
    drivers/net/wireless/ath/ath9k/recv.c
    drivers/net/wireless/mwifiex/pcie.c
    net/ipv6/sit.c

    The SIT driver conflict consists of a bug fix being done by hand
    in 'net' (missing u64_stats_init()) whilst in 'net-next' a helper
    was created (netdev_alloc_pcpu_stats()) which takes care of this.

    The two wireless conflicts were overlapping changes.

    Signed-off-by: David S. Miller

    David S. Miller
     

20 Feb, 2014

1 commit

  • Even if we create a stacked vlan interface such as veth0.10.20, it sends
    single tagged frames (tagged with only vid 10).
    Because vlan_features of a veth interface has the
    NETIF_F_HW_VLAN_[CTAG/STAG]_TX bits, veth0.10 also has that feature, so
    dev_hard_start_xmit(veth0.10) doesn't call __vlan_put_tag() and
    vlan_dev_hard_start_xmit(veth0.10) overwrites vlan_tci.
    This prevents us from using a combination of 802.1ad and 802.1Q
    in containers, etc.

    Signed-off-by: Toshiaki Makita
    Acked-by: Flavio Leitner
    Signed-off-by: David S. Miller

    Toshiaki Makita
     

19 Feb, 2014

1 commit


15 Feb, 2014

1 commit


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
     

28 Oct, 2013

1 commit

  • While investigating on a recent vxlan regression, I found veth
    was using a zero features set for vxlan tunnels.

    We have to segment GSO frames, copy the payload, and do the checksum.

    This patch brings a ~200% performance increase

    We probably have to add hw_enc_features support
    on other virtual devices.

    Signed-off-by: Eric Dumazet
    Cc: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Eric Dumazet
     

10 Oct, 2013

1 commit

  • We can only setup multicast address for network device when
    net_device_ops->ndo_set_rx_mode is not null.

    Some configurations need to add multicast address for net
    device, such as netfilter cluster match module.

    Add a fake ndo_set_rx_mode function to allow this operation.

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

    Gao feng
     

09 Oct, 2013

2 commits


20 Jul, 2013

1 commit

  • The veth device doesn't provide the vlan features,
    so TSO for example is disabled and that causes
    performance issues when using tagged traffic.

    The test topology looks like this:

    br0 br1
    / \ / \
    vnet veth0.10 ----- veth1.10 vnet
    VM VM

    The netperf results with current veth driver:
    MIGRATED TCP STREAM TEST from 192.168.1.1 ()
    port 0 AF_INET to 192.168.1.2 () port 0 AF_INET
    Recv Send Send
    Socket Socket Message Elapsed
    Size Size Size Time Throughput
    bytes bytes bytes secs. 10^6bits/sec

    87380 16384 16384 10.01 2210.22

    Now after applying the proposed patch:
    MIGRATED TCP STREAM TEST from 192.168.1.1 ()
    port 0 AF_INET to 192.168.1.2 () port 0 AF_INET
    Recv Send Send
    Socket Socket Message Elapsed
    Size Size Size Time Throughput
    bytes bytes bytes secs. 10^6bits/sec

    87380 16384 16384 10.00 13067.47

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

    Flavio Leitner
     

12 Jun, 2013

1 commit


20 Apr, 2013

2 commits


11 Feb, 2013

1 commit

  • commit d0e2c55e7c940 (veth: avoid a NULL deref in veth_stats_one)
    added another NULL deref in veth_dellink().

    # ip link add name veth1 type veth peer name veth0
    # rmmod veth

    We crash because veth_dellink() is called twice, so we must
    take care of NULL peer.

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

    Eric Dumazet
     

11 Jan, 2013

1 commit

  • In commit d0e2c55e7c94 (veth: avoid a NULL deref in veth_stats_one)
    we now clear the peer pointers in veth_dellink()

    veth_close() must therefore make sure the peer pointer is set.

    Reported-by: Tom Parkin
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

08 Jan, 2013

1 commit

  • commit 2681128f0ced8a (veth: extend device features) added a NULL deref
    in veth_stats_one(), as veth_get_stats64() was not testing if the peer
    device was setup or not.

    At init time, we call dev_get_stats() before veth pair is fully setup.

    [ 178.854758] [] veth_get_stats64+0x47/0x70 [veth]
    [ 178.861013] [] dev_get_stats+0x6d/0x130
    [ 178.866486] [] rtnl_fill_ifinfo+0x47c/0x930
    [ 178.872299] [] rtmsg_ifinfo+0x83/0x100
    [ 178.877678] [] rtnl_configure_link+0x76/0xa0
    [ 178.883580] [] veth_newlink+0x16a/0x350 [veth]
    [ 178.889654] [] rtnl_newlink+0x4dc/0x5e0
    [ 178.895128] [] ? rtnl_newlink+0x12e/0x5e0
    [ 178.900769] [] rtnetlink_rcv_msg+0x11d/0x310
    [ 178.906669] [] ? __rtnl_unlock+0x20/0x20
    [ 178.912225] [] netlink_rcv_skb+0xa9/0xd0
    [ 178.917779] [] rtnetlink_rcv+0x25/0x40
    [ 178.923159] [] netlink_unicast+0x1b1/0x230
    [ 178.928887] [] netlink_sendmsg+0x2fe/0x3b0
    [ 178.934615] [] sock_sendmsg+0xd2/0xf0

    So we must check if peer was setup in veth_get_stats64()

    As pointed out by Ben Hutchings, priv->peer is missing proper
    synchronization. Adding RCU protection is a safe and well documented
    way to make sure we don't access about to be freed or already
    freed data.

    Reported-by: Tom Parkin
    Signed-off-by: Eric Dumazet
    CC: Ben Hutchings
    Signed-off-by: David S. Miller

    Eric Dumazet
     

30 Dec, 2012

2 commits

  • veth is lacking most modern facilities, like SG, checksums, TSO.

    It makes sense to extend dev->features to get them, or GRO aggregation
    is defeated by a forced segmentation.

    Reported-by: Andrew Vagin
    Signed-off-by: Eric Dumazet
    Cc: Michał Mirosław
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • veth stats are a bit bloated. There is no need to account transmit
    and receive stats, since they are absolutely symmetric.

    Also use a per device atomic64_t for the dropped counter, as it
    should never be used in fast path.

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

    Eric Dumazet
     

01 Dec, 2012

1 commit

  • This patch removes an unused parameter (src_net) from rtnl_create_link()
    method and from the method single invocation, in veth.
    This parameter was used in the past when calling
    ops->get_tx_queues(src_net, tb) in rtnl_create_link().
    The get_tx_queues() member of rtnl_link_ops was replaced by two methods,
    get_num_tx_queues() and get_num_rx_queues(), which do not get any
    parameter. This was done in commit d40156aa5ecbd51fed932ed4813df82b56e5ff4d by
    Jiri Pirko ("rtnl: allow to specify different num for rx and tx queue count").

    Signed-off-by: Rami Rosen
    Signed-off-by: David S. Miller

    Rami Rosen
     

02 Nov, 2012

1 commit


10 Aug, 2012

1 commit

  • The ifinfomsg is in there (thanks kaber@ for foreseeing this long time ago),
    so take the given ifidex and register netdev with it.

    Ben noticed, that this code path previously ignored ifmp->ifi_index and
    userland could be passing in garbage. Thus it may now fail occasionally
    because the value clashes with an existing interface.

    To address this it's assumed that if the caller specifies the ifindex for
    the veth master device, then it's aware of this possibility and should
    explicitly specify (or set to 0 for auto-assignment) the peer's ifindex as
    well. With this the compatibility with old tools not setting ifindex is
    preserved.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

20 Feb, 2012

1 commit


16 Feb, 2012

2 commits


23 Nov, 2011

1 commit


17 Nov, 2011

2 commits


09 Nov, 2011

1 commit

  • Tunnels can force an alignment of their percpu data to reduce number of
    cache lines used in fast path, or read in .ndo_get_stats()

    percpu_alloc() is a very fine grained allocator, so any small hole will
    be used anyway.

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

    Eric Dumazet
     

01 Nov, 2011

1 commit


28 Jul, 2011

1 commit

  • 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
     

06 Jul, 2011

2 commits


01 Jul, 2011

1 commit


20 Jun, 2011

1 commit

  • Using 64bit stats on 32bit arches must use a synchronization or readers
    can get transient values.

    Fixes bug introduced in commit 6311cc44a2 (veth: convert to 64 bit
    statistics)

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

    Eric Dumazet