05 Jul, 2018

2 commits


29 Jun, 2018

1 commit

  • The poll() changes were not well thought out, and completely
    unexplained. They also caused a huge performance regression, because
    "->poll()" was no longer a trivial file operation that just called down
    to the underlying file operations, but instead did at least two indirect
    calls.

    Indirect calls are sadly slow now with the Spectre mitigation, but the
    performance problem could at least be largely mitigated by changing the
    "->get_poll_head()" operation to just have a per-file-descriptor pointer
    to the poll head instead. That gets rid of one of the new indirections.

    But that doesn't fix the new complexity that is completely unwarranted
    for the regular case. The (undocumented) reason for the poll() changes
    was some alleged AIO poll race fixing, but we don't make the common case
    slower and more complex for some uncommon special case, so this all
    really needs way more explanations and most likely a fundamental
    redesign.

    [ This revert is a revert of about 30 different commits, not reverted
    individually because that would just be unnecessarily messy - Linus ]

    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

07 Jun, 2018

1 commit

  • Pull networking updates from David Miller:

    1) Add Maglev hashing scheduler to IPVS, from Inju Song.

    2) Lots of new TC subsystem tests from Roman Mashak.

    3) Add TCP zero copy receive and fix delayed acks and autotuning with
    SO_RCVLOWAT, from Eric Dumazet.

    4) Add XDP_REDIRECT support to mlx5 driver, from Jesper Dangaard
    Brouer.

    5) Add ttl inherit support to vxlan, from Hangbin Liu.

    6) Properly separate ipv6 routes into their logically independant
    components. fib6_info for the routing table, and fib6_nh for sets of
    nexthops, which thus can be shared. From David Ahern.

    7) Add bpf_xdp_adjust_tail helper, which can be used to generate ICMP
    messages from XDP programs. From Nikita V. Shirokov.

    8) Lots of long overdue cleanups to the r8169 driver, from Heiner
    Kallweit.

    9) Add BTF ("BPF Type Format"), from Martin KaFai Lau.

    10) Add traffic condition monitoring to iwlwifi, from Luca Coelho.

    11) Plumb extack down into fib_rules, from Roopa Prabhu.

    12) Add Flower classifier offload support to igb, from Vinicius Costa
    Gomes.

    13) Add UDP GSO support, from Willem de Bruijn.

    14) Add documentation for eBPF helpers, from Quentin Monnet.

    15) Add TLS tx offload to mlx5, from Ilya Lesokhin.

    16) Allow applications to be given the number of bytes available to read
    on a socket via a control message returned from recvmsg(), from
    Soheil Hassas Yeganeh.

    17) Add x86_32 eBPF JIT compiler, from Wang YanQing.

    18) Add AF_XDP sockets, with zerocopy support infrastructure as well.
    From Björn Töpel.

    19) Remove indirect load support from all of the BPF JITs and handle
    these operations in the verifier by translating them into native BPF
    instead. From Daniel Borkmann.

    20) Add GRO support to ipv6 gre tunnels, from Eran Ben Elisha.

    21) Allow XDP programs to do lookups in the main kernel routing tables
    for forwarding. From David Ahern.

    22) Allow drivers to store hardware state into an ELF section of kernel
    dump vmcore files, and use it in cxgb4. From Rahul Lakkireddy.

    23) Various RACK and loss detection improvements in TCP, from Yuchung
    Cheng.

    24) Add TCP SACK compression, from Eric Dumazet.

    25) Add User Mode Helper support and basic bpfilter infrastructure, from
    Alexei Starovoitov.

    26) Support ports and protocol values in RTM_GETROUTE, from Roopa
    Prabhu.

    27) Support bulking in ->ndo_xdp_xmit() API, from Jesper Dangaard
    Brouer.

    28) Add lots of forwarding selftests, from Petr Machata.

    29) Add generic network device failover driver, from Sridhar Samudrala.

    * ra.kernel.org:/pub/scm/linux/kernel/git/davem/net-next: (1959 commits)
    strparser: Add __strp_unpause and use it in ktls.
    rxrpc: Fix terminal retransmission connection ID to include the channel
    net: hns3: Optimize PF CMDQ interrupt switching process
    net: hns3: Fix for VF mailbox receiving unknown message
    net: hns3: Fix for VF mailbox cannot receiving PF response
    bnx2x: use the right constant
    Revert "net: sched: cls: Fix offloading when ingress dev is vxlan"
    net: dsa: b53: Fix for brcm tag issue in Cygnus SoC
    enic: fix UDP rss bits
    netdev-FAQ: clarify DaveM's position for stable backports
    rtnetlink: validate attributes in do_setlink()
    mlxsw: Add extack messages for port_{un, }split failures
    netdevsim: Add extack error message for devlink reload
    devlink: Add extack to reload and port_{un, }split operations
    net: metrics: add proper netlink validation
    ipmr: fix error path when ipmr_new_table fails
    ip6mr: only set ip6mr_table from setsockopt when ip6mr_new_table succeeds
    net: hns3: remove unused hclgevf_cfg_func_mta_filter
    netfilter: provide udp*_lib_lookup for nf_tproxy
    qed*: Utilize FW 8.37.2.0
    ...

    Linus Torvalds
     

