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

Commits on Nov 11, 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 11, 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 11, 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
      - link_10m: Keep LED on with 10m link speed
      - link_100m: Keep LED on with 100m link speed
      - link_1000m: Keep LED on with 1000m link speed
      - half_duplex: Keep LED on with half duplex link
      - 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
    
    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.
    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
    hardware-phy-activity subdir.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 11, 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 11, 2021
  5. leds: trigger: netdev: rename and expose NETDEV trigger enum and struct

    A LED driver, to support hardware control, requires to support a specific
    trigger and requires to elaborate his trigger_data struct.
    Move netdev trigger data struct to leds.h to make it accessible by any
    LED driver that wants to add support for hardware control for the
    specific netdev trigger.
    Also rename NETDEV trigger enum modes to a more symbolic and descriptive
    name.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 11, 2021
  6. leds: trigger: netdev: drop NETDEV_LED_MODE_LINKUP from mode

    NETDEV_LED_MODE_LINKUP is not strictly a blink mode but really a status
    of the current situation of the carrier. It seems wrong to accomunate a
    link status to the blink mode list and would cause some confusion as
    someone would think that MODE_LINKUP is a separate mode that provide the
    netdev trigger with the other 3 LINK, RX and TX.
    
    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 11, 2021
  7. leds: document additional use of blink_set for hardware control

    blink_set can now be used also to configure blink modes when hardware
    control is supported and active.
    Trigger will try to use blink_set and a LED driver will use the
    trigger_data to configure the blink_modes once blink_set is called.
    Setting a brightness to LED_OFF will reset any blink mode and disable
    hardware control setting the LED off.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Nov 11, 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 control mode supported and should
    set the LED_SOFTWARE_CONTROLLED or LED_HARDWARE_CONTROLLED bit in the
    flags parameter.
    The trigger will check these bit and fail to activate if the control mode
    is not supported. By default if a LED driver doesn't declare a control
    mode, bit LED_SOFTWARE_CONTROLLED is assumed and set by default.
    
    The LED must implement 3 main API:
    - hw_control_status(): This asks the LED driver if hardware mode is
        enabled or not.
    - hw_control_start(): This will simply enable the hardware mode for the
        LED and the LED driver should reset any active blink_mode.
    - hw_control_stop(): This will simply disable the hardware mode for the
        LED. It's advised for the driver to put the LED in the old state but
        this is not enforced and putting the LED off is also accepted.
    
    If LED_HARDWARE_CONTROLLED bit is the only contro mode set
    (LED_SOFTWARE_CONTROLLED not set) set hw_control_status/start/stop is
    optional as the LED supports only hardware mode and any software only
    trigger will reject activation.
    
    On init a LED driver that support a hardware mode should reset every
    blink mode set by default.
    
    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 11, 2021

