06 Aug, 2016

1 commit

  • Pull virtio/vhost updates from Michael Tsirkin:

    - new vsock device support in host and guest

    - platform IOMMU support in host and guest, including compatibility
    quirks for legacy systems.

    - misc fixes and cleanups.

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    VSOCK: Use kvfree()
    vhost: split out vringh Kconfig
    vhost: detect 32 bit integer wrap around
    vhost: new device IOTLB API
    vhost: drop vringh dependency
    vhost: convert pre sorted vhost memory array to interval tree
    vhost: introduce vhost memory accessors
    VSOCK: Add Makefile and Kconfig
    VSOCK: Introduce vhost_vsock.ko
    VSOCK: Introduce virtio_transport.ko
    VSOCK: Introduce virtio_vsock_common.ko
    VSOCK: defer sock removal to transports
    VSOCK: transport-specific vsock_transport functions
    vhost: drop vringh dependency
    vop: pull in vhost Kconfig
    virtio: new feature to detect IOMMU device quirk
    balloon: check the number of available pages in leak balloon
    vhost: lockless enqueuing
    vhost: simplify work flushing

    Linus Torvalds
     

02 Aug, 2016

2 commits

  • vringh is pulled in by caif and mic, but the other
    vhost config does not need to be there.
    In particular, it makes no sense to have vhost net/scsi/sock
    under caif/mic.

    Create a separate Kconfig file and put vringh bits there.

    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • %u is the wrong format specifier for int.
    size_t cannot be converted to int without possible
    loss of information.

    So leave the result as size_t and use %zu as format specifier.

    cf. Documentation/printk-formats.txt

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: David S. Miller

    xypron.glpk@gmx.de
     

26 Jul, 2016

1 commit

  • alloc_workqueue replaces deprecated create_singlethread_workqueue().

    A dedicated workqueue has been used since the workitems are being used
    on a packet tx/rx path. Hence, WQ_MEM_RECLAIM has been set to guarantee
    forward progress under memory pressure.

    An ordered workqueue has been used since workitems &cfhsi->wake_up_work
    and &cfhsi->wake_down_work cannot be run concurrently.

    Calls to flush_workqueue() before destroy_workqueue() have been dropped
    since destroy_workqueue() itself calls drain_workqueue() which flushes
    repeatedly till the workqueue becomes empty.

    Signed-off-by: Bhaktipriya Shridhar
    Acked-by: Tejun Heo
    Signed-off-by: David S. Miller

    Bhaktipriya Shridhar
     

10 Nov, 2015

1 commit

  • I don't know if dev can actually be NULL here, but the test should be
    above alloc_netdev(), to avoid leaking the struct net_device in case
    dev is actually NULL. And of course the return value from alloc_netdev
    should be tested.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: David S. Miller

    Rasmus Villemoes
     

19 Aug, 2015

1 commit


02 Apr, 2015

1 commit

  • The tty_name member of struct ser_device is never set or used, so it
    can be removed. (The definition of struct ser_device is private to
    this .c file, and the identifier tty_name only occurs in this one
    place.)

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: David S. Miller

    Rasmus Villemoes
     

30 Jan, 2015

1 commit

  • src_net points to the netns where the netlink message has been received. This
    netns may be different from the netns where the interface is created (because
    the user may add IFLA_NET_NS_[PID|FD]). In this case, src_net is the link netns.

    It seems wrong to override the netns in the newlink() handler because if it
    was not already src_net, it means that the user explicitly asks to create the
    netdevice in another netns.

    CC: Sjur Brændeland
    CC: Dmitry Tarnyagin
    Fixes: 8391c4aab1aa ("caif: Bugfixes in CAIF netdevice for close and flow control")
    Fixes: c41254006377 ("caif-hsi: Add rtnl support")
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     

23 Dec, 2014

1 commit

  • The commit d75b1ade567ffab085e8adbbdacf0092d10cd09c (net: less
    interrupt masking in NAPI) breaks caif.

    It is now required that if the entire budget is consumed when poll
    returns, the napi poll_list must remain empty. However, like some
    other drivers caif tries to do a last-ditch check and if there is
    more work it will call napi_schedule and then immediately process
    some of this new work. Should the entire budget be consumed while
    processing such new work then we will violate the new caller
    contract.

    This patch fixes this by not touching any work when we reschedule
    in caif.

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

    Herbert Xu
     