26 May, 2018

1 commit


28 Apr, 2018

1 commit

  • This implements a misc character device named "qrtr-tun" for the purpose
    of allowing user space applications to implement endpoints in the qrtr
    network.

    This allows more advanced (and dynamic) testing of the qrtr code as well
    as opens up the ability of tunneling qrtr over a network or USB link.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     

17 Apr, 2018

1 commit


06 Mar, 2018

1 commit


27 Feb, 2018

1 commit


13 Feb, 2018

1 commit

  • Changes since v1:
    Added changes in these files:
    drivers/infiniband/hw/usnic/usnic_transport.c
    drivers/staging/lustre/lnet/lnet/lib-socket.c
    drivers/target/iscsi/iscsi_target_login.c
    drivers/vhost/net.c
    fs/dlm/lowcomms.c
    fs/ocfs2/cluster/tcp.c
    security/tomoyo/network.c

    Before:
    All these functions either return a negative error indicator,
    or store length of sockaddr into "int *socklen" parameter
    and return zero on success.

    "int *socklen" parameter is awkward. For example, if caller does not
    care, it still needs to provide on-stack storage for the value
    it does not need.

    None of the many FOO_getname() functions of various protocols
    ever used old value of *socklen. They always just overwrite it.

    This change drops this parameter, and makes all these functions, on success,
    return length of sockaddr. It's always >= 0 and can be differentiated
    from an error.

    Tests in callers are changed from "if (err)" to "if (err < 0)", where needed.

    rpc_sockname() lost "int buflen" parameter, since its only use was
    to be passed to kernel_getsockname() as &buflen and subsequently
    not used in any way.

    Userspace API is not changed.

    text data bss dec hex filename
    30108430 2633624 873672 33615726 200ef6e vmlinux.before.o
    30108109 2633612 873672 33615393 200ee21 vmlinux.o

    Signed-off-by: Denys Vlasenko
    CC: David S. Miller
    CC: linux-kernel@vger.kernel.org
    CC: netdev@vger.kernel.org
    CC: linux-bluetooth@vger.kernel.org
    CC: linux-decnet-user@lists.sourceforge.net
    CC: linux-wireless@vger.kernel.org
    CC: linux-rdma@vger.kernel.org
    CC: linux-sctp@vger.kernel.org
    CC: linux-nfs@vger.kernel.org
    CC: linux-x25@vger.kernel.org
    Signed-off-by: David S. Miller

    Denys Vlasenko
     

05 Dec, 2017

1 commit


10 Nov, 2017

1 commit


08 Nov, 2017

1 commit

  • Registering qrtr with module_init makes the ability of typical platform
    code to create AF_QIPCRTR socket during probe a matter of link order
    luck. Moving qrtr to postcore_initcall() avoids this.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     

04 Nov, 2017

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
     

12 Oct, 2017

