02 May, 2018

1 commit


02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

09 May, 2017

1 commit


03 May, 2017

1 commit


07 Apr, 2017

1 commit


07 Feb, 2017

1 commit

  • For XDP we will need to reset the queues to allow for buffer headroom
    to be configured. In order to do this we need to essentially run the
    freeze()/restore() code path. Unfortunately the locking requirements
    between the freeze/restore and reset paths are different however so
    we can not simply reuse the code.

    This patch refactors the code path and adds a reset helper routine.

    Signed-off-by: John Fastabend
    Acked-by: Jason Wang
    Signed-off-by: David S. Miller

    John Fastabend
     

02 Mar, 2016

1 commit

  • This leaves vring_new_virtqueue alone for compatbility, but it
    adds two new improved APIs:

    vring_create_virtqueue: Creates a virtqueue backed by automatically
    allocated coherent memory. (Some day it this could be extended to
    support non-coherent memory, too, if there ends up being a platform
    on which it's worthwhile.)

    __vring_new_virtqueue: Creates a virtqueue with a manually-specified
    layout. This should allow mic_virtio to work much more cleanly.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Michael S. Tsirkin

    Andy Lutomirski
     

15 Apr, 2015

1 commit


18 Dec, 2014

1 commit

  • Pull virtio updates from Rusty Russell:
    "A balloon enhancement, and a minor race-on-module-unload theoretical
    bug which doesn't merit cc: stable.

    All the exciting stuff went via MST this cycle"

    * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    virtio_balloon: free some memory from balloon on OOM
    virtio_balloon: return the amount of freed memory from leak_balloon()
    virtio_blk: fix race at module removal
    virtio: Fix comment typo 'CONFIG_S_FAILED'

    Linus Torvalds
     

10 Dec, 2014

1 commit


09 Dec, 2014

6 commits

  • transports need to be able to detect legacy-only
    devices (ATM balloon only) to use legacy path
    to drive them.

    Add a core API to do just that.
    The implementation just blacklists balloon:
    not too pretty, but let's not over-engineer.

    Signed-off-by: Michael S. Tsirkin
    Acked-by: Cornelia Huck

    Michael S. Tsirkin
     
  • We have no plans to support virtio 1.0 in balloon driver. Add an
    explicit flag to mark it legacy only.

    This will be used by follow-up patches.

    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • virtio-blk has some legacy feature bits that modern drivers
    must not negotiate, but are needed for old legacy hosts
    (that e.g. don't support virtio-scsi).
    Allow a separate legacy feature table for such cases.

    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck

    Michael S. Tsirkin
     
  • For virtio-1, we can theoretically have a more complex virtqueue
    layout with avail and used buffers not on a contiguous memory area
    with the descriptor table. For now, it's fine for a transport driver
    to stay with the old layout: It needs, however, a way to access
    the locations of the avail/used rings so it can register them with
    the host.

    Reviewed-by: David Hildenbrand
    Signed-off-by: Cornelia Huck

    Signed-off-by: Michael S. Tsirkin

    Cornelia Huck
     
  • Change u32 to u64, and use BIT_ULL and 1ULL everywhere.

    Note: transports are unchanged, and only set low 32 bit.
    This guarantees that no transport sets e.g. VERSION_1
    by mistake without proper support.

    Based on patch by Rusty.

    Signed-off-by: Rusty Russell
    Signed-off-by: Cornelia Huck
    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: David Hildenbrand
    Reviewed-by: Cornelia Huck

    Michael S. Tsirkin
     
  • It seemed like a good idea to use bitmap for features
    in struct virtio_device, but it's actually a pain,
    and seems to become even more painful when we get more
    than 32 feature bits. Just change it to a u32 for now.

    Based on patch by Rusty.

    Suggested-by: David Hildenbrand
    Signed-off-by: Rusty Russell
    Signed-off-by: Cornelia Huck
    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck

    Michael S. Tsirkin
     

11 Nov, 2014

1 commit


15 Oct, 2014

3 commits

  • Defer config changed notifications that arrive during
    probe/scan/freeze/restore.

    This will allow drivers to set DRIVER_OK earlier, without worrying about
    racing with config change interrupts.

    This change will also benefit old hypervisors (before 2009)
    that send interrupts without checking DRIVER_OK: previously,
    the callback could race with driver-specific initialization.

    This will also help simplify drivers.

    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck
    Signed-off-by: Rusty Russell (cosmetic changes)

    Michael S. Tsirkin
     
  • This is in preparation to extending config changed event handling
    in core.
    Wrapping these in an API also seems to make for a cleaner code.

    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Replace duplicated code in all transports with a single wrapper in
    virtio.c.

    The only functional change is in virtio_mmio.c: if a buggy device sends
    us an interrupt before driver is set, we previously returned IRQ_NONE,
    now we return IRQ_HANDLED.

    As this must not happen in practice, this does not look like a big deal.

    See also commit 3fff0179e33cd7d0a688dab65700c46ad089e934
    virtio-pci: do not oops on config change if driver not loaded.
    for the original motivation behind the driver check.

    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     

28 Apr, 2014

1 commit


29 Oct, 2013

2 commits


10 Jul, 2013

2 commits

  • Pull networking updates from David Miller:
    "This is a re-do of the net-next pull request for the current merge
    window. The only difference from the one I made the other day is that
    this has Eliezer's interface renames and the timeout handling changes
    made based upon your feedback, as well as a few bug fixes that have
    trickeled in.

    Highlights:

    1) Low latency device polling, eliminating the cost of interrupt
    handling and context switches. Allows direct polling of a network
    device from socket operations, such as recvmsg() and poll().

    Currently ixgbe, mlx4, and bnx2x support this feature.

    Full high level description, performance numbers, and design in
    commit 0a4db187a999 ("Merge branch 'll_poll'")

    From Eliezer Tamir.

    2) With the routing cache removed, ip_check_mc_rcu() gets exercised
    more than ever before in the case where we have lots of multicast
    addresses. Use a hash table instead of a simple linked list, from
    Eric Dumazet.

    3) Add driver for Atheros CQA98xx 802.11ac wireless devices, from
    Bartosz Markowski, Janusz Dziedzic, Kalle Valo, Marek Kwaczynski,
    Marek Puzyniak, Michal Kazior, and Sujith Manoharan.

    4) Support reporting the TUN device persist flag to userspace, from
    Pavel Emelyanov.

    5) Allow controlling network device VF link state using netlink, from
    Rony Efraim.

    6) Support GRE tunneling in openvswitch, from Pravin B Shelar.

    7) Adjust SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF for modern times, from
    Daniel Borkmann and Eric Dumazet.

    8) Allow controlling of TCP quickack behavior on a per-route basis,
    from Cong Wang.

    9) Several bug fixes and improvements to vxlan from Stephen
    Hemminger, Pravin B Shelar, and Mike Rapoport. In particular,
    support receiving on multiple UDP ports.

    10) Major cleanups, particular in the area of debugging and cookie
    lifetime handline, to the SCTP protocol code. From Daniel
    Borkmann.

    11) Allow packets to cross network namespaces when traversing tunnel
    devices. From Nicolas Dichtel.

    12) Allow monitoring netlink traffic via AF_PACKET sockets, in a
    manner akin to how we monitor real network traffic via ptype_all.
    From Daniel Borkmann.

    13) Several bug fixes and improvements for the new alx device driver,
    from Johannes Berg.

    14) Fix scalability issues in the netem packet scheduler's time queue,
    by using an rbtree. From Eric Dumazet.

    15) Several bug fixes in TCP loss recovery handling, from Yuchung
    Cheng.

    16) Add support for GSO segmentation of MPLS packets, from Simon
    Horman.

    17) Make network notifiers have a real data type for the opaque
    pointer that's passed into them. Use this to properly handle
    network device flag changes in arp_netdev_event(). From Jiri
    Pirko and Timo Teräs.

    18) Convert several drivers over to module_pci_driver(), from Peter
    Huewe.

    19) tcp_fixup_rcvbuf() can loop 500 times over loopback, just use a
    O(1) calculation instead. From Eric Dumazet.

    20) Support setting of explicit tunnel peer addresses in ipv6, just
    like ipv4. From Nicolas Dichtel.

    21) Protect x86 BPF JIT against spraying attacks, from Eric Dumazet.

    22) Prevent a single high rate flow from overruning an individual cpu
    during RX packet processing via selective flow shedding. From
    Willem de Bruijn.

    23) Don't use spinlocks in TCP md5 signing fast paths, from Eric
    Dumazet.

    24) Don't just drop GSO packets which are above the TBF scheduler's
    burst limit, chop them up so they are in-bounds instead. Also
    from Eric Dumazet.

    25) VLAN offloads are missed when configured on top of a bridge, fix
    from Vlad Yasevich.

    26) Support IPV6 in ping sockets. From Lorenzo Colitti.

    27) Receive flow steering targets should be updated at poll() time
    too, from David Majnemer.

    28) Fix several corner case regressions in PMTU/redirect handling due
    to the routing cache removal, from Timo Teräs.

    29) We have to be mindful of ipv4 mapped ipv6 sockets in
    upd_v6_push_pending_frames(). From Hannes Frederic Sowa.

    30) Fix L2TP sequence number handling bugs, from James Chapman."

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1214 commits)
    drivers/net: caif: fix wrong rtnl_is_locked() usage
    drivers/net: enic: release rtnl_lock on error-path
    vhost-net: fix use-after-free in vhost_net_flush
    net: mv643xx_eth: do not use port number as platform device id
    net: sctp: confirm route during forward progress
    virtio_net: fix race in RX VQ processing
    virtio: support unlocked queue poll
    net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit
    Documentation: Fix references to defunct linux-net@vger.kernel.org
    net/fs: change busy poll time accounting
    net: rename low latency sockets functions to busy poll
    bridge: fix some kernel warning in multicast timer
    sfc: Fix memory leak when discarding scattered packets
    sit: fix tunnel update via netlink
    dt:net:stmmac: Add dt specific phy reset callback support.
    dt:net:stmmac: Add support to dwmac version 3.610 and 3.710
    dt:net:stmmac: Allocate platform data only if its NULL.
    net:stmmac: fix memleak in the open method
    ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available
    net: ipv6: fix wrong ping_v6_sendmsg return value
    ...

    Linus Torvalds
     
  • This adds a way to check ring empty state after enable_cb outside any
    locks. Will be used by virtio_net.

    Note: there's room for more optimization: caller is likely to have a
    memory barrier already, which means we might be able to get rid of a
    barrier here. Deferring this optimization until we do some
    benchmarking.

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

    Michael S. Tsirkin
     

