1. 16 Feb, 2022 2 commits
  2. 15 Feb, 2022 22 commits
  3. 14 Feb, 2022 16 commits
    • Colin Ian King's avatar
      selftests: net: cmsg_sender: Fix spelling mistake "MONOTINIC" -> "MONOTONIC" · 12d8c111
      Colin Ian King authored
      There is a spelling mistake in an error message. Fix it.
      Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12d8c111
    • Volodymyr Mytnyk's avatar
      net: prestera: acl: add multi-chain support offload · fa5d824c
      Volodymyr Mytnyk authored
      Add support of rule offloading added to the non-zero index chain,
      which was previously forbidden. Also, goto action is offloaded
      allowing to jump for processing of desired chain.
      
      Note that only implicit chain 0 is bound to the device port(s) for
      processing. The rest of chains have to be jumped by actions.
      Signed-off-by: default avatarVolodymyr Mytnyk <vmytnyk@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa5d824c
    • David S. Miller's avatar
      Merge branch 'wwan-debugfs' · e81f1e0d
      David S. Miller authored
      M Chetan Kumar says:
      
      ====================
      net: wwan: debugfs dev reference not dropped
      
      This patch series contains WWAN subsystem & IOSM Driver changes to
      drop dev reference obtained as part of wwan debugfs dir entry retrieval.
      
      PATCH1: A new debugfs interface is introduced in wwan subsystem so
      that wwan driver can drop the obtained dev reference post debugfs use.
      
      PATCH2: IOSM Driver uses new debugfs interface to drop dev reference.
      
      Please refer to commit messages for details.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e81f1e0d
    • M Chetan Kumar's avatar
      net: wwan: iosm: drop debugfs dev reference · 163f69ae
      M Chetan Kumar authored
      Post debugfs use call wwan_put_debugfs_dir()to drop
      debugfs dev reference.
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      163f69ae
    • M Chetan Kumar's avatar
      net: wwan: debugfs obtained dev reference not dropped · 76f05d88
      M Chetan Kumar authored
      WWAN driver call's wwan_get_debugfs_dir() to obtain
      WWAN debugfs dir entry. As part of this procedure it
      returns a reference to a found device.
      
      Since there is no debugfs interface available at WWAN
      subsystem, it is not possible to drop dev reference post
      debugfs use. This leads to side effects like post wwan
      driver load and reload the wwan instance gets increment
      from wwanX to wwanX+1.
      
      A new debugfs interface is added in wwan subsystem so that
      wwan driver can drop the obtained dev reference post debugfs
      use.
      
      void wwan_put_debugfs_dir(struct dentry *dir)
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      76f05d88
    • David S. Miller's avatar
      Merge branch 'dsa-realtek-next' · 1e997d04
      David S. Miller authored
      Luiz Angelo Daros de Luca says:
      
      ====================
      net: dsa: realtek: realtek-mdio: reset before setup
      
      This patch series cleans the realtek-smi reset code and copy that to the
      realtek-mdio.
      
      v1-v2)
      - do not run reset code block if GPIO is missing. It was printing "RESET
        deasserted" even when there is no GPIO configured.
      - reset switch after dsa_unregister_switch()
      - demote reset messages to debug
      
      v2-v3)
      - do not assert the reset on gpiod_get. Do it explicitly aferwards.
      - split the commit into two (one for each module)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1e997d04
    • Luiz Angelo Daros de Luca's avatar
      net: dsa: realtek: realtek-mdio: reset before setup · 05f7b042
      Luiz Angelo Daros de Luca authored
      Some devices, like the switch in Banana Pi BPI R64 only starts to answer
      after a HW reset. It is the same reset code from realtek-smi.
      Reported-by: default avatarFrank Wunderlich <frank-w@public-files.de>
      Signed-off-by: default avatarLuiz Angelo Daros de Luca <luizluca@gmail.com>
      Tested-by: default avatarFrank Wunderlich <frank-w@public-files.de>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarAlvin Šipraga <alsi@bang-olufsen.dk>
      Acked-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05f7b042
    • Luiz Angelo Daros de Luca's avatar
      net: dsa: realtek: realtek-smi: clean-up reset · 9a236b54
      Luiz Angelo Daros de Luca authored
      When reset GPIO was missing, the driver was still printing an info
      message and still trying to assert the reset. Although gpiod_set_value()
      will silently ignore calls with NULL gpio_desc, it is better to make it
      clear the driver might allow gpio_desc to be NULL.
      
      The initial value for the reset pin was changed to GPIOD_OUT_LOW,
      followed by a gpiod_set_value() asserting the reset. This way, it will
      be easier to spot if and where the reset really happens.
      
      A new "asserted RESET" message was added just after the reset is
      asserted, similar to the existing "deasserted RESET" message. Both
      messages were demoted to dbg. The code comment is not needed anymore.
      Signed-off-by: default avatarLuiz Angelo Daros de Luca <luizluca@gmail.com>
      Acked-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9a236b54
    • Ido Schimmel's avatar
      ipv6: blackhole_netdev needs snmp6 counters · dd263a8c
      Ido Schimmel authored
      Whenever rt6_uncached_list_flush_dev() swaps rt->rt6_idev
      to the blackhole device, parts of IPv6 stack might still need
      to increment one SNMP counter.
      
      Root cause, patch from Ido, changelog from Eric :)
      
      This bug suggests that we need to audit rt->rt6_idev usages
      and make sure they are properly using RCU protection.
      
      Fixes: e5f80fcf ("ipv6: give an IPv6 dev to blackhole_netdev")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dd263a8c
    • Luiz Angelo Daros de Luca's avatar
      net: dsa: realtek: rename macro to match filename · 7db45f8d
      Luiz Angelo Daros de Luca authored
      The macro was missed while renaming realtek-smi.h to realtek.h.
      
      Fixes: f5f11907 (net: dsa: realtek: rename realtek_smi to)
      Signed-off-by: default avatarLuiz Angelo Daros de Luca <luizluca@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarAlvin Šipraga <alsi@bang-olufsen.dk>
      Acked-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7db45f8d
    • David S. Miller's avatar
      Merge branch 'netdev-RT' · da54d75b
      David S. Miller authored
      Sebastian Andrzej Siewior says:
      
      ====================
      net: dev: PREEMPT_RT fixups.
      
      this series removes or replaces preempt_disable() and local_irq_save()
      sections which are problematic on PREEMPT_RT.
      Patch 2 makes netif_rx() work from any context after I found suggestions
      for it in an old thread. Should that work, then the context-specific
      variants could be removed.
      
      v2…v3:
         - #2
           - Export __netif_rx() so it can be used by everyone.
           - Add a lockdep assert to check for interrupt context.
           - Update the kernel doc and mention that the skb is posted to
             backlog NAPI.
           - Use __netif_rx() also in drivers/net/*.c.
           - Added Toke''s review tag and kept Eric's desptite the changes
             made.
      
      v1…v2:
        - #1 and #2
          - merge patch 1 und 2 from the series (as per Toke).
          - updated patch description and corrected the first commit number (as
            per Eric).
         - #2
           - Provide netif_rx() as in v1 and additionally __netif_rx() without
             local_bh disable()+enable() for the loopback driver. __netif_rx() is
             not exported (loopback is built-in only) so it won't be used
             drivers. If this doesn't work then we can still export/ define a
             wrapper as Eric suggested.
           - Added a comment that netif_rx() considered legacy.
         - #3
           - Moved ____napi_schedule() into rps_ipi_queued() and
             renamed it napi_schedule_rps().
         https://lore.kernel.org/all/20220204201259.1095226-1-bigeasy@linutronix.de/
      
      v1:
         https://lore.kernel.org/all/20220202122848.647635-1-bigeasy@linutronix.de
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da54d75b
    • Sebastian Andrzej Siewior's avatar
      net: dev: Make rps_lock() disable interrupts. · e722db8d
      Sebastian Andrzej Siewior authored
      Disabling interrupts and in the RPS case locking input_pkt_queue is
      split into local_irq_disable() and optional spin_lock().
      
      This breaks on PREEMPT_RT because the spinlock_t typed lock can not be
      acquired with disabled interrupts.
      The sections in which the lock is acquired is usually short in a sense that it
      is not causing long und unbounded latiencies. One exception is the
      skb_flow_limit() invocation which may invoke a BPF program (and may
      require sleeping locks).
      
      By moving local_irq_disable() + spin_lock() into rps_lock(), we can keep
      interrupts disabled on !PREEMPT_RT and enabled on PREEMPT_RT kernels.
      Without RPS on a PREEMPT_RT kernel, the needed synchronisation happens
      as part of local_bh_disable() on the local CPU.
      ____napi_schedule() is only invoked if sd is from the local CPU. Replace
      it with __napi_schedule_irqoff() which already disables interrupts on
      PREEMPT_RT as needed. Move this call to rps_ipi_queued() and rename the
      function to napi_schedule_rps as suggested by Jakub.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e722db8d
    • Sebastian Andrzej Siewior's avatar
      net: dev: Makes sure netif_rx() can be invoked in any context. · baebdf48
      Sebastian Andrzej Siewior authored
      Dave suggested a while ago (eleven years by now) "Let's make netif_rx()
      work in all contexts and get rid of netif_rx_ni()". Eric agreed and
      pointed out that modern devices should use netif_receive_skb() to avoid
      the overhead.
      In the meantime someone added another variant, netif_rx_any_context(),
      which behaves as suggested.
      
      netif_rx() must be invoked with disabled bottom halves to ensure that
      pending softirqs, which were raised within the function, are handled.
      netif_rx_ni() can be invoked only from process context (bottom halves
      must be enabled) because the function handles pending softirqs without
      checking if bottom halves were disabled or not.
      netif_rx_any_context() invokes on the former functions by checking
      in_interrupts().
      
      netif_rx() could be taught to handle both cases (disabled and enabled
      bottom halves) by simply disabling bottom halves while invoking
      netif_rx_internal(). The local_bh_enable() invocation will then invoke
      pending softirqs only if the BH-disable counter drops to zero.
      
      Eric is concerned about the overhead of BH-disable+enable especially in
      regard to the loopback driver. As critical as this driver is, it will
      receive a shortcut to avoid the additional overhead which is not needed.
      
      Add a local_bh_disable() section in netif_rx() to ensure softirqs are
      handled if needed.
      Provide __netif_rx() which does not disable BH and has a lockdep assert
      to ensure that interrupts are disabled. Use this shortcut in the
      loopback driver and in drivers/net/*.c.
      Make netif_rx_ni() and netif_rx_any_context() invoke netif_rx() so they
      can be removed once they are no more users left.
      
      Link: https://lkml.kernel.org/r/20100415.020246.218622820.davem@davemloft.netSigned-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      baebdf48
    • Sebastian Andrzej Siewior's avatar
      net: dev: Remove preempt_disable() and get_cpu() in netif_rx_internal(). · f234ae29
      Sebastian Andrzej Siewior authored
      The preempt_disable() () section was introduced in commit
          cece1945 ("net: disable preemption before call smp_processor_id()")
      
      and adds it in case this function is invoked from preemtible context and
      because get_cpu() later on as been added.
      
      The get_cpu() usage was added in commit
          b0e28f1e ("net: netif_rx() must disable preemption")
      
      because ip_dev_loopback_xmit() invoked netif_rx() with enabled preemption
      causing a warning in smp_processor_id(). The function netif_rx() should
      only be invoked from an interrupt context which implies disabled
      preemption. The commit
         e30b38c2 ("ip: Fix ip_dev_loopback_xmit()")
      
      was addressing this and replaced netif_rx() with in netif_rx_ni() in
      ip_dev_loopback_xmit().
      
      Based on the discussion on the list, the former patch (b0e28f1e)
      should not have been applied only the latter (e30b38c2).
      
      Remove get_cpu() and preempt_disable() since the function is supposed to
      be invoked from context with stable per-CPU pointers. Bottom halves have
      to be disabled at this point because the function may raise softirqs
      which need to be processed.
      
      Link: https://lkml.kernel.org/r/20100415.013347.98375530.davem@davemloft.netSigned-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f234ae29
    • Dave Ertman's avatar
      ice: Simplify tracking status of RDMA support · 88f62aea
      Dave Ertman authored
      The status of support for RDMA is currently being tracked with two
      separate status flags. This is unnecessary with the current state of
      the driver.
      
      Simplify status tracking down to a single flag.
      
      Rename the helper function to denote the RDMA specific status and
      universally use the helper function to test the status bit.
      Signed-off-by: default avatarDave Ertman <david.m.ertman@intel.com>
      Tested-by: default avatarLeszek Kaliszczuk <leszek.kaliszczuk@intel.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88f62aea
    • David S. Miller's avatar
      Merge branch 'ocelot-stats' · d4e7592b
      David S. Miller authored
      Colin Foster says:
      
      ====================
      use bulk reads for ocelot statistics
      
      Ocelot loops over memory regions to gather stats on different ports.
      These regions are mostly continuous, and are ordered. This patch set
      uses that information to break the stats reads into regions that can get
      read in bulk.
      
      The motiviation is for general cleanup, but also for SPI. Performing two
      back-to-back reads on a SPI bus require toggling the CS line, holding,
      re-toggling the CS line, sending 3 address bytes, sending N padding
      bytes, then actually performing the read. Bulk reads could reduce almost
      all of that overhead, but require that the reads are performed via
      regmap_bulk_read.
      
      Verified with eth0 hooked up to the CPU port:
      NIC statistics:
           Good Rx Frames: 905
           Rx Octets: 78848
           Good Tx Frames: 691
           Tx Octets: 52516
           Rx + Tx 65-127 Octet Frames: 1574
           Rx + Tx 128-255 Octet Frames: 22
           Net Octets: 131364
           Rx DMA chan 0: head_enqueue: 1
           Rx DMA chan 0: tail_enqueue: 1032
           Rx DMA chan 0: busy_dequeue: 628
           Rx DMA chan 0: good_dequeue: 905
           Tx DMA chan 0: head_enqueue: 346
           Tx DMA chan 0: tail_enqueue: 345
           Tx DMA chan 0: misqueued: 345
           Tx DMA chan 0: empty_dequeue: 346
           Tx DMA chan 0: good_dequeue: 691
           p00_rx_octets: 52516
           p00_rx_unicast: 691
           p00_rx_frames_65_to_127_octets: 691
           p00_tx_octets: 78848
           p00_tx_unicast: 905
           p00_tx_frames_65_to_127_octets: 883
           p00_tx_frames_128_255_octets: 22
           p00_tx_green_prio_0: 905
      
      And with swp2 connected to swp3 with STP enabled:
      NIC statistics:
           tx_packets: 379
           tx_bytes: 19708
           rx_packets: 1
           rx_bytes: 46
           rx_octets: 64
           rx_multicast: 1
           rx_frames_below_65_octets: 1
           rx_classified_drops: 1
           tx_octets: 44630
           tx_multicast: 387
           tx_broadcast: 290
           tx_frames_below_65_octets: 379
           tx_frames_65_to_127_octets: 294
           tx_frames_128_255_octets: 4
           tx_green_prio_0: 298
           tx_green_prio_7: 379
      NIC statistics:
           tx_packets: 1
           tx_bytes: 52
           rx_packets: 713
           rx_bytes: 34148
           rx_octets: 46982
           rx_multicast: 407
           rx_broadcast: 306
           rx_frames_below_65_octets: 399
           rx_frames_65_to_127_octets: 310
           rx_frames_128_to_255_octets: 4
           rx_classified_drops: 399
           rx_green_prio_0: 314
           tx_octets: 64
           tx_multicast: 1
           tx_frames_below_65_octets: 1
           tx_green_prio_7: 1
      
      v1 > v2: reword commit messages
      v2 > v3: correctly mark this for net-next when sending
      v3 > v4: calloc array instead of zalloc per review
      v4 > v5:
          Apply CR suggestions for whitespace
          Fix calloc / zalloc mixup
          Properly destroy workqueues
          Add third commit to split long macros
      v5 > v6:
          Fix functionality - v5 was improperly tested
          Add bugfix for ethtool mutex lock
          Remove unnecessary ethtool stats reads
      v6 > v7:
          Remove mutex bug patch that was applied via net
          Rename function based on CR
          Add missed error check
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4e7592b