16 Jul, 2014

1 commit

  • Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
    all users to pass NET_NAME_UNKNOWN.

    Coccinelle patch:

    @@
    expression sizeof_priv, name, setup, txqs, rxqs, count;
    @@

    (
    -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
    +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
    |
    -alloc_netdev_mq(sizeof_priv, name, setup, count)
    +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
    |
    -alloc_netdev(sizeof_priv, name, setup)
    +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
    )

    v9: move comments here from the wrong commit

    Signed-off-by: Tom Gundersen
    Reviewed-by: David Herrmann
    Signed-off-by: David S. Miller

    Tom Gundersen
     

17 Feb, 2014

1 commit

  • On success, the function netdev_alloc_skb initializes the dev field of its
    result to its first argument, so this doesn't have to be done in the
    calling context.

    The semantic patch that fixes this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression skb,privn,e;
    @@

    skb = netdev_alloc_skb(privn,...);
    ... when strict
    (
    -skb->dev = privn;
    |
    ?skb = e
    )
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

17 Jan, 2014

1 commit

  • None of these files are actually using any __init type directives
    and hence don't need to include . Most are just a
    left over from __devinit and __cpuinit removal, or simply due to
    code getting copied from one driver to the next.

    This covers everything under drivers/net except for wireless, which
    has been submitted separately.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    Paul Gortmaker
     

17 Oct, 2013

1 commit


04 Sep, 2013

1 commit

  • "tty->name" and "name" are a 64 character buffers. My static checker
    complains because we add the "cf" on the front so it look like we are
    copying a 66 character string into a 64 character buffer.

    Also if the name is larger than IFNAMSIZ (16) it triggers a BUG_ON()
    inside the call to alloc_netdev().

    This is all under CAP_SYS_ADMIN so it's not a security fix, it just adds
    a little robustness.

    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller

    Dan Carpenter
     

10 Jul, 2013

1 commit

  • rtnl_is_locked() doesn't check who holds this lock, it just tells that it's
    locked right now. if caif::ldisc_close really can be called under rtrnl_lock
    then it should release net device in other context because there is no way
    to grab rtnl_lock without deadlock.

    This patch adds work which releases these devices. Also this patch fixes calling
    dev_close/unregister_netdevice without rtnl_lock from caif_ser_exit().

    Signed-off-by: Konstantin Khlebnikov
    Cc: Dmitry Tarnyagin
    Signed-off-by: David S. Miller

    Konstantin Khlebnikov
     

12 May, 2013

1 commit

  • If NO_DMA=y:

    drivers/built-in.o: In function `cfv_destroy_genpool':
    drivers/net/caif/caif_virtio.c:364: undefined reference to `dma_free_coherent'
    drivers/built-in.o: In function `cfv_create_genpool':
    drivers/net/caif/caif_virtio.c:397: undefined reference to `dma_alloc_coherent'

    Signed-off-by: Geert Uytterhoeven
    Cc: Dmitry Tarnyagin
    Cc: David S. Miller
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller

    Geert Uytterhoeven
     

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
     

02 May, 2013