20 May, 2013

1 commit


03 May, 2013

1 commit

  • Pull virtio & lguest updates from Rusty Russell:
    "Lots of virtio work which wasn't quite ready for last merge window.

    Plus I dived into lguest again, reworking the pagetable code so we can
    move the switcher page: our fixmaps sometimes take more than 2MB now..."

    Ugh. Annoying conflicts with the tcm_vhost -> vhost_scsi rename.
    Hopefully correctly resolved.

    * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (57 commits)
    caif_virtio: Remove bouncing email addresses
    lguest: improve code readability in lg_cpu_start.
    virtio-net: fill only rx queues which are being used
    lguest: map Switcher below fixmap.
    lguest: cache last cpu we ran on.
    lguest: map Switcher text whenever we allocate a new pagetable.
    lguest: don't share Switcher PTE pages between guests.
    lguest: expost switcher_pages array (as lg_switcher_pages).
    lguest: extract shadow PTE walking / allocating.
    lguest: make check_gpte et. al return bool.
    lguest: assume Switcher text is a single page.
    lguest: rename switcher_page to switcher_pages.
    lguest: remove RESERVE_MEM constant.
    lguest: check vaddr not pgd for Switcher protection.
    lguest: prepare to make SWITCHER_ADDR a variable.
    virtio: console: replace EMFILE with EBUSY for already-open port
    virtio-scsi: reset virtqueue affinity when doing cpu hotplug
    virtio-scsi: introduce multiqueue support
    virtio-scsi: push vq lock/unlock into virtscsi_vq_done
    virtio-scsi: pass struct virtio_scsi to virtqueue completion function
    ...

    Linus Torvalds
     