7 commits

  • Add the necessary logic for decoding incoming messages of version 2 as
    well. Also make sure there's room for the bigger of version 1 and 2
    headers in the code allocating skbs for outgoing messages.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     
  • Rather than parsing the header of incoming messages throughout the
    implementation do it once when we retrieve the message and store the
    relevant information in the "cb" member of the sk_buff.

    This allows us to, in a later commit, decode version 2 messages into
    this same structure.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     
  • As the message header generation is deferred the internal functions for
    generating control packets can be simplified.

    This patch modifies qrtr_alloc_ctrl_packet() to, in addition to the
    sk_buff, return a reference to a struct qrtr_ctrl_pkt, which clarifies
    and simplifies the helpers to the point that these functions can be
    folded back into the callers.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     
  • Defer writing the message header to the skb until its time to enqueue
    the packet. As the receive path is reworked to decode the message header
    as it's received from the transport and only pass around the payload in
    the skb this change means that we do not have to fill out the full
    message header just to decode it immediately in qrtr_local_enqueue().

    In the future this change also makes it possible to prepend message
    headers based on the version of each link.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     
  • The QMUX protocol specification defines structure of the special control
    packet messages being sent between handlers of the control port.

    Add these to the uapi header, as this structure and the associated types
    are shared between the kernel and all userspace handlers of control
    messages.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     
  • The constants are used by both the name server and clients, so clarify
    their value and move them to the uapi header.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     
  • Rather than manually waking up any context sleeping on the sock to
    signal an error we should call sk_error_report(). This has the added
    benefit that in-kernel consumers can override this notification with
    its own callback.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     

10 Aug, 2017

1 commit

  • This change allows us to later indicate to rtnetlink core that certain
    doit functions should be called without acquiring rtnl_mutex.

    This change should have no effect, we simply replace the last (now
    unused) calcit argument with the new flag.

    Signed-off-by: Florian Westphal
    Reviewed-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Florian Westphal
     

16 Jun, 2017

