Skip to content
Permalink
Ansuel-Smith/A…
Switch branches/tags

Commits on Nov 9, 2021

  1. dt-bindings: net: dsa: qca8k: add LEDs definition example

    Add LEDs definition example for qca8k using the offload trigger as the
    default trigger and add all the supported offload triggers by the
    switch.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 9, 2021
  2. net: dsa: qca8k: add LEDs support

    Add LEDs support for qca8k Switch Family. This will provide the LEDs
    hardware API to permit the PHY LED to support hardware mode.
    Each port have at least 3 LEDs and they can HW blink, set on/off or
    follow blink modes configured with the LED in hardware mode..
    This adds support for 2 hardware trigger netdev and
    hardware-phy-activity.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 9, 2021
  3. leds: trigger: add hardware-phy-activity trigger

    Add Hardware Only Trigger for PHY Activity. This special trigger is used to
    configure and expose the different HW trigger that are provided by the
    PHY. Each blink mode can be configured by sysfs and on trigger
    activation the hardware mode is enabled.
    
    This currently implement these hw triggers:
      - blink_tx: Blink LED on tx packet receive
      - blink_rx: Blink LED on rx packet receive
      - keep_link_10m: Keep LED on with 10m link speed
      - keep_link_100m: Keep LED on with 100m link speed
      - kepp_link_1000m: Keep LED on with 1000m link speed
      - keep_half_duplex: Keep LED on with half duplex link
      - keep_full_duplex: Keep LED on with full duplex link
      - option_linkup_over: Ignore blink tx/rx with link keep not active
      - option_power_on_reset: Keep LED on with switch reset
      - option_blink_2hz: Set blink speed at 2hz for every blink event
      - option_blink_4hz: Set blink speed at 4hz for every blink event
      - option_blink_8hz: Set blink speed at 8hz for every blink event
      - option_blink_auto: Set blink speed at 2hz for 10m link speed,
          4hz for 100m and 8hz for 1000m
    
    The trigger will check if the LED driver support the various blink modes
    and will expose the blink modes in sysfs.
    It will finally enable hw mode for the LED without configuring any rule.
    This mean that the LED will blink/follow whatever offload trigger is
    active by default and the user needs to manually configure the desired
    offload triggers using sysfs.
    A flag is passed to configure_offload with the related rule from this
    trigger to active or disable.
    It's in the led driver interest the detection and knowing how to
    elaborate the passed flags and should report -EOPNOTSUPP otherwise.
    
    The different hw triggers are exposed in the led sysfs dir under the
    offload-phy-activity subdir.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 9, 2021
  4. leds: trigger: netdev: add hardware control support

    Add hardware control support for the Netdev trigger.
    The trigger on config change will check if the requested trigger can set
    to blink mode using LED hardware mode and if every blink mode is supported,
    the trigger will enable hardware mode with the requested configuration.
    If there is at least one trigger that is not supported and can't run in
    hardware mode, then software mode will be used instead.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 9, 2021
  5. leds: trigger: netdev: rename and expose NETDEV trigger enum modes

    Rename NETDEV trigger enum modes to a more simbolic name and move them
    in leds.h to make them accessible by any user.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 9, 2021
  6. leds: trigger: netdev: drop NETDEV_LED_MODE_LINKUP from mode

    Drop NETDEV_LED_MODE_LINKUP from mode list and convert to a simple bool
    that will be true or false based on the carrier link. No functional
    change intended.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 9, 2021
  7. leds: add function to configure hardware controlled LED

    Add hw_control_configure helper to configure how the LED should work in
    hardware mode. The function require to support the particular trigger and
    will use the passed flag to elaborate the data and apply the
    correct configuration. This function will then be used by the trigger to
    request and update hardware configuration.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 9, 2021
  8. leds: add support for hardware driven LEDs

    Some LEDs can be driven by hardware (for example a LED connected to
    an ethernet PHY or an ethernet switch can be configured to blink on
    activity on the network, which in software is done by the netdev trigger).
    
    To do such offloading, LED driver must support this and a supported
    trigger must be used.
    
    LED driver should declare the correct blink_mode supported and should set
    the blink_mode parameter to one of HARDWARE_CONTROLLED or
    SOFTWARE_HARDWARE_CONTROLLED.
    The trigger will check this option and fail to activate if the blink_mode
    is not supported. By default if a LED driver doesn't declare blink_mode,
    SOFTWARE_CONTROLLED is assumed.
    
    The LED must implement 3 main API:
    - trigger_offload_status(): This asks the LED driver if offload mode is
        enabled or not.
        Triggers will check if the offload mode is supported and will be
        activated accordingly. If the trigger can't run in software mode,
        return -EOPNOTSUPP as the blinking can't be simulated by software.
    - trigger_offload_start(): This will simply enable the offload mode for
        the LED.
        With this not declared and trigger_offload_status() returning true,
        it's assumed that the LED is always in offload mode.
    - trigger_offload_stop(): This will simply disable the offload mode for
        the LED.
        With this not declared and trigger_offload_status() returning true,
        it's assumed that the LED is always in offload mode.
        It's advised to the driver to put the LED in the old state but this
        is not enforcerd and putting the LED off is also accepted.
    
    With HARDWARE_CONTROLLED blink_mode trigger_offload_status/start/stop is
    optional and any software only trigger will reject activation as the LED
    supports only hardware mode.
    
    An additional config CONFIG_LEDS_HARDWARE_CONTROL is added to add support
    for LEDs that can be controlled by hardware.
    
    Cc: Marek Behún <kabel@kernel.org>
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 9, 2021