22 Mar, 2013

1 commit


20 Mar, 2013

3 commits

  • These are specialized versions of virtqueue_add_buf(), which cover
    over 80% of cases and are far clearer.

    In particular, the scatterlists passed to these functions don't have
    to be clean (ie. we ignore end markers).

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • virtio_scsi can really use this, to avoid the current hack of copying
    the whole sg array. Some other things get slightly neater, too.

    This causes a slowdown in virtqueue_add_buf(), which is implemented as
    a wrapper. This is addressed in the next patches.

    for i in `seq 50`; do /usr/bin/time -f 'Wall time:%e' ./vringh_test --indirect --eventidx --parallel --fast-vringh; done 2>&1 | stats --trim-outliers:

    Before:
    Using CPUS 0 and 3
    Guest: notified 0, pinged 39009-39063(39062)
    Host: notified 39009-39063(39062), pinged 0
    Wall time:1.700000-1.950000(1.723542)

    After:
    Using CPUS 0 and 3
    Guest: notified 0, pinged 39062-39063(39063)
    Host: notified 39062-39063(39063), pinged 0
    Wall time:1.760000-2.220000(1.789167)

    Signed-off-by: Rusty Russell
    Reviewed-by: Wanlong Gao
    Reviewed-by: Asias He

    Rusty Russell
     
  • Add wrappers for the host vrings to support loose
    coupling between the virtio device and driver.

    A new struct vringh_config_ops with the functions
    find_vrhs() and del_vrhs() is added to the virtio_device
    struct. This enables virtio drivers to manage virtio
    host rings without detailed knowledge of how the
    vrings are created and deleted.

    The function vringh_notify() is added so vringh clients
    can notify the other side that buffers are added to the
    used-ring.

    Cc: Ohad Ben-Cohen
    Signed-off-by: Sjur Brændeland
    Signed-off-by: Rusty Russell (constified vringh_config)

    Sjur Brændeland
     

