Skip to content
Permalink
Alan-Maguire/l…
Switch branches/tags

Commits on Jun 19, 2021

  1. selftests/bpf: add dump type data tests to btf dump tests

    Test various type data dumping operations by comparing expected
    format with the dumped string; an snprintf-style printf function
    is used to record the string dumped.  Also verify overflow handling
    where the data passed does not cover the full size of a type,
    such as would occur if a tracer has a portion of the 8k
    "struct task_struct".
    
    Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
    alan-maguire authored and intel-lab-lkp committed Jun 19, 2021
  2. selftests/bpf: add ASSERT_STRNEQ() variant for test_progs

    It will support strncmp()-style string comparisons.
    
    Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
    Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
    alan-maguire authored and intel-lab-lkp committed Jun 19, 2021
  3. libbpf: BTF dumper support for typed data

    Add a BTF dumper for typed data, so that the user can dump a typed
    version of the data provided.
    
    The API is
    
    int btf_dump__dump_type_data(struct btf_dump *d, __u32 id,
                                 void *data, size_t data_sz,
                                 const struct btf_dump_type_data_opts *opts);
    
    ...where the id is the BTF id of the data pointed to by the "void *"
    argument; for example the BTF id of "struct sk_buff" for a
    "struct skb *" data pointer.  Options supported are
    
     - a starting indent level (indent_lvl)
     - a user-specified indent string which will be printed once per
       indent level; if NULL, tab is chosen but any string <= 32 chars
       can be provided.
     - a set of boolean options to control dump display, similar to those
       used for BPF helper bpf_snprintf_btf().  Options are
            - compact : omit newlines and other indentation
            - skip_names: omit member names
            - emit_zeroes: show zero-value members
    
    Default output format is identical to that dumped by bpf_snprintf_btf(),
    for example a "struct sk_buff" representation would look like this:
    
    struct sk_buff){
    	(union){
    		(struct){
    			.next = (struct sk_buff *)0xffffffffffffffff,
    			.prev = (struct sk_buff *)0xffffffffffffffff,
    		(union){
    			.dev = (struct net_device *)0xffffffffffffffff,
    			.dev_scratch = (long unsigned int)18446744073709551615,
    		},
    	},
    ...
    
    If the data structure is larger than the *data_sz*
    number of bytes that are available in *data*, as much
    of the data as possible will be dumped and -E2BIG will
    be returned.  This is useful as tracers will sometimes
    not be able to capture all of the data associated with
    a type; for example a "struct task_struct" is ~16k.
    Being able to specify that only a subset is available is
    important for such cases.  On success, the amount of data
    dumped is returned.
    
    Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
    alan-maguire authored and intel-lab-lkp committed Jun 19, 2021

Commits on Jun 18, 2021

  1. bpf: Add documentation for libbpf including API autogen

    This patch is meant to start the initiative to document libbpf.
    It includes .rst files which are text documentation describing building,
    API naming convention, as well as an index to generated API documentation.
    
    In this approach the generated API documentation is enabled by the kernels
    existing kernel documentation system which uses sphinx. The resulting docs
    would then be synced to kernel.org/doc
    
    You can test this by running `make htmldocs` and serving the html in
    Documentation/output. Since libbpf does not yet have comments in kernel
    doc format, see kernel.org/doc/html/latest/doc-guide/kernel-doc.html for
    an example so you can test this.
    
    The advantage of this approach is to use the existing sphinx
    infrastructure that the kernel has, and have libbpf docs in
    the same place as everything else.
    
    The current plan is to have the libbpf mirror sync the generated docs
    and version them based on the libbpf releases which are cut on github.
    
    This patch includes the addition of libbpf_api.rst which pulls comment
    documentation from header files in libbpf under tools/lib/bpf/. The comment
    docs would be of the standard kernel doc format.
    
    Signed-off-by: Grant Seltzer <grantseltzer@gmail.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20210618140459.9887-2-grantseltzer@gmail.com
    grantseltzer authored and borkmann committed Jun 18, 2021
  2. samples/bpf: Fix the error return code of xdp_redirect's main()

    Fix to return a negative error code from the error handling
    case instead of 0, as done elsewhere in this function.
    
    If bpf_map_update_elem() failed, main() should return a negative error.
    
    Fixes: 832622e ("xdp: sample program for new bpf_redirect helper")
    Signed-off-by: Wang Hai <wanghai38@huawei.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20210616042534.315097-1-wanghai38@huawei.com
    Wang Hai authored and anakryiko committed Jun 18, 2021
  3. samples/bpf: Fix Segmentation fault for xdp_redirect command

    A Segmentation fault error is caused when the following command
    is executed.
    
    $ sudo ./samples/bpf/xdp_redirect lo
    Segmentation fault
    
    This command is missing a device <IFNAME|IFINDEX> as an argument, resulting
    in out-of-bounds access from argv.
    
    If the number of devices for the xdp_redirect parameter is not 2,
    we should report an error and exit.
    
    Fixes: 24251c2 ("samples/bpf: add option for native and skb mode for redirect apps")
    Signed-off-by: Wang Hai <wanghai38@huawei.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20210616042324.314832-1-wanghai38@huawei.com
    Wang Hai authored and anakryiko committed Jun 18, 2021
  4. selftests/bpf: Fix ringbuf test fetching map FD

    Seems like 4d1b629 ("selftests/bpf: Convert few tests to light skeleton.")
    and 704e2be ("selftests/bpf: Test ringbuf mmap read-only and read-write
    restrictions") were done independently on bpf and bpf-next trees and are in
    conflict with each other, despite a clean merge. Fix fetching of ringbuf's
    map_fd to use light skeleton properly.
    
    Fixes: 704e2be ("selftests/bpf: Test ringbuf mmap read-only and read-write restrictions")
    Fixes: 4d1b629 ("selftests/bpf: Convert few tests to light skeleton.")
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Link: https://lore.kernel.org/bpf/20210618002824.2081922-1-andrii@kernel.org
    anakryiko authored and Alexei Starovoitov committed Jun 18, 2021

Commits on Jun 17, 2021

  1. Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/gi…

    …t/tnguy/next-queue
    
    Tony Nguyen says:
    
    ====================
    100GbE Intel Wired LAN Driver Updates 2021-06-17
    
    This series contains updates to ice driver only.
    
    Jake corrects a couple of entries in the PTYPE table to properly
    reflect the datasheet and removes unneeded NULL checks for some
    PTP calls.
    
    Paul reduces the scope of variables and removes the use of a local
    variable.
    
    Shaokun Zhang removes a duplicate function declaration.
    
    Lorenzo Bianconi fixes a compilation warning if PTP_1588_CLOCK is
    disabled.
    
    Colin Ian King changes a for loop to remove an unneeded 'continue'.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Jun 17, 2021
  2. Merge branch 'hdlc_ppp-cleanups'

    Guangbin Huang says:
    
    ====================
    net: hdlc_ppp: clean up some code style issues
    
    This patchset clean up some code style issues.
    
    ---
    Change Log:
    V1 -> V2:
    1. remove patch "net: hdlc_ppp: fix the comments style issue" and
    patch "net: hdlc_ppp: remove redundant spaces" from this patchset.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Jun 17, 2021
  3. net: hdlc_ppp: add required space

    Add space required after that ','.
    
    Signed-off-by: Peng Li <lipeng321@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    321lipeng authored and davem330 committed Jun 17, 2021
  4. net: hdlc_ppp: remove unnecessary out of memory message

    This patch removes unnecessary out of memory message,
    to fix the following checkpatch.pl warning:
    "WARNING: Possible unnecessary 'out of memory' message"
    
    Signed-off-by: Peng Li <lipeng321@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    321lipeng authored and davem330 committed Jun 17, 2021
  5. net: hdlc_ppp: move out assignment in if condition

    Should not use assignment in if condition.
    
    Signed-off-by: Peng Li <lipeng321@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    321lipeng authored and davem330 committed Jun 17, 2021
  6. net: hdlc_ppp: fix the code style issue about "foo* bar"

    Fix the checkpatch error as "foo* bar" or "foo*bar" should be "foo *bar".
    
    Signed-off-by: Peng Li <lipeng321@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    321lipeng authored and davem330 committed Jun 17, 2021
  7. net: hdlc_ppp: add blank line after declarations

    This patch fixes the checkpatch error about missing a blank line
    after declarations.
    
    Signed-off-by: Peng Li <lipeng321@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    321lipeng authored and davem330 committed Jun 17, 2021
  8. net: hdlc_ppp: remove redundant blank lines

    This patch removes some redundant blank lines.
    
    Signed-off-by: Peng Li <lipeng321@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    321lipeng authored and davem330 committed Jun 17, 2021
  9. Merge branch 'mdio-nodes'

    Ioana Ciornei says:
    
    ====================
    net: mdio: setup both fwnode and of_node
    
    The first patch in this series fixes a bug introduced by mistake in the
    previous ACPI MDIO patch set.
    
    The next two patches are adding a new helper which takes a device and a
    fwnode_handle and populates both the of_node and fwnode so that we make
    sure that a bug like this does not happen anymore.
    Also, the new helper is used in the MDIO area.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Jun 17, 2021
  10. net: mdio: use device_set_node() to setup both fwnode and of

    Use the newly introduced helper to setup both the of_node and the
    fwnode for a given device.
    
    Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    IoanaCiornei authored and davem330 committed Jun 17, 2021
  11. driver core: add a helper to setup both the of_node and fwnode of a d…

    …evice
    
    There are many places where both the fwnode_handle and the of_node of a
    device need to be populated. Add a function which does both so that we
    have consistency.
    
    Suggested-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    IoanaCiornei authored and davem330 committed Jun 17, 2021
  12. net: mdio: setup of_node for the MDIO device

    By mistake, the of_node of the MDIO device was not setup in the patch
    linked below. As a consequence, any PHY driver that depends on the
    of_node in its probe callback was not be able to successfully finish its
    probe on a PHY, thus the Generic PHY driver was used instead.
    
    Fix this by actually setting up the of_node.
    
    Fixes: bc1bee3 ("net: mdiobus: Introduce fwnode_mdiobus_register_phy()")
    Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    IoanaCiornei authored and davem330 committed Jun 17, 2021
  13. r8152: store the information of the pipes

    Store the information of the pipes to avoid calling usb_rcvctrlpipe(),
    usb_sndctrlpipe(), usb_rcvbulkpipe(), usb_sndbulkpipe(), and
    usb_rcvintpipe() frequently.
    
    Signed-off-by: Hayes Wang <hayeswang@realtek.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    hayesorz authored and davem330 committed Jun 17, 2021
  14. Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next

    Daniel Borkmann says:
    
    ====================
    pull-request: bpf-next 2021-06-17
    
    The following pull-request contains BPF updates for your *net-next* tree.
    
    We've added 50 non-merge commits during the last 25 day(s) which contain
    a total of 148 files changed, 4779 insertions(+), 1248 deletions(-).
    
    The main changes are:
    
    1) BPF infrastructure to migrate TCP child sockets from a listener to another
       in the same reuseport group/map, from Kuniyuki Iwashima.
    
    2) Add a provably sound, faster and more precise algorithm for tnum_mul() as
       noted in https://arxiv.org/abs/2105.05398, from Harishankar Vishwanathan.
    
    3) Streamline error reporting changes in libbpf as planned out in the
       'libbpf: the road to v1.0' effort, from Andrii Nakryiko.
    
    4) Add broadcast support to xdp_redirect_map(), from Hangbin Liu.
    
    5) Extends bpf_map_lookup_and_delete_elem() functionality to 4 more map
       types, that is, {LRU_,PERCPU_,LRU_PERCPU_,}HASH, from Denis Salopek.
    
    6) Support new LLVM relocations in libbpf to make them more linker friendly,
       also add a doc to describe the BPF backend relocations, from Yonghong Song.
    
    7) Silence long standing KUBSAN complaints on register-based shifts in
       interpreter, from Daniel Borkmann and Eric Biggers.
    
    8) Add dummy PT_REGS macros in libbpf to fail BPF program compilation when
       target arch cannot be determined, from Lorenz Bauer.
    
    9) Extend AF_XDP to support large umems with 1M+ pages, from Magnus Karlsson.
    
    10) Fix two minor libbpf tc BPF API issues, from Kumar Kartikeya Dwivedi.
    
    11) Move libbpf BPF_SEQ_PRINTF/BPF_SNPRINTF macros that can be used by BPF
        programs to bpf_helpers.h header, from Florent Revest.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Jun 17, 2021
  15. Merge branch 'gianfar-64-bit-stats'

    Esben Haabendal says:
    
    ====================
    net: gianfar: 64-bit statistics and rx_missed_errors counter
    
    This series replaces the legacy 32-bit statistics to proper 64-bit ditto,
    and implements rx_missed_errors counter on top of that.
    
    The device supports a 16-bit RDRP counter, and a related carry bit and
    interrupt, which allows implementation of a robust 64-bit counter.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Jun 17, 2021
  16. net: gianfar: Implement rx_missed_errors counter

    Devices with RMON support has a 16-bit RDRP counter.  It provides: "Receive
    dropped packets counter. Increments for frames received which are streamed
    to system but are later dropped due to lack of system resources."
    
    To handle more than 2^16 dropped packets, a carry bit in CAR1 register is
    set on overflow, so we enable irq when this is set, extending the counter
    to 2^64 for handling situations where lots of packets are missed (e.g.
    during heavy network storms).
    
    Signed-off-by: Esben Haabendal <esben@geanix.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    esben authored and davem330 committed Jun 17, 2021
  17. net: gianfar: Add definitions for CAR1 and CAM1 register bits

    These are for carry status and interrupt mask bits of statistics registers.
    
    Signed-off-by: Esben Haabendal <esben@geanix.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    esben authored and davem330 committed Jun 17, 2021
  18. net: gianfar: Avoid 16 bytes of memset

    The memset on CAMx is wrong, as it actually unmasks all carry irq's,
    which we clearly are not interested in.
    
    The memset on CARx registers is just pointless, as they are W1C.
    
    So let's just stop the memset before CAR1.
    
    Signed-off-by: Esben Haabendal <esben@geanix.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    esben authored and davem330 committed Jun 17, 2021
  19. net: gianfar: Clear CAR registers

    The CAR1 and CAR2 registers are W1C style registers, to the memset does not
    actually clear them.
    
    Signed-off-by: Esben Haabendal <esben@geanix.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    esben authored and davem330 committed Jun 17, 2021
  20. net: gianfar: Extend statistics counters to 64-bit

    No reason to wrap counter values at 2^32.  Especially the bytes counters
    can wrap pretty fast on Gbit networks.
    
    Signed-off-by: Esben Haabendal <esben@geanix.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    esben authored and davem330 committed Jun 17, 2021
  21. net: gianfar: Convert to ndo_get_stats64 interface

    No reason to produce the legacy net_device_stats struct, only to have it
    converted to rtnl_link_stats64.  And as a bonus, this allows for improving
    counter size to 64 bit.
    
    Signed-off-by: Esben Haabendal <esben@geanix.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    esben authored and davem330 committed Jun 17, 2021
  22. net: sched: fix error return code in tcf_del_walker()

    When nla_put_u32() fails, 'ret' could be 0, it should
    return error code in tcf_del_walker().
    
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Yang Yingliang authored and davem330 committed Jun 17, 2021
  23. net: ipa: Add missing of_node_put() in ipa_firmware_load()

    This node pointer is returned by of_parse_phandle() with refcount
    incremented in this function. of_node_put() on it before exiting
    this function.
    
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Acked-by: Alex Elder <elder@linaro.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Yang Yingliang authored and davem330 committed Jun 17, 2021
  24. net: fix mistake path for netdev_features_strings

    Th_strings arrays netdev_features_strings, tunable_strings, and
    phy_tunable_strings has been moved to file net/ethtool/common.c.
    So fixes the comment.
    
    Signed-off-by: Jian Shen <shenjian15@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    IronShen authored and davem330 committed Jun 17, 2021
  25. documentation: networking: devlink: fix prestera.rst formatting that …

    …causes build warnings
    
    Fixes: 66826c4 ("documentation: networking: devlink: add prestera switched driver Documentation")
    
    Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Oleksandr Mazur authored and davem330 committed Jun 17, 2021
  26. net: pcs: xpcs: Fix a less than zero u16 comparison error

    Currently the check for the u16 variable val being less than zero is
    always false because val is unsigned. Fix this by using the int
    variable for the assignment and less than zero check.
    
    Addresses-Coverity: ("Unsigned compared against 0")
    Fixes: f7380bb ("net: pcs: xpcs: add support for NXP SJA1110")
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Colin Ian King authored and davem330 committed Jun 17, 2021
  27. ice: remove redundant continue statement in a for-loop

    The continue statement in the for-loop is redundant. Re-work the hw_lock
    check to remove it.
    
    Addresses-Coverity: ("Continue has no effect")
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Colin Ian King authored and anguy11 committed Jun 17, 2021
  28. net: ice: ptp: fix compilation warning if PTP_1588_CLOCK is disabled

    Fix the following compilation warning if PTP_1588_CLOCK is not enabled
    
    drivers/net/ethernet/intel/ice/ice_ptp.h:149:1:
       error: return type defaults to ‘int’ [-Werror=return-type]
       ice_ptp_request_ts(struct ice_ptp_tx *tx, struct sk_buff *skb)
    
    Fixes: ea9b847 ("ice: enable transmit timestamps for E810 devices")
    Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    LorenzoBianconi authored and anguy11 committed Jun 17, 2021
Older