Commits on Nov 7, 2021

  1. litex_liteeth: Fix a double free in the remove function

    'netdev' is a managed resource allocated in the probe using
    'devm_alloc_etherdev()'.
    It must not be freed explicitly in the remove function.
    
    Fixes: ee7da21 ("net: Add driver for LiteX's LiteETH network interface")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    tititiou36 authored and davem330 committed Nov 7, 2021
  2. nfc: pn533: Fix double free when pn533_fill_fragment_skbs() fails

    skb is already freed by dev_kfree_skb in pn533_fill_fragment_skbs,
    but follow error handler branch when pn533_fill_fragment_skbs()
    fails, skb is freed again, results in double free issue. Fix this
    by not free skb in error path of pn533_fill_fragment_skbs.
    
    Fixes: 963a82e ("NFC: pn533: Split large Tx frames in chunks")
    Fixes: 93ad420 ("NFC: pn533: Target mode Tx fragmentation support")
    Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
    Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Chengfeng Ye authored and davem330 committed Nov 7, 2021
  3. selftests: net: tls: remove unused variable and code

    When building selftests/net with clang, the compiler warn about the
    function abs() see below:
    
    tls.c:657:15: warning: variable 'len_compared' set but not used [-Wunused-but-set-variable]
            unsigned int len_compared = 0;
                         ^
    
    Rework to remove the unused variable and the for-loop where the variable
    'len_compared' was assinged.
    
    Fixes: 7f657d5 ("selftests: tls: add selftests for TLS sockets")
    Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
    Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    roxell authored and davem330 committed Nov 7, 2021
  4. net: marvell: prestera: fix hw structure laid out

    The prestera FW v4.0 support commit has been merged
    accidentally w/o review comments addressed and waiting
    for the final patch set to be uploaded. So, fix the remaining
    comments related to structure laid out and build issues.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Fixes: bb5dbf2 ("net: marvell: prestera: add firmware v4.0 support")
    Signed-off-by: Volodymyr Mytnyk <vmytnyk@marvell.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Volodymyr Mytnyk authored and davem330 committed Nov 7, 2021
  5. sctp: remove unreachable code from sctp_sf_violation_chunk()

    sctp_sf_violation_chunk() is not called with asoc argument equal to NULL,
    but if that happens it would lead to NULL pointer dereference
    in sctp_vtag_verify().
    
    The patch removes code that handles NULL asoc in sctp_sf_violation_chunk().
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
    Proposed-by: Xin Long <lucien.xin@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    khoroshilov authored and davem330 committed Nov 7, 2021
  6. llc: fix out-of-bound array index in llc_sk_dev_hash()

    Both ifindex and LLC_SK_DEV_HASH_ENTRIES are signed.
    
    This means that (ifindex % LLC_SK_DEV_HASH_ENTRIES) is negative
    if @ifindex is negative.
    
    We could simply make LLC_SK_DEV_HASH_ENTRIES unsigned.
    
    In this patch I chose to use hash_32() to get more entropy
    from @ifindex, like llc_sk_laddr_hashfn().
    
    UBSAN: array-index-out-of-bounds in ./include/net/llc.h:75:26
    index -43 is out of range for type 'hlist_head [64]'
    CPU: 1 PID: 20999 Comm: syz-executor.3 Not tainted 5.15.0-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
     <TASK>
     __dump_stack lib/dump_stack.c:88 [inline]
     dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
     ubsan_epilogue+0xb/0x5a lib/ubsan.c:151
     __ubsan_handle_out_of_bounds.cold+0x62/0x6c lib/ubsan.c:291
     llc_sk_dev_hash include/net/llc.h:75 [inline]
     llc_sap_add_socket+0x49c/0x520 net/llc/llc_conn.c:697
     llc_ui_bind+0x680/0xd70 net/llc/af_llc.c:404
     __sys_bind+0x1e9/0x250 net/socket.c:1693
     __do_sys_bind net/socket.c:1704 [inline]
     __se_sys_bind net/socket.c:1702 [inline]
     __x64_sys_bind+0x6f/0xb0 net/socket.c:1702
     do_syscall_x64 arch/x86/entry/common.c:50 [inline]
     do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
     entry_SYSCALL_64_after_hwframe+0x44/0xae
    RIP: 0033:0x7fa503407ae9
    
    Fixes: 6d2e3ea ("llc: use a device based hash table to speed up multicast delivery")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    neebe000 authored and davem330 committed Nov 7, 2021
  7. net: hisilicon: fix hsn3_ethtool kernel-doc warnings

    Fix kernel-doc warnings and spacing in hns3_ethtool.c:
    
    hns3_ethtool.c:246: warning: No description found for return value of 'hns3_lp_run_test'
    hns3_ethtool.c:408: warning: expecting prototype for hns3_nic_self_test(). Prototype was for hns3_self_test() instead
    
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Reported-by: kernel test robot <lkp@intel.com>
    Cc: Peng Li <lipeng321@huawei.com>
    Cc: Guangbin Huang <huangguangbin2@huawei.com>
    Cc: Yisen Zhuang <yisen.zhuang@huawei.com>
    Cc: Salil Mehta <salil.mehta@huawei.com>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    rddunlap authored and davem330 committed Nov 7, 2021
  8. nfc: port100: lower verbosity of cancelled URB messages

    It is not an error to receive an URB with -ENOENT because it can come
    from regular user operations, e.g. pressing CTRL+C when running nfctool
    from neard.  Make it a debugging message, not an error.
    
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    krzk authored and davem330 committed Nov 7, 2021
  9. Merge tag 'linux-can-fixes-for-5.16-20211106' of git://git.kernel.org…

    …/pub/scm/linux/kernel/git/mkl/linux-can
    
    linux-can-fixes-for-5.16-20211106
    
    Marc Kleine-Budde says:
    
    ====================
    pull-request: can 2021-11-06
    
    this is a pull request of 8 patches for net/master.
    
    The first 3 patches are by Zhang Changzhong and fix 3 standard
    conformance problems in the j1939 CAN stack.
    
    The next patch is by Vincent Mailhol and fixes a memory leak in the
    leak error path of the etas_es58x CAN driver.
    
    Stephane Grosjean contributes 2 patches for the peak_usb driver to fix
    the bus error handling and update the order of printed information
    regarding firmware version and available updates.
    
    The last 2 patches are by me and fixes a packet starvation problem in
    the bus off case and the error handling in the mcp251xfd_chip_start()
    function.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Nov 7, 2021