Commits on Nov 10, 2021

  1. net/smc: fix sk_refcnt underflow on linkdown and fallback

    We got the following WARNING when running ab/nginx
    test with RDMA link flapping (up-down-up).
    The reason is when smc_sock fallback and at linkdown
    happens simultaneously, we may got the following situation:
    
    __smc_lgr_terminate()
     --> smc_conn_kill()
        --> smc_close_active_abort()
               smc_sock->sk_state = SMC_CLOSED
               sock_put(smc_sock)
    
    smc_sock was set to SMC_CLOSED and sock_put() been called
    when terminate the link group. But later application call
    close() on the socket, then we got:
    
    __smc_release():
        if (smc_sock->fallback)
            smc_sock->sk_state = SMC_CLOSED
            sock_put(smc_sock)
    
    Again we set the smc_sock to CLOSED through it's already
    in CLOSED state, and double put the refcnt, so the following
    warning happens:
    
    refcount_t: underflow; use-after-free.
    WARNING: CPU: 5 PID: 860 at lib/refcount.c:28 refcount_warn_saturate+0x8d/0xf0
    Modules linked in:
    CPU: 5 PID: 860 Comm: nginx Not tainted 5.10.46+ torvalds#403
    Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 8c24b4c 04/01/2014
    RIP: 0010:refcount_warn_saturate+0x8d/0xf0
    Code: 05 5c 1e b5 01 01 e8 52 25 bc ff 0f 0b c3 80 3d 4f 1e b5 01 00 75 ad 48
    
    RSP: 0018:ffffc90000527e50 EFLAGS: 00010286
    RAX: 0000000000000026 RBX: ffff8881300df2c0 RCX: 0000000000000027
    RDX: 0000000000000000 RSI: ffff88813bd58040 RDI: ffff88813bd58048
    RBP: 0000000000000000 R08: 0000000000000003 R09: 0000000000000001
    R10: ffff8881300df2c0 R11: ffffc90000527c78 R12: ffff8881300df340
    R13: ffff8881300df930 R14: ffff88810b3dad80 R15: ffff8881300df4f8
    FS:  00007f739de8fb80(0000) GS:ffff88813bd40000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 000000000a01b008 CR3: 0000000111b64003 CR4: 00000000003706e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
     smc_release+0x353/0x3f0
     __sock_release+0x3d/0xb0
     sock_close+0x11/0x20
     __fput+0x93/0x230
     task_work_run+0x65/0xa0
     exit_to_user_mode_prepare+0xf9/0x100
     syscall_exit_to_user_mode+0x27/0x190
     entry_SYSCALL_64_after_hwframe+0x44/0xa9
    
    This patch adds check in __smc_release() to make
    sure we won't do an extra sock_put() and set the
    socket to CLOSED when its already in CLOSED state.
    
    Fixes: 51f1de7 (net/smc: replace sock_put worker by socket refcounting)
    Signed-off-by: Dust Li <dust.li@linux.alibaba.com>
    Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
    Signed-off-by: Dust Li <dust.li@linux.alibaba.com>
    Acked-by: Karsten Graul <kgraul@linux.ibm.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Dust Li authored and davem330 committed Nov 10, 2021
  2. net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer()

    There is a minus character missing from ERR_PTR(ENOMEM) so if this
    allocation fails it will lead to an Oops in the caller.
    
    Fixes: dc48516 ("net/mlx5: Lag, add support to create definers for LAG")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    error27 authored and davem330 committed Nov 10, 2021
  3. gve: fix unmatched u64_stats_update_end()

    The u64_stats_update_end() call is supposed to be inside the curly
    braces so it pairs with the u64_stats_update_begin().
    
    Fixes: 37149e9 ("gve: Implement packet continuation for RX.")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    error27 authored and davem330 committed Nov 10, 2021
  4. net: ethernet: lantiq_etop: Fix compilation error

    This fixes the error detected when compiling the driver.
    
    Fixes: 14d4e30 ("net: lantiq: configure the burst length in ethernet drivers")
    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    abajk authored and davem330 committed Nov 10, 2021
  5. selftests: forwarding: Fix packet matching in mirroring selftests

    In commit 6de6e46 ("cls_flower: Fix inability to match GRE/IPIP
    packets"), cls_flower was fixed to match an outer packet of a tunneled
    packet as would be expected, rather than dissecting to the inner packet and
    matching on that.
    
    This fix uncovered several issues in packet matching in mirroring
    selftests:
    
    - in mirror_gre_bridge_1d_vlan.sh and mirror_gre_vlan_bridge_1q.sh, the
      vlan_ethtype match is copied around as "ip", even as some of the tests
      are running over ip6gretap. This is fixed by using an "ipv6" for
      vlan_ethtype in the ip6gretap tests.
    
    - in mirror_gre_changes.sh, a filter to count GRE packets is set up to
      match TTL of 50. This used to trigger in the offloaded datapath, where
      the envelope TTL was matched, but not in the software datapath, which
      considered TTL of the inner packet. Now that both match consistently, all
      the packets were double-counted. This is fixed by marking the filter as
      skip_hw, leaving only the SW datapath component active.
    
    Fixes: 6de6e46 ("cls_flower: Fix inability to match GRE/IPIP packets")
    Signed-off-by: Petr Machata <petrm@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    pmachata authored and davem330 committed Nov 10, 2021
  6. vsock: prevent unnecessary refcnt inc for nonblocking connect

    Currently vosck_connect() increments sock refcount for nonblocking
    socket each time it's called, which can lead to memory leak if
    it's called multiple times because connect timeout function decrements
    sock refcount only once.
    
    Fixes it by making vsock_connect() return -EALREADY immediately when
    sock state is already SS_CONNECTING.
    
    Fixes: d021c34 ("VSOCK: Introduce VM Sockets")
    Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
    Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Etsukata authored and davem330 committed Nov 10, 2021
  7. net: marvell: mvpp2: Fix wrong SerDes reconfiguration order

    Commit bfe301e ("net: mvpp2: convert to use
    mac_prepare()/mac_finish()") introduced a bug wherein it leaves the MAC
    RESET register asserted after mac_finish(), due to wrong order of
    function calls.
    
    Before it was:
      .mac_config()
        mvpp22_mode_reconfigure()
          assert reset
        mvpp2_xlg_config()
          deassert reset
    
    Now it is:
      .mac_prepare()
      .mac_config()
        mvpp2_xlg_config()
          deassert reset
      .mac_finish()
        mvpp2_xlg_config()
          assert reset
    
    Obviously this is wrong.
    
    This bug is triggered when phylink tries to change the PHY interface
    mode from a GMAC mode (sgmii, 1000base-x, 2500base-x) to XLG mode
    (10gbase-r, xaui). The XLG mode does not work since reset is left
    asserted. Only after
      ifconfig down && ifconfig up
    is called will the XLG mode work.
    
    Move the call to mvpp22_mode_reconfigure() to .mac_prepare()
    implementation. Since some of the subsequent functions need to know
    whether the interface is being changed, we unfortunately also need to
    pass around the new interface mode before setting port->phy_interface.
    
    Fixes: bfe301e ("net: mvpp2: convert to use mac_prepare()/mac_finish()")
    Signed-off-by: Marek Behún <kabel@kernel.org>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    elkablo authored and davem330 committed Nov 10, 2021
  8. net: ethernet: ti: cpsw_ale: Fix access to un-initialized memory

    It is spurious to allocate a bitmap without initializing it.
    So, better safe than sorry, initialize it to 0 at least to have some known
    values.
    
    While at it, switch to the devm_bitmap_ API which is less verbose.
    
    Fixes: 4b41d34 ("net: ethernet: ti: cpsw: allow untagged traffic on host port")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    tititiou36 authored and davem330 committed Nov 10, 2021
  9. net: stmmac: allow a tc-taprio base-time of zero

    Commit fe28c53 ("net: stmmac: fix taprio configuration when
    base_time is in the past") allowed some base time values in the past,
    but apparently not all, the base-time value of 0 (Jan 1st 1970) is still
    explicitly denied by the driver.
    
    Remove the bogus check.
    
    Fixes: b60189e ("net: stmmac: Integrate EST with TAPRIO scheduler API")
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Nov 10, 2021
  10. selftests: net: test_vxlan_under_vrf: fix HV connectivity test

    It looks like test_vxlan_under_vrf.sh is always failing to verify the
    connectivity test during the ping between the two simulated VMs.
    
    This is due to the fact that veth-hv in each VM should have a distinct
    MAC address.
    
    Fix by setting a unique MAC address on each simulated VM interface.
    
    Without this fix:
    
     $ sudo ./tools/testing/selftests/net/test_vxlan_under_vrf.sh
     Checking HV connectivity                                           [ OK ]
     Check VM connectivity through VXLAN (underlay in the default VRF)  [FAIL]
    
    With this fix applied:
    
     $ sudo ./tools/testing/selftests/net/test_vxlan_under_vrf.sh
     Checking HV connectivity                                           [ OK ]
     Check VM connectivity through VXLAN (underlay in the default VRF)  [ OK ]
     Check VM connectivity through VXLAN (underlay in a VRF)            [FAIL]
    
    NOTE: the connectivity test with the underlay VRF is still failing; it
    seems that ARP requests are blocked at the simulated hypervisor level,
    probably due to some missing ARP forwarding rules. This requires more
    investigation (in the meantime we may consider to set that test as
    expected failure - XFAIL).
    
    Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Andrea Righi authored and davem330 committed Nov 10, 2021
  11. Merge branch 'hns3-fixes'

    Guangbin Huang says:
    
    ====================
    net: hns3: add some fixes for -net
    
    This series adds some fixes for the HNS3 ethernet driver.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Nov 10, 2021
  12. net: hns3: allow configure ETS bandwidth of all TCs

    Currently, driver only allow configuring ETS bandwidth of TCs according
    to the max TC number queried from firmware. However, the hardware actually
    supports 8 TCs and users may need to configure ETS bandwidth of all TCs,
    so remove the restriction.
    
    Fixes: 330baff ("net: hns3: add ETS TC weight setting in SSU module")
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Guangbin Huang authored and davem330 committed Nov 10, 2021
  13. net: hns3: remove check VF uc mac exist when set by PF

    If users set unicast mac address for VFs by PF, they need to guarantee all
    VFs' address is different. This patch removes the check mac address exist
    of VFs, for usrs can refresh mac addresses of all VFs directly without
    need to modify the exist mac address to other value firstly.
    
    Fixes: 8e6de44 ("net: hns3: add support for configuring VF MAC from the host")
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Guangbin Huang authored and davem330 committed Nov 10, 2021
  14. net: hns3: fix some mac statistics is always 0 in device version V2

    When driver queries the register number of mac statistics from firmware,
    the old firmware runs in device version V2 only returns number of valid
    registers, not include number of three reserved registers among of them.
    It cause driver doesn't record the last three data when query mac
    statistics.
    
    To fix this problem, driver never query register number in device version
    V2 and set it to a fixed value which include three reserved registers.
    
    Fixes: c8af288 ("net: hns3: add support pause/pfc durations for mac statistics")
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Guangbin Huang authored and davem330 committed Nov 10, 2021
  15. net: hns3: fix kernel crash when unload VF while it is being reset

    When fully configure VLANs for a VF, then unload the VF while
    triggering a reset to PF, will cause a kernel crash because the
    irq is already uninit.
    
    [ 293.177579] ------------[ cut here ]------------
    [ 293.183502] kernel BUG at drivers/pci/msi.c:352!
    [ 293.189547] Internal error: Oops - BUG: 0 [#1] SMP
    ......
    [ 293.390124] Workqueue: hclgevf hclgevf_service_task [hclgevf]
    [ 293.402627] pstate: 80c00009 (Nzcv daif +PAN +UAO)
    [ 293.414324] pc : free_msi_irqs+0x19c/0x1b8
    [ 293.425429] lr : free_msi_irqs+0x18c/0x1b8
    [ 293.436545] sp : ffff00002716fbb0
    [ 293.446950] x29: ffff00002716fbb0 x28: 0000000000000000
    [ 293.459519] x27: 0000000000000000 x26: ffff45b91ea16b00
    [ 293.472183] x25: 0000000000000000 x24: ffffa587b08f4700
    [ 293.484717] x23: ffffc591ac30e000 x22: ffffa587b08f8428
    [ 293.497190] x21: ffffc591ac30e300 x20: 0000000000000000
    [ 293.509594] x19: ffffa58a062a8300 x18: 0000000000000000
    [ 293.521949] x17: 0000000000000000 x16: ffff45b91dcc3f48
    [ 293.534013] x15: 0000000000000000 x14: 0000000000000000
    [ 293.545883] x13: 0000000000000040 x12: 0000000000000228
    [ 293.557508] x11: 0000000000000020 x10: 0000000000000040
    [ 293.568889] x9 : ffff45b91ea1e190 x8 : ffffc591802d0000
    [ 293.580123] x7 : ffffc591802d0148 x6 : 0000000000000120
    [ 293.591190] x5 : ffffc591802d0000 x4 : 0000000000000000
    [ 293.602015] x3 : 0000000000000000 x2 : 0000000000000000
    [ 293.612624] x1 : 00000000000004a4 x0 : ffffa58a1e0c6b80
    [ 293.623028] Call trace:
    [ 293.630340] free_msi_irqs+0x19c/0x1b8
    [ 293.638849] pci_disable_msix+0x118/0x140
    [ 293.647452] pci_free_irq_vectors+0x20/0x38
    [ 293.656081] hclgevf_uninit_msi+0x44/0x58 [hclgevf]
    [ 293.665309] hclgevf_reset_rebuild+0x1ac/0x2e0 [hclgevf]
    [ 293.674866] hclgevf_reset+0x358/0x400 [hclgevf]
    [ 293.683545] hclgevf_reset_service_task+0xd0/0x1b0 [hclgevf]
    [ 293.693325] hclgevf_service_task+0x4c/0x2e8 [hclgevf]
    [ 293.702307] process_one_work+0x1b0/0x448
    [ 293.710034] worker_thread+0x54/0x468
    [ 293.717331] kthread+0x134/0x138
    [ 293.724114] ret_from_fork+0x10/0x18
    [ 293.731324] Code: f940b000 b4ffff00 a903e7b8 f90017b6 (d4210000)
    
    This patch fixes the problem by waiting for the VF reset done
    while unloading the VF.
    
    Fixes: e2cb1de ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
    Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Yufeng Mo authored and davem330 committed Nov 10, 2021
  16. net: hns3: sync rx ring head in echo common pull

    When the driver processes rx packets, the head pointer is updated only
    after the number of received packets reaches 16. However, hardware
    relies on the head pointer to calculate the number of FBDs. As a result,
    the hardware calculates the FBD incorrectly. Therefore, the driver
    proactively updates the head pointer in each common poll to ensure that
    the number of FBDs calculated by the hardware is correct.
    
    Fixes: 68752b2 ("net: hns3: schedule the polling again when allocation fails")
    Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Yufeng Mo authored and davem330 committed Nov 10, 2021
  17. net: hns3: fix pfc packet number incorrect after querying pfc parameters

    Currently, driver will send command to firmware to query pfc packet number
    when user uses dcb tool to get pfc parameters. However, the periodic
    service task will also periodically query and record MAC statistics,
    including pfc packet number.
    
    As the hardware registers of statistics is cleared after reading, it will
    cause pfc packet number of MAC statistics are not correct after using dcb
    tool to get pfc parameters.
    
    To fix this problem, when user uses dcb tool to get pfc parameters, driver
    updates MAC statistics firstly and then get pfc packet number from MAC
    statistics.
    
    Fixes: 64fd230 ("net: hns3: add support for querying pfc puase packets statistic")
    Signed-off-by: Jie Wang <wangjie125@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Jie Wang authored and davem330 committed Nov 10, 2021
  18. net: hns3: fix ROCE base interrupt vector initialization bug

    Currently, NIC init ROCE interrupt vector with MSIX interrupt. But ROCE use
    pci_irq_vector() to get interrupt vector, which adds the relative interrupt
    vector again and gets wrong interrupt vector.
    
    So fixes it by assign relative interrupt vector to ROCE instead of MSIX
    interrupt vector and delete the unused struct member base_msi_vector
    declaration of hclgevf_dev.
    
    Fixes: 46a3df9 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
    Signed-off-by: Jie Wang <wangjie125@huawei.com>
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Jie Wang authored and davem330 committed Nov 10, 2021
  19. net: hns3: fix failed to add reuse multicast mac addr to hardware whe…

    …n mc mac table is full
    
    Currently, when driver is failed to add a new multicast mac address to
    hardware due to the multicast mac table is full, it will directly return.
    In this case, if the multicast mac list has some reuse addresses after the
    new address, those reuse addresses will never be added to hardware.
    
    To fix this problem, if function hclge_add_mc_addr_common() returns
    -ENOSPC, hclge_sync_vport_mac_list() should judge whether continue or
    stop to add next address.
    
    As function hclge_sync_vport_mac_list() needs parameter mac_type to know
    whether is uc or mc, refine this function to add parameter mac_type and
    remove parameter sync. So does function hclge_unsync_vport_mac_list().
    
    Fixes: ee4bcd3 ("net: hns3: refactor the MAC address configure")
    Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Guangbin Huang authored and davem330 committed Nov 10, 2021
  20. net: mana: Fix spelling mistake "calledd" -> "called"

    There is a spelling mistake in a dev_info message. Fix it.
    
    Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
    Reviewed-by: Dexuan Cui <decui@microsoft.com>
    Link: https://lore.kernel.org/r/20211108201817.43121-1-colin.i.king@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Colin Ian King authored and Jakub Kicinski committed Nov 10, 2021
  21. net/sched: sch_taprio: fix undefined behavior in ktime_mono_to_any

    1) if q->tk_offset == TK_OFFS_MAX, then get_tcp_tstamp() calls
       ktime_mono_to_any() with out-of-bound value.
    
    2) if q->tk_offset is changed in taprio_parse_clockid(),
       taprio_get_time() might also call ktime_mono_to_any()
       with out-of-bound value as sysbot found:
    
    UBSAN: array-index-out-of-bounds in kernel/time/timekeeping.c:908:27
    index 3 is out of range for type 'ktime_t *[3]'
    CPU: 1 PID: 25668 Comm: kworker/u4:0 Not tainted 5.15.0-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet
    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
     ktime_mono_to_any+0x1d4/0x1e0 kernel/time/timekeeping.c:908
     get_tcp_tstamp net/sched/sch_taprio.c:322 [inline]
     get_packet_txtime net/sched/sch_taprio.c:353 [inline]
     taprio_enqueue_one+0x5b0/0x1460 net/sched/sch_taprio.c:420
     taprio_enqueue+0x3b1/0x730 net/sched/sch_taprio.c:485
     dev_qdisc_enqueue+0x40/0x300 net/core/dev.c:3785
     __dev_xmit_skb net/core/dev.c:3869 [inline]
     __dev_queue_xmit+0x1f6e/0x3630 net/core/dev.c:4194
     batadv_send_skb_packet+0x4a9/0x5f0 net/batman-adv/send.c:108
     batadv_iv_ogm_send_to_if net/batman-adv/bat_iv_ogm.c:393 [inline]
     batadv_iv_ogm_emit net/batman-adv/bat_iv_ogm.c:421 [inline]
     batadv_iv_send_outstanding_bat_ogm_packet+0x6d7/0x8e0 net/batman-adv/bat_iv_ogm.c:1701
     process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298
     worker_thread+0x658/0x11f0 kernel/workqueue.c:2445
     kthread+0x405/0x4f0 kernel/kthread.c:327
     ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
    
    Fixes: 7ede7b0 ("taprio: make clock reference conversions easier")
    Fixes: 5400206 ("taprio: Adjust timestamps for TCP packets")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Vedang Patel <vedang.patel@intel.com>
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Reviewed-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    Link: https://lore.kernel.org/r/20211108180815.1822479-1-eric.dumazet@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    neebe000 authored and Jakub Kicinski committed Nov 10, 2021
  22. amt: use cancel_delayed_work() instead of flush_delayed_work() in amt…

    …_fini()
    
    When the amt module is being removed, it calls flush_delayed_work() to exit
    source_gc_wq. But it wouldn't be exited properly because the
    amt_source_gc_work(), which is the callback function of source_gc_wq
    internally calls mod_delayed_work() again.
    So, amt_source_gc_work() would be called after the amt module is removed.
    Therefore kernel panic would occur.
    In order to avoid it, cancel_delayed_work() should be used instead of
    flush_delayed_work().
    
    Test commands:
       modprobe amt
       modprobe -rv amt
    
    Splat looks like:
     BUG: unable to handle page fault for address: fffffbfff80f50db
     #PF: supervisor read access in kernel mode
     #PF: error_code(0x0000) - not-present page
     PGD 1237ee067 P4D 1237ee067 PUD 1237b2067 PMD 100c11067 PTE 0
     Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN PTI
     CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.15.0+ torvalds#27
     5a0ebebc29fe5c40c68bea90197606c3a832b09f
     RIP: 0010:run_timer_softirq+0x221/0xfc0
     Code: 00 00 4c 89 e1 4c 8b 30 48 c1 e9 03 80 3c 29 00 0f 85 ed 0b 00 00
     4d 89 34 24 4d 85 f6 74 19 49 8d 7e 08 48 89 f9 48 c1 e9 03 <80> 3c 29 00
     0f 85 fa 0b 00 00 4d 89 66 08 83 04 24 01 49 89 d4 48
     RSP: 0018:ffff888119009e50 EFLAGS: 00010806
     RAX: ffff8881191f8a80 RBX: 00000000007ffe2a RCX: 1ffffffff80f50db
     RDX: ffff888119009ed0 RSI: 0000000000000008 RDI: ffffffffc07a86d8
     RBP: dffffc0000000000 R08: ffff8881191f8280 R09: ffffed102323f061
     R10: ffff8881191f8307 R11: ffffed102323f060 R12: ffff888119009ec8
     R13: 00000000000000c0 R14: ffffffffc07a86d0 R15: ffff8881191f82e8
     FS:  0000000000000000(0000) GS:ffff888119000000(0000)
     knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: fffffbfff80f50db CR3: 00000001062dc002 CR4: 00000000003706e0
     DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
     DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
     Call Trace:
      <IRQ>
      ? add_timer+0x650/0x650
      ? kvm_clock_read+0x14/0x30
      ? ktime_get+0xb9/0x180
      ? rcu_read_lock_held_common+0xe/0xa0
      ? rcu_read_lock_sched_held+0x56/0xc0
      ? rcu_read_lock_bh_held+0xa0/0xa0
      ? hrtimer_interrupt+0x271/0x790
      __do_softirq+0x1d0/0x88f
      irq_exit_rcu+0xe7/0x120
      sysvec_apic_timer_interrupt+0x8a/0xb0
      </IRQ>
      <TASK>
    [ ... ]
    
    Fixes: bc54e49 ("amt: add multicast(IGMP) report message handler")
    Signed-off-by: Taehee Yoo <ap420073@gmail.com>
    Link: https://lore.kernel.org/r/20211108145340.17208-1-ap420073@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    TaeheeYoo authored and Jakub Kicinski committed Nov 10, 2021
  23. net: dsa: mv88e6xxx: Don't support >1G speeds on 6191X on ports other…

    … than 10
    
    Model 88E6191X only supports >1G speeds on port 10. Port 0 and 9 are
    only 1G.
    
    Fixes: de776d0 ("net: dsa: mv88e6xxx: add support for mv88e6393x family")
    Signed-off-by: Marek Behún <kabel@kernel.org>
    Cc: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Link: https://lore.kernel.org/r/20211104171747.10509-1-kabel@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    elkablo authored and Jakub Kicinski committed Nov 10, 2021

Commits on Nov 9, 2021

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

    Alexei Starovoitov says:
    
    ====================
    pull-request: bpf 2021-11-09
    
    We've added 7 non-merge commits during the last 3 day(s) which contain
    a total of 10 files changed, 174 insertions(+), 48 deletions(-).
    
    The main changes are:
    
    1) Various sockmap fixes, from John and Jussi.
    
    2) Fix out-of-bound issue with bpf_pseudo_func, from Martin.
    
    * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
      bpf, sockmap: sk_skb data_end access incorrect when src_reg = dst_reg
      bpf: sockmap, strparser, and tls are reusing qdisc_skb_cb and colliding
      bpf, sockmap: Fix race in ingress receive verdict with redirect to self
      bpf, sockmap: Remove unhash handler for BPF sockmap usage
      bpf, sockmap: Use stricter sk state checks in sk_lookup_assign
      bpf: selftest: Trigger a DCE on the whole subprog
      bpf: Stop caching subprog index in the bpf_pseudo_func insn
    ====================
    
    Link: https://lore.kernel.org/r/20211109215702.38350-1-alexei.starovoitov@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Jakub Kicinski committed Nov 9, 2021
  2. amt: add IPV6 Kconfig dependency

    This driver cannot be built-in if IPV6 is a loadable module:
    
    x86_64-linux-ld: drivers/net/amt.o: in function `amt_build_mld_gq':
    amt.c:(.text+0x2e7d): undefined reference to `ipv6_dev_get_saddr'
    
    Add the idiomatic Kconfig dependency that all such modules
    have.
    
    Fixes: b9022b5 ("amt: add control plane of amt interface")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Acked-by: Taehee Yoo <ap420073@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    arndb authored and davem330 committed Nov 9, 2021
  3. gve: Fix off by one in gve_tx_timeout()

    The priv->ntfy_blocks[] has "priv->num_ntfy_blks" elements so this >
    needs to be >= to prevent an off by one bug.  The priv->ntfy_blocks[]
    array is allocated in gve_alloc_notify_blocks().
    
    Fixes: 87a7f32 ("gve: Recover from queue stall due to missed IRQ")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    error27 authored and davem330 committed Nov 9, 2021
  4. hamradio: defer 6pack kfree after unregister_netdev

    There is a possible race condition (use-after-free) like below
    
     (USE)                       |  (FREE)
      dev_queue_xmit             |
       __dev_queue_xmit          |
        __dev_xmit_skb           |
         sch_direct_xmit         | ...
          xmit_one               |
           netdev_start_xmit     | tty_ldisc_kill
            __netdev_start_xmit  |  6pack_close
             sp_xmit             |   kfree
              sp_encaps          |
                                 |
    
    According to the patch "defer ax25 kfree after unregister_netdev", this
    patch reorder the kfree after the unregister_netdev to avoid the possible
    UAF as the unregister_netdev() is well synchronized and won't return if
    there is a running routine.
    
    Signed-off-by: Lin Ma <linma@zju.edu.cn>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    f0rm2l1n authored and davem330 committed Nov 9, 2021
Older