27 Feb, 2020

1 commit

  • According to RFC 7609, all CLC messages contain a peer ID that consists
    of a unique instance ID and the MAC address of one of the host's RoCE
    devices. But if a SMC-R connection cannot be established, e.g., because
    no matching pnet table entry is found, the current implementation uses a
    zero value in the CLC decline message although the host's peer ID is set
    to a proper value.

    If no RoCE and no ISM device is usable for a connection, there is no LGR
    and the LGR check in smc_clc_send_decline() prevents that the peer ID is
    copied into the CLC decline message for both SMC-D and SMC-R. So, this
    patch modifies the check to also accept the case of no LGR. Also, only a
    valid peer ID is copied into the decline message.

    Signed-off-by: Hans Wippel
    Signed-off-by: David S. Miller

    Hans Wippel
     

18 Feb, 2020

2 commits


14 Feb, 2020

1 commit


16 Nov, 2019

1 commit

  • A final cleanup due to SMCD device removal means immediate freeing
    of all link groups belonging to this device in interrupt context.

    This patch introduces a separate SMCD link group termination routine,
    which terminates all link groups of an SMCD device.

    This new routine smcd_terminate_all ()is reused if the smc module is
    unloaded.

    Signed-off-by: Ursula Braun
    Signed-off-by: Karsten Graul
    Signed-off-by: David S. Miller

    Ursula Braun
     

03 Jun, 2019

1 commit


13 Apr, 2019

1 commit

  • During initialization of an SMC socket a lot of function parameters need
    to get passed down the function call path. Consolidate the parameters
    in a helper struct so there are less enough parameters to get all passed
    by register.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     

02 Feb, 2019

1 commit


24 Nov, 2018

3 commits

  • After sending one of the initial LLC messages CONFIRM LINK or
    ADD LINK, there is already a wait for the LLC response. It does
    not make sense to wait another long time for a CLC DECLINE. Thus
    this patch introduces a shorter wait time for these cases.

    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     
  • If connection initialization fails for the LLC CONFIRM LINK or the
    LLC ADD LINK step, fallback to TCP should be enabled. Thus
    the negative return code -EAGAIN should switch to a positive timeout
    reason code in these cases, and the internal CLC socket should
    not have a set sk_err.

    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     
  • There is no need to store the return value in sk_err, if it is
    afterwards cleared again with sock_error(). This patch sets the
    return value directly. Just cleanup, no functional change.

    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     

24 Oct, 2018

1 commit

  • In the iov_iter struct, separate the iterator type from the iterator
    direction and use accessor functions to access them in most places.

    Convert a bunch of places to use switch-statements to access them rather
    then chains of bitwise-AND statements. This makes it easier to add further
    iterator types. Also, this can be more efficient as to implement a switch
    of small contiguous integers, the compiler can use ~50% fewer compare
    instructions than it has to use bitwise-and instructions.

    Further, cease passing the iterator type into the iterator setup function.
    The iterator function can set that itself. Only the direction is required.

    Signed-off-by: David Howells

    David Howells
     

19 Sep, 2018

1 commit

  • Comparing an int to a size, which is unsigned, causes the int to become
    unsigned, giving the wrong result. kernel_sendmsg can return a negative
    error code.

    Signed-off-by: YueHaibing
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    YueHaibing
     

26 Jul, 2018

2 commits

  • Remember the fallback reason code and the peer diagnosis code for
    smc sockets, and provide them in smc_diag.c to the netlink interface.
    And add more detailed reason codes.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • SMC code uses the base gid for VLAN traffic. The gids exchanged in
    the CLC handshake and the gid index used for the QP have to switch
    from the base gid to the appropriate vlan gid.

    When searching for a matching IB device port for a certain vlan
    device, it does not make sense to return an IB device port, which
    is not enabled for the used vlan_id. Add another check whether a
    vlan gid exists for a certain IB device port.

    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     

21 Jul, 2018

1 commit


19 Jul, 2018

1 commit

  • During clc handshake the receive timeout is set to CLC_WAIT_TIME.
    Remember and reset the original timeout value after the receive calls,
    and remove a duplicate assignment of CLC_WAIT_TIME.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     

30 Jun, 2018

1 commit

  • There are two types of SMC: SMC-R and SMC-D. These types are signaled
    within the CLC messages during the CLC handshake. This patch adds
    support for and checks of the SMC type.

    Also, SMC-R and SMC-D need to exchange different information during the
    CLC handshake. So, this patch extends the current message formats to
    support the SMC-D header fields. The Proposal message can contain both
    SMC-R and SMC-D information. The Accept and Confirm messages contain
    either SMC-R or SMC-D information.

    Signed-off-by: Hans Wippel
    Signed-off-by: Ursula Braun
    Suggested-by: Thomas Richter
    Signed-off-by: David S. Miller

    Hans Wippel
     

19 May, 2018

1 commit


16 May, 2018

1 commit


02 Apr, 2018

1 commit


27 Mar, 2018

1 commit

  • Not every CLC proposal message needs the maximum buffer length.
    Due to the MSG_WAITALL flag, it is important to use the peeked
    real length when receiving the message.

    Fixes: d63d271ce2b5ce ("smc: switch to sock_recvmsg()")
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     

17 Mar, 2018

2 commits

  • The CLC layer is updated to support ipv6 proposal messages from peers and
    to match incoming proposal messages against the ipv6 addresses of the net
    device. struct smc_clc_ipv6_prefix is updated to provide the space for an
    ipv6 address (struct was not used before). SMC_CLC_MAX_LEN is updated to
    include the size of the proposal prefix. Existing code in net is not
    affected, the previous SMC_CLC_MAX_LEN value is large enough to hold ipv4
    proposal messages.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     
  • Introduce functions smc_clc_prfx_set to retrieve IP information for the
    CLC proposal msg and smc_clc_prfx_match to match the contents of a
    proposal message against the IP addresses of the net device. The new
    functions replace the functionality provided by smc_clc_netinfo_by_tcpsk,
    which is removed by this patch. The match functionality is extended to
    scan all ipv4 addresses of the net device for a match against the
    ipv4 subnet from the proposal msg.

    Signed-off-by: Karsten Graul
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Karsten Graul
     

02 Mar, 2018

2 commits


01 Feb, 2018

1 commit

  • Pull networking updates from David Miller:

    1) Significantly shrink the core networking routing structures. Result
    of http://vger.kernel.org/~davem/seoul2017_netdev_keynote.pdf

    2) Add netdevsim driver for testing various offloads, from Jakub
    Kicinski.

    3) Support cross-chip FDB operations in DSA, from Vivien Didelot.

    4) Add a 2nd listener hash table for TCP, similar to what was done for
    UDP. From Martin KaFai Lau.

    5) Add eBPF based queue selection to tun, from Jason Wang.

    6) Lockless qdisc support, from John Fastabend.

    7) SCTP stream interleave support, from Xin Long.

    8) Smoother TCP receive autotuning, from Eric Dumazet.

    9) Lots of erspan tunneling enhancements, from William Tu.

    10) Add true function call support to BPF, from Alexei Starovoitov.

    11) Add explicit support for GRO HW offloading, from Michael Chan.

    12) Support extack generation in more netlink subsystems. From Alexander
    Aring, Quentin Monnet, and Jakub Kicinski.

    13) Add 1000BaseX, flow control, and EEE support to mvneta driver. From
    Russell King.

    14) Add flow table abstraction to netfilter, from Pablo Neira Ayuso.

    15) Many improvements and simplifications to the NFP driver bpf JIT,
    from Jakub Kicinski.

    16) Support for ipv6 non-equal cost multipath routing, from Ido
    Schimmel.

    17) Add resource abstration to devlink, from Arkadi Sharshevsky.

    18) Packet scheduler classifier shared filter block support, from Jiri
    Pirko.

    19) Avoid locking in act_csum, from Davide Caratti.

    20) devinet_ioctl() simplifications from Al viro.

    21) More TCP bpf improvements from Lawrence Brakmo.

    22) Add support for onlink ipv6 route flag, similar to ipv4, from David
    Ahern.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1925 commits)
    tls: Add support for encryption using async offload accelerator
    ip6mr: fix stale iterator
    net/sched: kconfig: Remove blank help texts
    openvswitch: meter: Use 64-bit arithmetic instead of 32-bit
    tcp_nv: fix potential integer overflow in tcpnv_acked
    r8169: fix RTL8168EP take too long to complete driver initialization.
    qmi_wwan: Add support for Quectel EP06
    rtnetlink: enable IFLA_IF_NETNSID for RTM_NEWLINK
    ipmr: Fix ptrdiff_t print formatting
    ibmvnic: Wait for device response when changing MAC
    qlcnic: fix deadlock bug
    tcp: release sk_frag.page in tcp_disconnect
    ipv4: Get the address of interface correctly.
    net_sched: gen_estimator: fix lockdep splat
    net: macb: Handle HRESP error
    net/mlx5e: IPoIB, Fix copy-paste bug in flow steering refactoring
    ipv6: addrconf: break critical section in addrconf_verify_rtnl()
    ipv6: change route cache aging logic
    i40e/i40evf: Update DESC_NEEDED value to reflect larger value
    bnxt_en: cleanup DIM work on device shutdown
    ...

    Linus Torvalds
     

08 Dec, 2017

2 commits

  • According to RFC7609 [1] the CLC proposal message contains an area of
    unknown length for future growth. Additionally it may contain up to
    8 IPv6 prefixes. The current version of the SMC-code does not
    understand CLC proposal messages using these variable length fields and,
    thus, is incompatible with SMC implementations in other operating
    systems.

    This patch makes sure, SMC understands incoming CLC proposals
    * with arbitrary length values for future growth
    * with up to 8 IPv6 prefixes

    [1] SMC-R Informational RFC: http://www.rfc-editor.org/info/rfc7609

    Signed-off-by: Ursula Braun
    Reviewed-by: Hans Wippel
    Signed-off-by: David S. Miller

    Ursula Braun
     
  • Let smc_clc_send_decline() return with an error, if the amount
    sent is smaller than the length of an smc decline message.

    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     

03 Dec, 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
     

22 Sep, 2017

1 commit

  • An out-of-sync condition can just be detected by the client.
    If the server receives a CLC DECLINE message indicating an out-of-sync
    condition for the link groups, the server must clean up the out-of-sync
    link group.
    There is no need for an extra third parameter in smc_clc_send_decline().

    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     

30 Jul, 2017

2 commits

  • SMC currently uses the unsafe_global_rkey of the protection domain,
    which exposes all memory for remote reads and writes once a connection
    is established. This patch introduces separate memory regions with
    separate rkeys for every RMB. Now the unsafe_global_rkey of the
    protection domain is no longer needed.

    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     
  • The follow-on patch makes use of ib_map_mr_sg() when introducing
    separate memory regions for RMBs. This function is based on
    scatterlists; thus this patch introduces scatterlists for RMBs.

    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     

17 May, 2017

1 commit

  • Currently, SMC enables remote access to physical memory when a user
    has successfully configured and established an SMC-connection until ten
    minutes after the last SMC connection is closed. Because this is considered
    a security risk, drivers are supposed to use IB_PD_UNSAFE_GLOBAL_RKEY in
    such a case.

    This patch changes the current SMC code to use IB_PD_UNSAFE_GLOBAL_RKEY.
    This improves user awareness, but does not remove the security risk itself.

    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Ursula Braun
     

03 Mar, 2017

1 commit

  • …sors into <linux/sched/signal.h>

    task_struct::signal and task_struct::sighand are pointers, which would normally make it
    straightforward to not define those types in sched.h.

    That is not so, because the types are accompanied by a myriad of APIs (macros and inline
    functions) that dereference them.

    Split the types and the APIs out of sched.h and move them into a new header, <linux/sched/signal.h>.

    With this change sched.h does not know about 'struct signal' and 'struct sighand' anymore,
    trying to put accessors into sched.h as a test fails the following way:

    ./include/linux/sched.h: In function ‘test_signal_types’:
    ./include/linux/sched.h:2461:18: error: dereferencing pointer to incomplete type ‘struct signal_struct’
    ^

    This reduces the size and complexity of sched.h significantly.

    Update all headers and .c code that relied on getting the signal handling
    functionality from <linux/sched.h> to include <linux/sched/signal.h>.

    The list of affected files in the preparatory patch was partly generated by
    grepping for the APIs, and partly by doing coverage build testing, both
    all[yes|mod|def|no]config builds on 64-bit and 32-bit x86, and an array of
    cross-architecture builds.

    Nevertheless some (trivial) build breakage is still expected related to rare
    Kconfig combinations and in-flight patches to various kernel code, but most
    of it should be handled by this patch.

    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

12 Jan, 2017

1 commit

  • When creating an SMC connection, there is a CLC (connection layer control)
    handshake to prepare for RDMA traffic. The corresponding code is part of
    commit 0cfdd8f92cac ("smc: connection and link group creation").
    Mac addresses to be exchanged in the handshake are copied with a wrong
    length of 12 instead of 6 bytes. Following code overwrites the wrongly
    copied code, but nevertheless the correct length should already be used for
    the preceding mac address copying. Use ETH_ALEN for the memcpy length with
    mac addresses.

    Signed-off-by: Ursula Braun
    Fixes: 0cfdd8f92cac ("smc: connection and link group creation")
    Reported-by: Dan Carpenter
    Signed-off-by: David S. Miller

    Ursula Braun
     

10 Jan, 2017

3 commits