Commits on Nov 6, 2021

  1. can: mcp251xfd: mcp251xfd_chip_start(): fix error handling for mcp251…

    …xfd_chip_rx_int_enable()
    
    This patch fixes the error handling for mcp251xfd_chip_rx_int_enable().
    Instead just returning the error, properly shut down the chip.
    
    Link: https://lore.kernel.org/all/20211106201526.44292-2-mkl@pengutronix.de
    Fixes: 55e5b97 ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN")
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    marckleinebudde committed Nov 6, 2021
  2. can: mcp251xfd: mcp251xfd_irq(): add missing can_rx_offload_threaded_…

    …irq_finish() in case of bus off
    
    The function can_rx_offload_threaded_irq_finish() is needed to trigger
    the NAPI thread to deliver read CAN frames to the networking stack.
    
    This patch adds the missing call to can_rx_offload_threaded_irq_finish()
    in case of a bus off, before leaving the interrupt handler to avoid
    packet starvation.
    
    Link: https://lore.kernel.org/all/20211106201526.44292-1-mkl@pengutronix.de
    Fixes: 30bfec4 ("can: rx-offload: can_rx_offload_threaded_irq_finish(): add new function to be called from threaded interrupt")
    Cc: stable@vger.kernel.org
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    marckleinebudde committed Nov 6, 2021
  3. can: peak_usb: exchange the order of information messages

    Proposes the possible update of the PCAN-USB firmware after indicating its
    name and current version.
    
    Link: https://lore.kernel.org/all/20211021081505.18223-3-s.grosjean@peak-system.com
    Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Stephane Grosjean authored and marckleinebudde committed Nov 6, 2021
  4. can: peak_usb: always ask for BERR reporting for PCAN-USB devices

    Since for the PCAN-USB, the management of the transition to the
    ERROR_WARNING or ERROR_PASSIVE state is done according to the error
    counters, these must be requested unconditionally.
    
    Link: https://lore.kernel.org/all/20211021081505.18223-2-s.grosjean@peak-system.com
    Fixes: c11dcee ("can: peak_usb: pcan_usb_decode_error(): upgrade handling of bus state changes")
    Cc: stable@vger.kernel.org
    Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Stephane Grosjean authored and marckleinebudde committed Nov 6, 2021
  5. can: etas_es58x: es58x_rx_err_msg(): fix memory leak in error path

    In es58x_rx_err_msg(), if can->do_set_mode() fails, the function
    directly returns without calling netif_rx(skb). This means that the
    skb previously allocated by alloc_can_err_skb() is not freed. In other
    terms, this is a memory leak.
    
    This patch simply removes the return statement in the error branch and
    let the function continue.
    
    Issue was found with GCC -fanalyzer, please follow the link below for
    details.
    
    Fixes: 8537257 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
    Link: https://lore.kernel.org/all/20211026180740.1953265-1-mailhol.vincent@wanadoo.fr
    Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    vincent-mailhol authored and marckleinebudde committed Nov 6, 2021
  6. can: j1939: j1939_tp_cmd_recv(): check the dst address of TP.CM_BAM

    The TP.CM_BAM message must be sent to the global address [1], so add a
    check to drop TP.CM_BAM sent to a non-global address.
    
    Without this patch, the receiver will treat the following packets as
    normal RTS/CTS transport:
    18EC0102#20090002FF002301
    18EB0102#0100000000000000
    18EB0102#020000FFFFFFFFFF
    
    [1] SAE-J1939-82 2015 A.3.3 Row 1.
    
    Fixes: 9d71dd0 ("can: add support of SAE J1939 protocol")
    Link: https://lore.kernel.org/all/1635431907-15617-4-git-send-email-zhangchangzhong@huawei.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
    Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Zhang Changzhong authored and marckleinebudde committed Nov 6, 2021
  7. can: j1939: j1939_can_recv(): ignore messages with invalid source add…

    …ress
    
    According to SAE-J1939-82 2015 (A.3.6 Row 2), a receiver should never
    send TP.CM_CTS to the global address, so we can add a check in
    j1939_can_recv() to drop messages with invalid source address.
    
    Fixes: 9d71dd0 ("can: add support of SAE J1939 protocol")
    Link: https://lore.kernel.org/all/1635431907-15617-3-git-send-email-zhangchangzhong@huawei.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
    Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Zhang Changzhong authored and marckleinebudde committed Nov 6, 2021
  8. can: j1939: j1939_tp_cmd_recv(): ignore abort message in the BAM tran…

    …sport
    
    This patch prevents BAM transport from being closed by receiving abort
    message, as specified in SAE-J1939-82 2015 (A.3.3 Row 4).
    
    Fixes: 9d71dd0 ("can: add support of SAE J1939 protocol")
    Link: https://lore.kernel.org/all/1635431907-15617-2-git-send-email-zhangchangzhong@huawei.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
    Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Zhang Changzhong authored and marckleinebudde committed Nov 6, 2021
  9. ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()

    The newinet value is initialized with inet_sk() in a block code to
    handle sockets for the ETH_P_IP protocol. Along this code path,
    newinet is never read. Thus, assignment to newinet is needless and
    can be removed.
    
    Signed-off-by: Nghia Le <nghialm78@gmail.com>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Link: https://lore.kernel.org/r/20211104143740.32446-1-nghialm78@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Nghia Le authored and Jakub Kicinski committed Nov 6, 2021