1 commit

  • Pull networking updates from David Miller:
    "Highlights (1721 non-merge commits, this has to be a record of some
    sort):

    1) Add 'random' mode to team driver, from Jiri Pirko and Eric
    Dumazet.

    2) Make it so that any driver that supports configuration of multiple
    MAC addresses can provide the forwarding database add and del
    calls by providing a default implementation and hooking that up if
    the driver doesn't have an explicit set of handlers. From Vlad
    Yasevich.

    3) Support GSO segmentation over tunnels and other encapsulating
    devices such as VXLAN, from Pravin B Shelar.

    4) Support L2 GRE tunnels in the flow dissector, from Michael Dalton.

    5) Implement Tail Loss Probe (TLP) detection in TCP, from Nandita
    Dukkipati.

    6) In the PHY layer, allow supporting wake-on-lan in situations where
    the PHY registers have to be written for it to be configured.

    Use it to support wake-on-lan in mv643xx_eth.

    From Michael Stapelberg.

    7) Significantly improve firewire IPV6 support, from YOSHIFUJI
    Hideaki.

    8) Allow multiple packets to be sent in a single transmission using
    network coding in batman-adv, from Martin Hundebøll.

    9) Add support for T5 cxgb4 chips, from Santosh Rastapur.

    10) Generalize the VXLAN forwarding tables so that there is more
    flexibility in configurating various aspects of the endpoints.
    From David Stevens.

    11) Support RSS and TSO in hardware over GRE tunnels in bxn2x driver,
    from Dmitry Kravkov.

    12) Zero copy support in nfnelink_queue, from Eric Dumazet and Pablo
    Neira Ayuso.

    13) Start adding networking selftests.

    14) In situations of overload on the same AF_PACKET fanout socket, or
    per-cpu packet receive queue, minimize drop by distributing the
    load to other cpus/fanouts. From Willem de Bruijn and Eric
    Dumazet.

    15) Add support for new payload offset BPF instruction, from Daniel
    Borkmann.

    16) Convert several drivers over to mdoule_platform_driver(), from
    Sachin Kamat.

    17) Provide a minimal BPF JIT image disassembler userspace tool, from
    Daniel Borkmann.

    18) Rewrite F-RTO implementation in TCP to match the final
    specification of it in RFC4138 and RFC5682. From Yuchung Cheng.

    19) Provide netlink socket diag of netlink sockets ("Yo dawg, I hear
    you like netlink, so I implemented netlink dumping of netlink
    sockets.") From Andrey Vagin.

    20) Remove ugly passing of rtnetlink attributes into rtnl_doit
    functions, from Thomas Graf.

    21) Allow userspace to be able to see if a configuration change occurs
    in the middle of an address or device list dump, from Nicolas
    Dichtel.

    22) Support RFC3168 ECN protection for ipv6 fragments, from Hannes
    Frederic Sowa.

    23) Increase accuracy of packet length used by packet scheduler, from
    Jason Wang.

    24) Beginning set of changes to make ipv4/ipv6 fragment handling more
    scalable and less susceptible to overload and locking contention,
    from Jesper Dangaard Brouer.

    25) Get rid of using non-type-safe NLMSG_* macros and use nlmsg_*()
    instead. From Hong Zhiguo.

    26) Optimize route usage in IPVS by avoiding reference counting where
    possible, from Julian Anastasov.

    27) Convert IPVS schedulers to RCU, also from Julian Anastasov.

    28) Support cpu fanouts in xt_NFQUEUE netfilter target, from Holger
    Eitzenberger.

    29) Network namespace support for nf_log, ebt_log, xt_LOG, ipt_ULOG,
    nfnetlink_log, and nfnetlink_queue. From Gao feng.

    30) Implement RFC3168 ECN protection, from Hannes Frederic Sowa.

    31) Support several new r8169 chips, from Hayes Wang.

    32) Support tokenized interface identifiers in ipv6, from Daniel
    Borkmann.

    33) Use usbnet_link_change() helper in USB net driver, from Ming Lei.

    34) Add 802.1ad vlan offload support, from Patrick McHardy.

    35) Support mmap() based netlink communication, also from Patrick
    McHardy.

    36) Support HW timestamping in mlx4 driver, from Amir Vadai.

    37) Rationalize AF_PACKET packet timestamping when transmitting, from
    Willem de Bruijn and Daniel Borkmann.

    38) Bring parity to what's provided by /proc/net/packet socket dumping
    and the info provided by netlink socket dumping of AF_PACKET
    sockets. From Nicolas Dichtel.

    39) Fix peeking beyond zero sized SKBs in AF_UNIX, from Benjamin
    Poirier"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1722 commits)
    filter: fix va_list build error
    af_unix: fix a fatal race with bit fields
    bnx2x: Prevent memory leak when cnic is absent
    bnx2x: correct reading of speed capabilities
    net: sctp: attribute printl with __printf for gcc fmt checks
    netlink: kconfig: move mmap i/o into netlink kconfig
    netpoll: convert mutex into a semaphore
    netlink: Fix skb ref counting.
    net_sched: act_ipt forward compat with xtables
    mlx4_en: fix a build error on 32bit arches
    Revert "bnx2x: allow nvram test to run when device is down"
    bridge: avoid OOPS if root port not found
    drivers: net: cpsw: fix kernel warn on cpsw irq enable
    sh_eth: use random MAC address if no valid one supplied
    3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA)
    tg3: fix to append hardware time stamping flags
    unix/stream: fix peeking with an offset larger than data in queue
    unix/dgram: fix peeking with an offset larger than data in queue
    unix/dgram: peek beyond 0-sized skbs
    openvswitch: Remove unneeded ovs_netdev_get_ifindex()
    ...

    Linus Torvalds
     