3 commits

  • It seems like a historic accident that these return unsigned char *,
    and in many places that means casts are required, more often than not.

    Make these functions (skb_put, __skb_put and pskb_put) return void *
    and remove all the casts across the tree, adding a (u8 *) cast only
    where the unsigned char pointer was used directly, all done with the
    following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_put, __skb_put };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_put, __skb_put };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    which actually doesn't cover pskb_put since there are only three
    users overall.

    A handful of stragglers were converted manually, notably a macro in
    drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
    instances in net/bluetooth/hci_sock.c. In the former file, I also
    had to fix one whitespace problem spatch introduced.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • A common pattern with skb_put() is to just want to memcpy()
    some data into the new space, introduce skb_put_data() for
    this.

    An spatch similar to the one for skb_put_zero() converts many
    of the places using it:

    @@
    identifier p, p2;
    expression len, skb, data;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, len);
    |
    -memcpy(p, data, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb, data;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, sizeof(*p));
    |
    -memcpy(p, data, sizeof(*p));
    )

    @@
    expression skb, len, data;
    @@
    -memcpy(skb_put(skb, len), data, len);
    +skb_put_data(skb, data, len);

    (again, manually post-processed to retain some comments)

    Reviewed-by: Stephen Hemminger
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • There were many places that my previous spatch didn't find,
    as pointed out by yuan linyu in various patches.

    The following spatch found many more and also removes the
    now unnecessary casts:

    @@
    identifier p, p2;
    expression len;
    expression skb;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_zero(skb, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_zero(skb, len);
    )
    ... when != p
    (
    p2 = (t2)p;
    -memset(p2, 0, len);
    |
    -memset(p, 0, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_zero(skb, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_zero(skb, sizeof(t));
    )
    ... when != p
    (
    p2 = (t2)p;
    -memset(p2, 0, sizeof(*p));
    |
    -memset(p, 0, sizeof(*p));
    )

    @@
    expression skb, len;
    @@
    -memset(skb_put(skb, len), 0, len);
    +skb_put_zero(skb, len);

    Apply it to the tree (with one manual fixup to keep the
    comment in vxlan.c, which spatch removed.)

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

08 Jun, 2017

4 commits

  • As the higher level communication only deals with "services" the
    a service directory is required to keep track of local and remote
    services. In order for qrtr clients to be informed about when the
    service directory implementation is available some event needs to be
    passed to them.

    Rather than introducing support for broadcasting such a message in-band
    to all open local sockets we flag each socket with ENETRESET, as there
    are no other expected operations that would benefit from having support
    from locally broadcasting messages.

    Cc: Courtney Cavin
    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     
  • Per the QMUXv2 protocol specificiation a DEL_CLIENT message should be
    broadcasted when an endpoint is disconnected.

    The protocol specification does suggest that the router can keep track
    of which nodes the endpoint has been communicating with to not wake up
    sleeping remotes unecessarily, but implementation of this suggestion is
    left for the future.

    Cc: Courtney Cavin
    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     
  • Per the QMUX protocol specification a terminating node can send a BYE
    control message to signal that the link is going down, upon receiving
    this all information about remote services should be discarded and local
    clients should be notified.

    In the event that the link was brought down abruptly the router is
    supposed to act like a BYE message has arrived. As there is no harm in
    receiving an extra BYE from the remote this patch implements the latter
    by injecting a BYE when the link to the remote is unregistered.

    The name service will receive the BYE and can implement the notification
    to the local clients.

    Cc: Courtney Cavin
    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     
  • Extract the allocation and filling in the control message header fields
    to a separate function in order to reuse this in subsequent patches.

    Cc: Courtney Cavin
    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     

22 Apr, 2017

2 commits


18 Apr, 2017

1 commit

  • Add netlink_ext_ack arg to rtnl_doit_func. Pass extack arg to nlmsg_parse
    for doit functions that call it directly.

    This is the first step to using extended error reporting in rtnetlink.
    >From here individual subsystems can be updated to set netlink_ext_ack as
    needed.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     

14 Apr, 2017

1 commit


29 Mar, 2017

1 commit

  • By moving these client drivers to use RPMSG instead of the direct SMD
    API we can reuse them ontop of the newly added GLINK wire-protocol
    support found in the 820 and 835 Qualcomm platforms.

    As the new (RPMSG-based) and old SMD implementations are mutually
    exclusive we have to change all client drivers in one commit, to make
    sure we have a working system before and after this transition.

    Acked-by: Andy Gross
    Acked-by: Kalle Valo
    Acked-by: Marcel Holtmann
    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     

11 Jan, 2017

1 commit

  • Failure to mark this pointer as __le32 causes checkers like
    sparse to complain:

    net/qrtr/qrtr.c:274:16: warning: incorrect type in assignment (different base types)
    net/qrtr/qrtr.c:274:16: expected unsigned int [unsigned] [usertype]
    net/qrtr/qrtr.c:274:16: got restricted __le32 [usertype]
    net/qrtr/qrtr.c:275:16: warning: incorrect type in assignment (different base types)
    net/qrtr/qrtr.c:275:16: expected unsigned int [unsigned] [usertype]
    net/qrtr/qrtr.c:275:16: got restricted __le32 [usertype]
    net/qrtr/qrtr.c:276:16: warning: incorrect type in assignment (different base types)
    net/qrtr/qrtr.c:276:16: expected unsigned int [unsigned] [usertype]
    net/qrtr/qrtr.c:276:16: got restricted __le32 [usertype]

    Silence it.

    Cc: Bjorn Andersson
    Signed-off-by: Stephen Boyd
    Acked-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Stephen Boyd
     

18 May, 2016

1 commit


17 May, 2016

1 commit

  • Having multiple loadable modules with the same name cannot work
    with modprobe, and having both net/qrtr/smd.ko and drivers/soc/qcom/smd.ko
    results in a (somewhat cryptic) build error:

    ERROR: "qcom_smd_driver_unregister" [net/qrtr/smd.ko] undefined!
    ERROR: "qcom_smd_driver_register" [net/qrtr/smd.ko] undefined!
    ERROR: "qcom_smd_set_drvdata" [net/qrtr/smd.ko] undefined!
    ERROR: "qcom_smd_send" [net/qrtr/smd.ko] undefined!
    ERROR: "qcom_smd_get_drvdata" [net/qrtr/smd.ko] undefined!
    ERROR: "qcom_smd_driver_unregister" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
    ERROR: "qcom_smd_driver_register" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
    ERROR: "qcom_smd_set_drvdata" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
    ERROR: "qcom_smd_send" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
    ERROR: "qcom_smd_get_drvdata" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!

    Also, the qrtr driver uses the SMD interface and has a Kconfig dependency,
    but also allows for compile-testing when SMD is disabled. However, if
    with QCOM_SMD=m and COMPILE_TEST=y we can end up with QRTR_SMD=y and
    that fails with a related link error.

    The changes the dependency so we can still compile-test the driver but
    not have it built-in if SMD is a module, to avoid running in the broken
    configuration, and changes the Makefile to provide the driver under
    a different module name.

    Signed-off-by: Arnd Bergmann
    Fixes: bdabad3e363d ("net: Add Qualcomm IPC router")
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

14 May, 2016

1 commit


09 May, 2016

1 commit

  • Add an implementation of Qualcomm's IPC router protocol, used to
    communicate with service providing remote processors.

    Signed-off-by: Courtney Cavin
    Signed-off-by: Bjorn Andersson
    [bjorn: Cope with 0 being a valid node id and implement RTM_NEWADDR]
    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Courtney Cavin