Commits on Nov 5, 2021

  1. Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf

    Daniel Borkmann says:
    
    ====================
    pull-request: bpf 2021-11-05
    
    We've added 15 non-merge commits during the last 3 day(s) which contain
    a total of 14 files changed, 199 insertions(+), 90 deletions(-).
    
    The main changes are:
    
    1) Fix regression from stack spill/fill of <8 byte scalars, from Martin KaFai Lau.
    
    2) Fix perf's build of bpftool's bootstrap version due to missing libbpf
       headers, from Quentin Monnet.
    
    3) Fix riscv{32,64} BPF exception tables build errors and warnings, from Björn Töpel.
    
    4) Fix bpf fs to allow RENAME_EXCHANGE support for atomic upgrades on sk_lookup
       control planes, from Lorenz Bauer.
    
    5) Fix libbpf's error reporting in bpf_map_lookup_and_delete_elem_flags() due to
       missing libbpf_err_errno(), from Mehrdad Arshad Rad.
    
    6) Various fixes to make xdp_redirect_multi selftest more reliable, from Hangbin Liu.
    
    7) Fix netcnt selftest to make it run serial and thus avoid conflicts with other
       cgroup/skb selftests run in parallel that could cause flakes, from Andrii Nakryiko.
    
    8) Fix reuseport_bpf_numa networking selftest to skip unavailable NUMA nodes,
       from Kleber Sacilotto de Souza.
    
    * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
      riscv, bpf: Fix RV32 broken build, and silence RV64 warning
      selftests/bpf/xdp_redirect_multi: Limit the tests in netns
      selftests/bpf/xdp_redirect_multi: Give tcpdump a chance to terminate cleanly
      selftests/bpf/xdp_redirect_multi: Use arping to accurate the arp number
      selftests/bpf/xdp_redirect_multi: Put the logs to tmp folder
      libbpf: Fix lookup_and_delete_elem_flags error reporting
      bpftool: Install libbpf headers for the bootstrap version, too
      selftests/net: Fix reuseport_bpf_numa by skipping unavailable nodes
      selftests/bpf: Verifier test on refill from a smaller spill
      bpf: Do not reject when the stack read size is different from the tracked scalar size
      selftests/bpf: Make netcnt selftests serial to avoid spurious failures
      selftests/bpf: Test RENAME_EXCHANGE and RENAME_NOREPLACE on bpffs
      selftests/bpf: Convert test_bpffs to ASSERT macros
      libfs: Support RENAME_EXCHANGE in simple_rename()
      libfs: Move shmem_exchange to simple_rename_exchange
    ====================
    
    Link: https://lore.kernel.org/r/20211105165803.29372-1-daniel@iogearbox.net
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Jakub Kicinski committed Nov 5, 2021
  2. riscv, bpf: Fix RV32 broken build, and silence RV64 warning

    Commit 252c765 ("riscv, bpf: Add BPF exception tables") only addressed
    RV64, and broke the RV32 build [1]. Fix by gating the exception tables code
    with CONFIG_ARCH_RV64I.
    
    Further, silence a "-Wmissing-prototypes" warning [2] in the RV64 BPF JIT.
    
      [1] https://lore.kernel.org/llvm/202111020610.9oy9Rr0G-lkp@intel.com/
      [2] https://lore.kernel.org/llvm/202110290334.2zdMyRq4-lkp@intel.com/
    
    Fixes: 252c765 ("riscv, bpf: Add BPF exception tables")
    Signed-off-by: Björn Töpel <bjorn@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Reviewed-by: Tong Tiangen <tongtiangen@huawei.com>
    Link: https://lore.kernel.org/bpf/20211103115453.397209-1-bjorn@kernel.org
    Björn Töpel authored and borkmann committed Nov 5, 2021
  3. selftests/bpf/xdp_redirect_multi: Limit the tests in netns

    As I want to test both DEVMAP and DEVMAP_HASH in XDP multicast redirect, I
    limited DEVMAP max entries to a small value for performace. When the test
    runs after amount of interface creating/deleting tests. The interface index
    will exceed the map max entries and xdp_redirect_multi will error out with
    "Get interfacesInterface index to large".
    
    Fix this issue by limit the tests in netns and specify the ifindex when
    creating interfaces.
    
    Fixes: d232924 ("selftests/bpf: Add xdp_redirect_multi test")
    Reported-by: Jiri Benc <jbenc@redhat.com>
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20211027033553.962413-5-liuhangbin@gmail.com
    liuhangbin authored and borkmann committed Nov 5, 2021
  4. selftests/bpf/xdp_redirect_multi: Give tcpdump a chance to terminate …

    …cleanly
    
    No need to kill tcpdump with -9.
    
    Fixes: d232924 ("selftests/bpf: Add xdp_redirect_multi test")
    Suggested-by: Jiri Benc <jbenc@redhat.com>
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20211027033553.962413-4-liuhangbin@gmail.com
    liuhangbin authored and borkmann committed Nov 5, 2021
  5. selftests/bpf/xdp_redirect_multi: Use arping to accurate the arp number

    The arp request number triggered by ping none exist address is not accurate,
    which may lead the test false negative/positive. Change to use arping to
    accurate the arp number. Also do not use grep pattern match for dot.
    
    Fixes: d232924 ("selftests/bpf: Add xdp_redirect_multi test")
    Suggested-by: Jiri Benc <jbenc@redhat.com>
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20211027033553.962413-3-liuhangbin@gmail.com
    liuhangbin authored and borkmann committed Nov 5, 2021
  6. selftests/bpf/xdp_redirect_multi: Put the logs to tmp folder

    The xdp_redirect_multi test logs are created in selftest folder and not cleaned
    after test. Let's creat a tmp dir and remove the logs after testing.
    
    Fixes: d232924 ("selftests/bpf: Add xdp_redirect_multi test")
    Suggested-by: Jiri Benc <jbenc@redhat.com>
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20211027033553.962413-2-liuhangbin@gmail.com
    liuhangbin authored and borkmann committed Nov 5, 2021
  7. libbpf: Fix lookup_and_delete_elem_flags error reporting

    Fix bpf_map_lookup_and_delete_elem_flags() to pass the return code through
    libbpf_err_errno() as we do similarly in bpf_map_lookup_and_delete_elem().
    
    Fixes: f12b654 ("libbpf: Streamline error reporting for low-level APIs")
    Signed-off-by: Mehrdad Arshad Rad <arshad.rad@gmail.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Yonghong Song <yhs@fb.com>
    Link: https://lore.kernel.org/bpf/20211104171354.11072-1-arshad.rad@gmail.com
    mehrdadrad authored and borkmann committed Nov 5, 2021
  8. bpftool: Install libbpf headers for the bootstrap version, too

    We recently changed bpftool's Makefile to make it install libbpf's
    headers locally instead of pulling them from the source directory of the
    library. Although bpftool needs two versions of libbpf, a "regular" one
    and a "bootstrap" version, we would only install headers for the regular
    libbpf build. Given that this build always occurs before the bootstrap
    build when building bpftool, this is enough to ensure that the bootstrap
    bpftool will have access to the headers exported through the regular
    libbpf build.
    
    However, this did not account for the case when we only want the
    bootstrap version of bpftool, through the "bootstrap" target. For
    example, perf needs the bootstrap version only, to generate BPF
    skeletons. In that case, when are the headers installed? For some time,
    the issue has been masked, because we had a step (the installation of
    headers internal to libbpf) which would depend on the regular build of
    libbpf and hence trigger the export of the headers, just for the sake of
    creating a directory. But this changed with commit 8b6c462
    ("bpftool: Remove Makefile dep. on $(LIBBPF) for
    $(LIBBPF_INTERNAL_HDRS)"), where we cleaned up that stage and removed
    the dependency on the regular libbpf build. As a result, when we only
    want the bootstrap bpftool version, the regular libbpf is no longer
    built. The bootstrap libbpf version is built, but headers are not
    exported, and the bootstrap bpftool build fails because of the missing
    headers.
    
    To fix this, we also install the library headers for the bootstrap
    version of libbpf, to use them for the bootstrap bpftool and for
    generating the skeletons.
    
    Fixes: f012ade ("bpftool: Install libbpf headers instead of including the dir")
    Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Quentin Monnet <quentin@isovalent.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Link: https://lore.kernel.org/bpf/20211105015813.6171-1-quentin@isovalent.com
    qmonnet authored and borkmann committed Nov 5, 2021
  9. net: marvell: prestera: fix patchwork build problems

    fix the remaining build issues reported by patchwork
    in firmware v4.0 support commit which has been already
    merged.
    
    Fix patchwork issues:
     - source inline
     - checkpatch
    
    Fixes: bb5dbf2 ("net: marvell: prestera: add firmware v4.0 support")
    Signed-off-by: Volodymyr Mytnyk <vmytnyk@marvell.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Volodymyr Mytnyk authored and davem330 committed Nov 5, 2021
Older