01 May, 2013

1 commit

  • Remove our (soon to be) bouncing email addresses,
    and update Dmitri's address.
    Dmitry will take over as maintainer for CAIF from now on.

    Cc: Vikram Arv
    Cc: Dmitry Tarnyagin
    Cc: Dmitry Tarnyagin
    Signed-off-by: Sjur Brændeland
    Signed-off-by: Rusty Russell
    Acked-by: Dmity Tarnyagin

    Sjur Brændeland
     

30 Apr, 2013

1 commit


25 Apr, 2013

1 commit


24 Apr, 2013

3 commits


02 Apr, 2013

1 commit


26 Mar, 2013

1 commit

  • After commit 6865ff222cca ("TTY: do not warn about setting
    speed via SPD_*"), we are seeing a build error when DEBUG_FS is
    enabled:
    drivers/net/caif/caif_serial.c: In function 'update_tty_status':
    drivers/net/caif/caif_serial.c:94:11: error: 'struct tty_struct' has no member named 'warned'

    Fix the error by removing the reference to the variable as it was
    not set in the last decade (as documented in the changelog of the
    commit above).

    Signed-off-by: Jiri Slaby
    Reported-by: Stephen Rothwell
    Cc: Sjur Braendeland
    Cc: netdev@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

24 Mar, 2013

2 commits


20 Mar, 2013

2 commits

  • We never add buffers with input and output parts, so use the new accessors.

    Cc: Sjur Brendeland
    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Add the CAIF Virtio shared memory driver for talking
    to a modem.

    This CAIF Link layer communicates to the modem over
    shared memory. It is implemented as a virtio_driver.
    The underlying virtio device is managed by the remoteproc
    framework. The Virtio queue is used for transmitting data
    to the modem, and the new vringh is used for receiving data.

    Genalloc is used for managing the shared memory used for TX
    data. The default dma-alloc-coherent allocator can only
    allocate whole pages, and this wastes too much shared memory.

    Flow control is implemented by stopping the TX-queues if the
    virtio queues go full or we run out of memory. Queued are
    reopened when queues are below the watermark.

    NAPI is used in RX path, and a dedicated tasklet is used
    for releasing TX buffers.

    Signed-off-by: Erwan Yvin
    Acked-by: David S. Miller
    Signed-off-by: Rusty Russell (minor fixes)

    Erwan Yvin
     

19 Mar, 2013

1 commit

  • tty->hw_stopped is set only by drivers to remember HW state. If it is
    never set to 1 in a particular driver, there is no need to check it in
    the driver at all. Remove such checks.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

18 Mar, 2013

1 commit

  • caif_shm is an old implementation
    caif_shm will be replaced by caif_virtio

    [ As explained by Linus Walleij: "U5500 used this, but was cancelled
    and the silicon did not reach anyone outside ST-Ericsson. Then for
    the next platforms, we have gone for the leaner & cleaner approach
    of using virtio, rpmesg and rproc." ]

    Signed-off-by: Erwan Yvin
    Acked-by: Linus Walleij
    Acked-by: Sjur Brendeland
    Signed-off-by: David S. Miller

    Erwan Yvin
     

10 Mar, 2013

1 commit

  • Emitting netdev_alloc_skb and netdev_alloc_skb_ip_align OOM
    messages is unnecessary as there is already a dump_stack
    after allocation failures.

    Other trivial changes around these removals:

    Convert a few comparisons of pointer to 0 to !pointer.
    Change flow to remove unnecessary label.
    Remove now unused variable.
    Hoist assignment from if.

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

    Joe Perches
     

22 Feb, 2013

1 commit

  • Pull tty/serial patches from Greg Kroah-Hartman:
    "Here's the big tty/serial driver patches for 3.9-rc1.

    More tty port rework and fixes from Jiri here, as well as lots of
    individual serial driver updates and fixes.

    All of these have been in the linux-next tree for a while."

    * tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits)
    tty: mxser: improve error handling in mxser_probe() and mxser_module_init()
    serial: imx: fix uninitialized variable warning
    serial: tegra: assume CONFIG_OF
    TTY: do not update atime/mtime on read/write
    lguest: select CONFIG_TTY to build properly.
    ARM defconfigs: add missing inclusions of linux/platform_device.h
    fb/exynos: include platform_device.h
    ARM: sa1100/assabet: include platform_device.h directly
    serial: imx: Fix recursive locking bug
    pps: Fix build breakage from decoupling pps from tty
    tty: Remove ancient hardpps()
    pps: Additional cleanups in uart_handle_dcd_change
    pps: Move timestamp read into PPS code proper
    pps: Don't crash the machine when exiting will do
    pps: Fix a use-after free bug when unregistering a source.
    pps: Use pps_lookup_dev to reduce ldisc coupling
    pps: Add pps_lookup_dev() function
    tty: serial: uartlite: Support uartlite on big and little endian systems
    tty: serial: uartlite: Fix sparse and checkpatch warnings
    serial/arc-uart: Miscll DT related updates (Grant's review comments)
    ...

    Fix up trivial conflicts, mostly just due to the TTY config option
    clashing with the EXPERIMENTAL removal.

    Linus Torvalds
     

05 Feb, 2013

1 commit


19 Jan, 2013

1 commit

  • The option allows you to remove TTY and compile without errors. This
    saves space on systems that won't support TTY interfaces anyway.
    bloat-o-meter output is below.

    The bulk of this patch consists of Kconfig changes adding "depends on
    TTY" to various serial devices and similar drivers that require the TTY
    layer. Ideally, these dependencies would occur on a common intermediate
    symbol such as SERIO, but most drivers "select SERIO" rather than
    "depends on SERIO", and "select" does not respect dependencies.

    bloat-o-meter output comparing our previous minimal to new minimal by
    removing TTY. The list is filtered to not show removed entries with awk
    '$3 != "-"' as the list was very long.

    add/remove: 0/226 grow/shrink: 2/14 up/down: 6/-35356 (-35350)
    function old new delta
    chr_dev_init 166 170 +4
    allow_signal 80 82 +2
    static.__warned 143 142 -1
    disallow_signal 63 62 -1
    __set_special_pids 95 94 -1
    unregister_console 126 121 -5
    start_kernel 546 541 -5
    register_console 593 588 -5
    copy_from_user 45 40 -5
    sys_setsid 128 120 -8
    sys_vhangup 32 19 -13
    do_exit 1543 1526 -17
    bitmap_zero 60 40 -20
    arch_local_irq_save 137 117 -20
    release_task 674 652 -22
    static.spin_unlock_irqrestore 308 260 -48

    Signed-off-by: Joe Millenbach
    Reviewed-by: Jamey Sharp
    Reviewed-by: Josh Triplett
    Signed-off-by: Greg Kroah-Hartman

    Joe Millenbach
     

16 Jan, 2013

1 commit

  • One point is to have less places where we actually need tty pointer.
    The other is that low_latency is bound to buffer processing and
    buffers are now in tty_port. So it makes sense to move low_latency to
    tty_port too.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

25 Jul, 2012

1 commit


29 Jun, 2012

2 commits

  • Fix the failing merge in net-next by reverting the last
    net-next merge for caif_hsi.c and then merge in the commit:
    "caif-hsi: Bugfix - Piggyback'ed embedded CAIF frame lost"
    from the net repository.

    The commit:"caif-hsi: Add missing return in error path" from
    net repository was dropped, as it changed code previously removed in the
    net-next repository.

    Signed-off-by: Sjur Brændeland
    Signed-off-by: David S. Miller

    Sjur Brændeland
     
  • Conflicts:
    drivers/net/caif/caif_hsi.c
    drivers/net/usb/qmi_wwan.c

    The qmi_wwan merge was trivial.

    The caif_hsi.c, on the other hand, was not. It's a conflict between
    1c385f1fdf6f9c66d982802cd74349c040980b50 ("caif-hsi: Replace platform
    device with ops structure.") in the net-next tree and commit
    39abbaef19cd0a30be93794aa4773c779c3eb1f3 ("caif-hsi: Postpone init of
    HIS until open()") in the net tree.

    I did my best with that one and will ask Sjur to check it out.

    Signed-off-by: David S. Miller

    David S. Miller