1. 02 7月, 2021 1 次提交
    • H
      octeontx2-af: cn10k: Setting up lmtst map table · 873a1e3d
      Harman Kalra 提交于
      Introducing a new mailbox to support updating lmt entries
      and common lmt base address scheme i.e. multiple pcifuncs
      can share lmt region to reduce L1 cache pressure for application.
      Parameters passed to mailbox includes the primary pcifunc
      value whose lmt regions will be shared by other secondary
      pcifuncs. Here secondary pcifunc will be the one who is
      calling the mailbox.
      For example:
      By default each pcifunc has its own LMT base address:
              PCIFUNC1    LMT_BASE_ADDR A
              PCIFUNC2    LMT_BASE_ADDR B
              PCIFUNC3    LMT_BASE_ADDR C
              PCIFUNC4    LMT_BASE_ADDR D
      Application will choose PCIFUNC1 as base/primary pcifunc
      and as and when other pcifunc(secondary pcifuncs) gets
      probed, this mailbox will be called and LMTST table will
      be updated as:
              PCIFUNC1    LMT_BASE_ADDR A
              PCIFUNC2    LMT_BASE_ADDR A
              PCIFUNC3    LMT_BASE_ADDR A
              PCIFUNC4    LMT_BASE_ADDR A
      
      On FLR lmtst map table gets resetted to the default lmt
      base addresses for all secondary pcifuncs.
      Signed-off-by: NHarman Kalra <hkalra@marvell.com>
      Signed-off-by: NGeetha sowjanya <gakula@marvell.com>
      Signed-off-by: NSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      873a1e3d
  2. 29 6月, 2021 1 次提交
    • V
      net: switchdev: add a context void pointer to struct switchdev_notifier_info · 69bfac96
      Vladimir Oltean 提交于
      In the case where the driver asks for a replay of a certain type of
      event (port object or attribute) for a bridge port that is a LAG, it may
      do so because this port has just joined the LAG.
      
      But there might already be other switchdev ports in that LAG, and it is
      preferable that those preexisting switchdev ports do not act upon the
      replayed event.
      
      The solution is to add a context to switchdev events, which is NULL most
      of the time (when the bridge layer initiates the call) but which can be
      set to a value controlled by the switchdev driver when a replay is
      requested. The driver can then check the context to figure out if all
      ports within the LAG should act upon the switchdev event, or just the
      ones that match the context.
      
      We have to modify all switchdev_handle_* helper functions as well as the
      prototypes in the drivers that use these helpers too, because these
      helpers hide the underlying struct switchdev_notifier_info from us and
      there is no way to retrieve the context otherwise.
      
      The context structure will be populated and used in later patches.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      69bfac96
  3. 26 6月, 2021 1 次提交
    • M
      net: mdiobus: withdraw fwnode_mdbiobus_register · ac53c264
      Marcin Wojtas 提交于
      The newly implemented fwnode_mdbiobus_register turned out to be
      problematic - in case the fwnode_/of_/acpi_mdio are built as
      modules, a dependency cycle can be observed during the depmod phase of
      modules_install, eg.:
      
      depmod: ERROR: Cycle detected: fwnode_mdio -> of_mdio -> fwnode_mdio
      depmod: ERROR: Found 2 modules in dependency cycles!
      
      OR:
      
      depmod: ERROR: Cycle detected: acpi_mdio -> fwnode_mdio -> acpi_mdio
      depmod: ERROR: Found 2 modules in dependency cycles!
      
      A possible solution could be to rework fwnode_mdiobus_register,
      so that to merge the contents of acpi_mdiobus_register and
      of_mdiobus_register. However feasible, such change would
      be very intrusive and affect huge amount of the of_mdiobus_register
      users.
      
      Since there are currently 2 users of ACPI and MDIO
      (xgmac_mdio and mvmdio), withdraw the fwnode_mdbiobus_register
      and roll back to a simple 'if' condition in affected drivers.
      
      Fixes: 62a6ef6a ("net: mdiobus: Introduce fwnode_mdbiobus_register()")
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac53c264
  4. 25 6月, 2021 1 次提交
    • T
      marvell: Remove rcu_read_lock() around XDP program invocation · 959ad7ec
      Toke Høiland-Jørgensen 提交于
      The mvneta and mvpp2 drivers have rcu_read_lock()/rcu_read_unlock() pairs
      around XDP program invocations. However, the actual lifetime of the objects
      referred by the XDP program invocation is longer, all the way through to
      the call to xdp_do_flush(), making the scope of the rcu_read_lock() too
      small. This turns out to be harmless because it all happens in a single
      NAPI poll cycle (and thus under local_bh_disable()), but it makes the
      rcu_read_lock() misleading.
      
      Rather than extend the scope of the rcu_read_lock(), just get rid of it
      entirely. With the addition of RCU annotations to the XDP_REDIRECT map
      types that take bh execution into account, lockdep even understands this to
      be safe, so there's really no reason to keep it around.
      Signed-off-by: NToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Marcin Wojtas <mw@semihalf.com>
      Link: https://lore.kernel.org/bpf/20210624160609.292325-13-toke@redhat.com
      959ad7ec
  5. 23 6月, 2021 5 次提交
  6. 19 6月, 2021 2 次提交
  7. 17 6月, 2021 2 次提交
  8. 16 6月, 2021 6 次提交
  9. 15 6月, 2021 3 次提交
  10. 12 6月, 2021 4 次提交
  11. 11 6月, 2021 3 次提交
  12. 10 6月, 2021 2 次提交
    • M
      mvpp2: prefetch page · 2f128eb3
      Matteo Croce 提交于
      Most of the time during the RX is caused by the compound_head() call
      done at the end of the RX loop:
      
             │     build_skb():
             [...]
             │     static inline struct page *compound_head(struct page *page)
             │     {
             │     unsigned long head = READ_ONCE(page->compound_head);
       65.23 │       ldr  x2, [x1, #8]
      
      Prefetch the page struct as soon as possible, to speedup the RX path
      noticeabily by a ~3-4% packet rate in a drop test.
      
             │     build_skb():
             [...]
             │     static inline struct page *compound_head(struct page *page)
             │     {
             │     unsigned long head = READ_ONCE(page->compound_head);
       17.92 │       ldr  x2, [x1, #8]
      Signed-off-by: NMatteo Croce <mcroce@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f128eb3
    • M
      mvpp2: prefetch right address · d8ea89fe
      Matteo Croce 提交于
      In the RX buffer, the received data starts after a headroom used to
      align the IP header and to allow prepending headers efficiently.
      The prefetch() should take this into account, and prefetch from
      the very start of the received data.
      
      We can see that ether_addr_equal_64bits(), which is the first function
      to access the data, drops from the top of the perf top output.
      
      prefetch(data):
      
      Overhead  Shared Object     Symbol
        11.64%  [kernel]          [k] eth_type_trans
      
      prefetch(data + MVPP2_MH_SIZE + MVPP2_SKB_HEADROOM):
      
      Overhead  Shared Object     Symbol
        13.42%  [kernel]          [k] build_skb
        10.35%  [mvpp2]           [k] mvpp2_rx
         9.35%  [kernel]          [k] __netif_receive_skb_core
         8.24%  [kernel]          [k] kmem_cache_free
         7.97%  [kernel]          [k] dev_gro_receive
         7.68%  [kernel]          [k] page_pool_put_page
         7.32%  [kernel]          [k] kmem_cache_alloc
         7.09%  [mvpp2]           [k] mvpp2_bm_pool_put
         3.36%  [kernel]          [k] eth_type_trans
      
      Also, move the eth_type_trans() call a bit down, to give the RAM more
      time to prefetch the data.
      Signed-off-by: NMatteo Croce <mcroce@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d8ea89fe
  13. 08 6月, 2021 4 次提交
    • M
      mvneta: recycle buffers · e4017570
      Matteo Croce 提交于
      Use the new recycling API for page_pool.
      In a drop rate test, the packet rate increased by 10%,
      from 296 Kpps to 326 Kpps.
      
      perf top on a stock system shows:
      
      Overhead  Shared Object     Symbol
        23.66%  [kernel]          [k] __pi___inval_dcache_area
        22.85%  [mvneta]          [k] mvneta_rx_swbm
         7.54%  [kernel]          [k] kmem_cache_alloc
         6.49%  [kernel]          [k] eth_type_trans
         3.94%  [kernel]          [k] dev_gro_receive
         3.91%  [kernel]          [k] __netif_receive_skb_core
         3.91%  [kernel]          [k] kmem_cache_free
         3.76%  [kernel]          [k] page_pool_release_page
         3.56%  [kernel]          [k] free_unref_page
         2.40%  [kernel]          [k] build_skb
         1.49%  [kernel]          [k] skb_release_data
         1.45%  [kernel]          [k] __alloc_pages_bulk
         1.30%  [kernel]          [k] page_frag_free
      
      And this is the same output with recycling enabled:
      
      Overhead  Shared Object     Symbol
        26.41%  [kernel]          [k] __pi___inval_dcache_area
        25.00%  [mvneta]          [k] mvneta_rx_swbm
         8.14%  [kernel]          [k] kmem_cache_alloc
         6.84%  [kernel]          [k] eth_type_trans
         4.44%  [kernel]          [k] __netif_receive_skb_core
         4.38%  [kernel]          [k] kmem_cache_free
         4.16%  [kernel]          [k] dev_gro_receive
         3.21%  [kernel]          [k] page_pool_put_page
         2.41%  [kernel]          [k] build_skb
         1.82%  [kernel]          [k] skb_release_data
         1.61%  [kernel]          [k] napi_gro_receive
         1.25%  [kernel]          [k] page_pool_refill_alloc_cache
         1.16%  [kernel]          [k] __netif_receive_skb_list_core
      
      We can see that page_pool_release_page(), free_unref_page() and
      __alloc_pages_bulk() are no longer on top of the list when receiving
      traffic.
      
      The test was done with mausezahn on the TX side with 64 byte raw
      ethernet frames.
      Signed-off-by: NMatteo Croce <mcroce@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e4017570
    • M
      mvpp2: recycle buffers · 133637fc
      Matteo Croce 提交于
      Use the new recycling API for page_pool.
      In a drop rate test, the packet rate is almost doubled,
      from 1110 Kpps to 2128 Kpps.
      
      perf top on a stock system shows:
      
      Overhead  Shared Object     Symbol
        34.88%  [kernel]          [k] page_pool_release_page
         8.06%  [kernel]          [k] free_unref_page
         6.42%  [mvpp2]           [k] mvpp2_rx
         6.07%  [kernel]          [k] eth_type_trans
         5.18%  [kernel]          [k] __netif_receive_skb_core
         4.95%  [kernel]          [k] build_skb
         4.88%  [kernel]          [k] kmem_cache_free
         3.97%  [kernel]          [k] kmem_cache_alloc
         3.45%  [kernel]          [k] dev_gro_receive
         2.73%  [kernel]          [k] page_frag_free
         2.07%  [kernel]          [k] __alloc_pages_bulk
         1.99%  [kernel]          [k] arch_local_irq_save
         1.84%  [kernel]          [k] skb_release_data
         1.20%  [kernel]          [k] netif_receive_skb_list_internal
      
      With packet rate stable at 1100 Kpps:
      
      tx: 0 bps 0 pps rx: 532.7 Mbps 1110 Kpps
      tx: 0 bps 0 pps rx: 532.6 Mbps 1110 Kpps
      tx: 0 bps 0 pps rx: 532.4 Mbps 1109 Kpps
      tx: 0 bps 0 pps rx: 532.1 Mbps 1109 Kpps
      tx: 0 bps 0 pps rx: 531.9 Mbps 1108 Kpps
      tx: 0 bps 0 pps rx: 531.9 Mbps 1108 Kpps
      
      And this is the same output with recycling enabled:
      
      Overhead  Shared Object     Symbol
        12.91%  [kernel]          [k] eth_type_trans
        12.54%  [mvpp2]           [k] mvpp2_rx
         9.67%  [kernel]          [k] build_skb
         9.63%  [kernel]          [k] __netif_receive_skb_core
         8.44%  [kernel]          [k] page_pool_put_page
         8.07%  [kernel]          [k] kmem_cache_free
         7.79%  [kernel]          [k] kmem_cache_alloc
         6.86%  [kernel]          [k] dev_gro_receive
         3.19%  [kernel]          [k] skb_release_data
         2.41%  [kernel]          [k] netif_receive_skb_list_internal
         2.18%  [kernel]          [k] page_pool_refill_alloc_cache
         1.76%  [kernel]          [k] napi_gro_receive
         1.61%  [kernel]          [k] kfree_skb
         1.20%  [kernel]          [k] dma_sync_single_for_device
         1.16%  [mvpp2]           [k] mvpp2_poll
         1.12%  [mvpp2]           [k] mvpp2_read
      
      With packet rate above 2100 Kpps:
      
      tx: 0 bps 0 pps rx: 1021 Mbps 2128 Kpps
      tx: 0 bps 0 pps rx: 1021 Mbps 2127 Kpps
      tx: 0 bps 0 pps rx: 1021 Mbps 2128 Kpps
      tx: 0 bps 0 pps rx: 1021 Mbps 2128 Kpps
      tx: 0 bps 0 pps rx: 1022 Mbps 2128 Kpps
      tx: 0 bps 0 pps rx: 1022 Mbps 2129 Kpps
      
      The major performance increase is explained by the fact that the most CPU
      consuming functions (page_pool_release_page, page_frag_free and
      free_unref_page) are no longer called on a per packet basis.
      
      The test was done by sending to the macchiatobin 64 byte ethernet frames
      with an invalid ethertype, so the packets are dropped early in the RX path.
      Signed-off-by: NMatteo Croce <mcroce@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      133637fc
    • M
      skbuff: add a parameter to __skb_frag_unref · c420c989
      Matteo Croce 提交于
      This is a prerequisite patch, the next one is enabling recycling of
      skbs and fragments. Add an extra argument on __skb_frag_unref() to
      handle recycling, and update the current users of the function with that.
      Signed-off-by: NMatteo Croce <mcroce@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c420c989
    • Y
      net: mvpp2: check return value after calling platform_get_resource() · 0bb51a3a
      Yang Yingliang 提交于
      It will cause null-ptr-deref if platform_get_resource() returns NULL,
      we need check the return value.
      Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0bb51a3a
  14. 02 6月, 2021 5 次提交