13 Feb, 2013

1 commit


11 Feb, 2013

1 commit


18 Dec, 2012

3 commits


28 Sep, 2012

1 commit

  • Instead of storing the queue index in transport-specific virtio structs,
    this patch moves them to vring_virtqueue and introduces an helper to get
    the value. This lets drivers simplify their management and tracing of
    virtqueues.

    Signed-off-by: Jason Wang
    Signed-off-by: Paolo Bonzini
    Signed-off-by: Rusty Russell

    Jason Wang
     

20 Jul, 2012

1 commit

  • This patch changes virtio-scsi to use a new virtio_driver->scan() callback
    so that scsi_scan_host() can be properly invoked once virtio_dev_probe() has
    set add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK) to signal active virtio-ring
    operation, instead of from within virtscsi_probe().

    This fixes a bug where SCSI LUN scanning for both virtio-scsi-raw and
    virtio-scsi/tcm_vhost setups was happening before VIRTIO_CONFIG_S_DRIVER_OK
    had been set, causing VIRTIO_SCSI_S_BAD_TARGET to occur. This fixes a bug
    with virtio-scsi/tcm_vhost where LUN scan was not detecting LUNs.

    Tested with virtio-scsi-raw + virtio-scsi/tcm_vhost w/ IBLOCK on 3.5-rc2 code.

    Signed-off-by: Nicholas Bellinger
    Acked-by: Paolo Bonzini
    Signed-off-by: James Bottomley

    Nicholas Bellinger
     

31 Mar, 2012

1 commit


12 Jan, 2012

1 commit

  • Handle thaw, restore and freeze notifications from the PM core. Expose
    these to individual virtio drivers that can quiesce and resume vq
    operations. For drivers not implementing the thaw() method, use the
    restore method instead.

    These functions also save device-specific data so that the device can be
    put in pre-suspend state after resume, and disable and enable the PCI
    device in the freeze and resume functions, respectively.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah