18 Oct, 2020

1 commit

  • Pull rdma updates from Jason Gunthorpe:
    "A usual cycle for RDMA with a typical mix of driver and core subsystem
    updates:

    - Driver minor changes and bug fixes for mlx5, efa, rxe, vmw_pvrdma,
    hns, usnic, qib, qedr, cxgb4, hns, bnxt_re

    - Various rtrs fixes and updates

    - Bug fix for mlx4 CM emulation for virtualization scenarios where
    MRA wasn't working right

    - Use tracepoints instead of pr_debug in the CM code

    - Scrub the locking in ucma and cma to close more syzkaller bugs

    - Use tasklet_setup in the subsystem

    - Revert the idea that 'destroy' operations are not allowed to fail
    at the driver level. This proved unworkable from a HW perspective.

    - Revise how the umem API works so drivers make fewer mistakes using
    it

    - XRC support for qedr

    - Convert uverbs objects RWQ and MW to new the allocation scheme

    - Large queue entry sizes for hns

    - Use hmm_range_fault() for mlx5 On Demand Paging

    - uverbs APIs to inspect the GID table instead of sysfs

    - Move some of the RDMA code for building large page SGLs into
    lib/scatterlist"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (191 commits)
    RDMA/ucma: Fix use after free in destroy id flow
    RDMA/rxe: Handle skb_clone() failure in rxe_recv.c
    RDMA/rxe: Move the definitions for rxe_av.network_type to uAPI
    RDMA: Explicitly pass in the dma_device to ib_register_device
    lib/scatterlist: Do not limit max_segment to PAGE_ALIGNED values
    IB/mlx4: Convert rej_tmout radix-tree to XArray
    RDMA/rxe: Fix bug rejecting all multicast packets
    RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()
    RDMA/rxe: Remove duplicate entries in struct rxe_mr
    IB/hfi,rdmavt,qib,opa_vnic: Update MAINTAINERS
    IB/rdmavt: Fix sizeof mismatch
    MAINTAINERS: CISCO VIC LOW LATENCY NIC DRIVER
    RDMA/bnxt_re: Fix sizeof mismatch for allocation of pbl_tbl.
    RDMA/bnxt_re: Use rdma_umem_for_each_dma_block()
    RDMA/umem: Move to allocate SG table from pages
    lib/scatterlist: Add support in dynamic allocation of SG table from pages
    tools/testing/scatterlist: Show errors in human readable form
    tools/testing/scatterlist: Rejuvenate bit-rotten test
    RDMA/ipoib: Set rtnl_link_ops for ipoib interfaces
    RDMA/uverbs: Expose the new GID query API to user space
    ...

    Linus Torvalds
     

14 Oct, 2020

3 commits

  • for_each_memblock() is used to iterate over memblock.memory in a few
    places that use data from memblock_region rather than the memory ranges.

    Introduce separate for_each_mem_region() and
    for_each_reserved_mem_region() to improve encapsulation of memblock
    internals from its users.

    Signed-off-by: Mike Rapoport
    Signed-off-by: Andrew Morton
    Reviewed-by: Baoquan He
    Acked-by: Ingo Molnar [x86]
    Acked-by: Thomas Bogendoerfer [MIPS]
    Acked-by: Miguel Ojeda [.clang-format]
    Cc: Andy Lutomirski
    Cc: Benjamin Herrenschmidt
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Christoph Hellwig
    Cc: Daniel Axtens
    Cc: Dave Hansen
    Cc: Emil Renner Berthing
    Cc: Hari Bathini
    Cc: Ingo Molnar
    Cc: Jonathan Cameron
    Cc: Marek Szyprowski
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Mackerras
    Cc: Paul Walmsley
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Link: https://lkml.kernel.org/r/20200818151634.14343-18-rppt@kernel.org
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Iteration over memblock.reserved with for_each_reserved_mem_region() used
    __next_reserved_mem_region() that implemented a subset of
    __next_mem_region().

    Use __for_each_mem_range() and, essentially, __next_mem_region() with
    appropriate parameters to reduce code duplication.

    While on it, rename for_each_reserved_mem_region() to
    for_each_reserved_mem_range() for consistency.

    Signed-off-by: Mike Rapoport
    Signed-off-by: Andrew Morton
    Acked-by: Miguel Ojeda [.clang-format]
    Cc: Andy Lutomirski
    Cc: Baoquan He
    Cc: Benjamin Herrenschmidt
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Christoph Hellwig
    Cc: Daniel Axtens
    Cc: Dave Hansen
    Cc: Emil Renner Berthing
    Cc: Hari Bathini
    Cc: Ingo Molnar
    Cc: Ingo Molnar
    Cc: Jonathan Cameron
    Cc: Marek Szyprowski
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Mackerras
    Cc: Paul Walmsley
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Thomas Bogendoerfer
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Link: https://lkml.kernel.org/r/20200818151634.14343-17-rppt@kernel.org
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Currently for_each_mem_range() and for_each_mem_range_rev() iterators are
    the most generic way to traverse memblock regions. As such, they have 8
    parameters and they are hardly convenient to users. Most users choose to
    utilize one of their wrappers and the only user that actually needs most
    of the parameters is memblock itself.

    To avoid yet another naming for memblock iterators, rename the existing
    for_each_mem_range[_rev]() to __for_each_mem_range[_rev]() and add a new
    for_each_mem_range[_rev]() wrappers with only index, start and end
    parameters.

    The new wrapper nicely fits into init_unavailable_mem() and will be used
    in upcoming changes to simplify memblock traversals.

    Signed-off-by: Mike Rapoport
    Signed-off-by: Andrew Morton
    Acked-by: Thomas Bogendoerfer [MIPS]
    Cc: Andy Lutomirski
    Cc: Baoquan He
    Cc: Benjamin Herrenschmidt
    Cc: Borislav Petkov
    Cc: Catalin Marinas
    Cc: Christoph Hellwig
    Cc: Daniel Axtens
    Cc: Dave Hansen
    Cc: Emil Renner Berthing
    Cc: Hari Bathini
    Cc: Ingo Molnar
    Cc: Ingo Molnar
    Cc: Jonathan Cameron
    Cc: Marek Szyprowski
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Miguel Ojeda
    Cc: Palmer Dabbelt
    Cc: Paul Mackerras
    Cc: Paul Walmsley
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Link: https://lkml.kernel.org/r/20200818151634.14343-11-rppt@kernel.org
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

18 Sep, 2020

1 commit

  • Leon Romanovsky says:

    ====================
    IBTA declares speed as 16 bits, but kernel stores it in u8. This series
    fixes in-kernel declaration while keeping external interface intact.
    ====================

    Based on the mlx5-next branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
    due to dependencies.

    * branch 'mlx5_active_speed':
    RDMA: Fix link active_speed size
    RDMA/mlx5: Delete duplicated mlx5_ptys_width enum
    net/mlx5: Refactor query port speed functions

    Jason Gunthorpe
     

10 Sep, 2020

1 commit


01 Sep, 2020

1 commit


25 May, 2020

1 commit

  • An upcoming Btrfs fix needs to know the original size of a non-cloned
    bios. Rather than accessing the bvec table directly, let's add a
    bio_for_each_bvec_all() accessor.

    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Omar Sandoval
    Signed-off-by: David Sterba

    Omar Sandoval
     

18 Apr, 2020

2 commits


07 Mar, 2020

1 commit


31 Aug, 2019

1 commit


18 Apr, 2019

1 commit


12 Apr, 2019

1 commit


22 Mar, 2019

1 commit

  • The pattern set by list.h is that for_each..continue()
    iterators start at the next entry after the given one,
    while for_each..from() iterators start at the given
    entry.

    The rht_for_each*continue() iterators are documented as though the
    start at the 'next' entry, but actually start at the given entry,
    and they are used expecting that behaviour.
    So fix the documentation and change the names to *from for consistency
    with list.h

    Acked-by: Herbert Xu
    Acked-by: Miguel Ojeda
    Signed-off-by: NeilBrown
    Signed-off-by: David S. Miller

    NeilBrown
     

13 Mar, 2019

1 commit


20 Feb, 2019

1 commit


12 Feb, 2019

1 commit

  • Commit 2db76d7c3c6d ("lib/scatterlist: sg_page_iter: support sg lists w/o
    backing pages") introduced the sg_page_iter_dma_address() function without
    providing a way to use it in the general case. If the sg_dma_len() is not
    equal to the sg length callers cannot safely use the
    for_each_sg_page/sg_page_iter_dma_address combination.

    Resolve this API mistake by providing a DMA specific iterator,
    for_each_sg_dma_page(), that uses the right length so
    sg_page_iter_dma_address() works as expected with all sglists.

    A new iterator type is introduced to provide compile-time safety against
    wrongly mixing accessors and iterators.

    Acked-by: Christoph Hellwig (for scatterlist)
    Acked-by: Thomas Hellstrom
    Acked-by: Sakari Ailus (ipu3-cio2)
    Signed-off-by: Jason Gunthorpe

    Jason Gunthorpe
     

04 Feb, 2019

1 commit


20 Jan, 2019

1 commit


21 Oct, 2018

1 commit

  • There's no direct replacement for radix_tree_for_each_contig()
    in the XArray API as it's an unusual thing to do. Instead,
    open-code a loop using xas_next(). This removes the only user of
    radix_tree_for_each_contig() so delete the iterator from the API and
    the test suite code for it.

    Signed-off-by: Matthew Wilcox

    Matthew Wilcox
     

02 Aug, 2018

1 commit

  • The true option causes this indenting for functions:

    static struct something_very_very_long *
    function(void *arg)
    {

    While a quick survey suggests that the usual Linux fallback is the GNU
    style:

    static struct something_very_very_long *
    function(void *arg)
    {

    Eg as seen in:

    kernel/cpu.c
    kernel/fork.c
    etc

    Acked-by: Joe Perches
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Miguel Ojeda

    Jason Gunthorpe
     

12 Apr, 2018

1 commit

  • clang-format is a tool to format C/C++/... code according to a set of
    rules and heuristics. Like most tools, it is not perfect nor covers
    every single case, but it is good enough to be helpful.

    In particular, it is useful for quickly re-formatting blocks of code
    automatically, for reviewing full files in order to spot coding style
    mistakes, typos and possible improvements. It is also handy for sorting
    ``#includes``, for aligning variables and macros, for reflowing text and
    other similar tasks. It also serves as a teaching tool/guide for
    newcomers.

    The tool itself has been already included in the repositories of popular
    Linux distributions for a long time. The rules in this file are
    intended for clang-format >= 4, which is easily available in most
    distributions.

    This commit adds the configuration file that contains the rules that the
    tool uses to know how to format the code according to the kernel coding
    style. This gives us several advantages:

    * clang-format works out of the box with reasonable defaults;
    avoiding that everyone has to re-do the configuration.

    * Everyone agrees (eventually) on what is the most useful default
    configuration for most of the kernel.

    * If it becomes commonplace among kernel developers, clang-format
    may feel compelled to support us better. They already recognize
    the Linux kernel and its style in their documentation and in one
    of the style sub-options.

    Some of clang-format's features relevant for the kernel are:

    * Uses clang's tooling support behind the scenes to parse and rewrite
    the code. It is not based on ad-hoc regexps.

    * Supports reasonably well the Linux kernel coding style.

    * Fast enough to be used at the press of a key.

    * There are already integrations (either built-in or third-party)
    for many common editors used by kernel developers (e.g. vim,
    emacs, Sublime, Atom...) that allow you to format an entire file
    or, more usefully, just your selection.

    * Able to parse unified diffs -- you can, for instance, reformat
    only the lines changed by a git commit.

    * Able to reflow text comments as well.

    * Widely supported and used by hundreds of developers in highly
    complex projects and organizations (e.g. the LLVM project itself,
    Chromium, WebKit, Google, Mozilla...). Therefore, it will be
    supported for a long time.

    See more information about the tool at:

    https://clang.llvm.org/docs/ClangFormat.html
    https://clang.llvm.org/docs/ClangFormatStyleOptions.html

    Link: http://lkml.kernel.org/r/20180318171632.qfkemw3mwbcukth6@gmail.com
    Signed-off-by: Miguel Ojeda
    Cc: Randy Dunlap
    Cc: Andy Whitcroft
    Cc: Joe Perches
    Cc: Jonathan Corbet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miguel Ojeda