1. 21 5月, 2021 2 次提交
  2. 12 5月, 2021 1 次提交
  3. 08 5月, 2021 1 次提交
    • Y
      net: stmmac: Do not enable RX FIFO overflow interrupts · 8a7cb245
      Yannick Vignon 提交于
      The RX FIFO overflows when the system is not able to process all received
      packets and they start accumulating (first in the DMA queue in memory,
      then in the FIFO). An interrupt is then raised for each overflowing packet
      and handled in stmmac_interrupt(). This is counter-productive, since it
      brings the system (or more likely, one CPU core) to its knees to process
      the FIFO overflow interrupts.
      
      stmmac_interrupt() handles overflow interrupts by writing the rx tail ptr
      into the corresponding hardware register (according to the MAC spec, this
      has the effect of restarting the MAC DMA). However, without freeing any rx
      descriptors, the DMA stops right away, and another overflow interrupt is
      raised as the FIFO overflows again. Since the DMA is already restarted at
      the end of stmmac_rx_refill() after freeing descriptors, disabling FIFO
      overflow interrupts and the corresponding handling code has no side effect,
      and eliminates the interrupt storm when the RX FIFO overflows.
      Signed-off-by: NYannick Vignon <yannick.vignon@nxp.com>
      Link: https://lore.kernel.org/r/20210506143312.20784-1-yannick.vignon@oss.nxp.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      8a7cb245
  4. 01 5月, 2021 1 次提交
  5. 23 4月, 2021 1 次提交
  6. 22 4月, 2021 1 次提交
  7. 20 4月, 2021 1 次提交
    • W
      net: stmmac: fix memory leak during driver probe · d7f576dc
      Wong Vee Khee 提交于
      On driver probe, kmemleak reported the following memory leak which was
      due to allocated bitmap that was not being freed in stmmac_dvr_probe().
      
      unreferenced object 0xffff9276014b13c0 (size 8):
        comm "systemd-udevd", pid 2143, jiffies 4294681112 (age 116.720s)
        hex dump (first 8 bytes):
          00 00 00 00 00 00 00 00                          ........
        backtrace:
          [<00000000c51e34b2>] stmmac_dvr_probe+0x1c0/0x440 [stmmac]
          [<00000000b530eb41>] intel_eth_pci_probe.cold+0x2b/0x14e [dwmac_intel]
          [<00000000b10f8929>] pci_device_probe+0xd2/0x150
          [<00000000fb254c74>] really_probe+0xf8/0x410
          [<0000000034128a59>] driver_probe_device+0x5d/0x150
          [<00000000016104d5>] device_driver_attach+0x53/0x60
          [<00000000cb18cd07>] __driver_attach+0x96/0x140
          [<00000000da9ffd5c>] bus_for_each_dev+0x7a/0xc0
          [<00000000af061a88>] bus_add_driver+0x184/0x1f0
          [<000000008be5c1c5>] driver_register+0x6c/0xc0
          [<0000000052b18a9e>] do_one_initcall+0x4d/0x210
          [<00000000154d4f07>] do_init_module+0x5c/0x230
          [<000000009b648d09>] load_module+0x2a5a/0x2d40
          [<000000000d86b76d>] __do_sys_finit_module+0xb5/0x120
          [<000000002b0cef95>] do_syscall_64+0x33/0x40
          [<0000000067b45bbb>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: bba2556e ("net: stmmac: Enable RX via AF_XDP zero-copy")
      Cc: Ong Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NWong Vee Khee <vee.khee.wong@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7f576dc
  8. 15 4月, 2021 2 次提交
  9. 14 4月, 2021 8 次提交
    • O
      net: stmmac: Add TX via XDP zero-copy socket · 132c32ee
      Ong Boon Leong 提交于
      We add the support of XDP ZC TX submission and cleaning into
      stmmac_tx_clean(). The function is made to clean as many TX complete
      frames as possible, i.e. limit by priv->dma_tx_size instead of NAPI
      budget. For TX ring that is associated with XSK pool, the function
      stmmac_xdp_xmit_zc() is introduced to TX frame buffers from XSK pool by
      using xsk_tx_peek_desc(). To make stmmac_tx_clean() support the cleaning
      of XSK TX frames, STMMAC_TXBUF_T_XSK_TX TX buffer type is introduced.
      
      As stmmac_tx_clean() uses the return value to cue whether NAPI function
      should continue to poll, we augment the caller of stmmac_tx_clean() to
      pass NAPI budget instead of priv->dma_tx_size through 'budget' input and
      made stmmac_tx_clean() to always clean up-to the TX ring size instead.
      This allows us to use the return boolean status of stmmac_xdp_xmit_zc()
      to decide if XSK TX work is done or not: If true, set 'xmits' to return
      'budget - 1' so that NAPI poll may exit. Else, set 'xmits' to return
      'budget' to make NAPI poll continue to poll since XSK TX work is not
      done. Finally, at the end of stmmac_tx_clean(), the function now take
      a maximum value between 'count' and 'xmits' so that status from both
      TX cleaning and XSK TX (only for XDP ZC) is considered.
      
      This patch adds a new NAPI poll called stmmac_napi_poll_rxtx() that is
      meant to be enabled/disabled for RX and TX ring that are bound to XSK
      pool. This NAPI poll function starts with cleaning TX ring, then submits
      XSK TX frames to TX ring before proceed to perform RX operations, i.e.
      , receiving RX frames and replenishing RX ring with RX free buffers
      obtained from XSK pool. Therefore, during XSK RX and TX setup, the driver
      enables stmmac_napi_poll_rxtx() for RX and TX operations, then during
      XSK RX and TX pool tear-down, the driver reenables the exisiting
      independent NAPI poll functions accordingly: stmmac_napi_poll_rx() and
      stmmac_napi_poll_tx().
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      132c32ee
    • O
      net: stmmac: Enable RX via AF_XDP zero-copy · bba2556e
      Ong Boon Leong 提交于
      This patch adds the support for receiving packet via AF_XDP zero-copy
      mechanism.
      
      XDP ZC uses 1:1 mapping of XDP buffer to receive packet, therefore the
      use of split header is not used currently. The 'xdp_buff' is declared as
      union together with a struct that contains 'page', 'addr' and
      'page_offset' that are associated with primary buffer.
      
      RX buffers are now allocated either via page_pool or xsk pool. For RX
      buffers from xsk_pool they are allocated and deallocated using below
      functions:
      
       * stmmac_alloc_rx_buffers_zc(struct stmmac_priv *priv, u32 queue)
       * dma_free_rx_xskbufs(struct stmmac_priv *priv, u32 queue)
      
      With above functions now available, we then extend the following driver
      functions to support XDP ZC:
       * stmmac_reinit_rx_buffers()
       * __init_dma_rx_desc_rings()
       * init_dma_rx_desc_rings()
       * __free_dma_rx_desc_resources()
      
      Note: stmmac_alloc_rx_buffers_zc() may return -ENOMEM due to RX XDP
      buffer pool is not allocated (e.g. samples/bpf/xdpsock TX-only). But,
      it is still ok to let TX XDP ZC to continue, therefore, the -ENOMEM
      is silently ignored to let the driver succcessfully transition to XDP
      ZC mode for the said RX and TX queue.
      
      As XDP ZC buffer size is different, the DMA buffer size is required
      to be reprogrammed accordingly for RX DMA/Queue that is populated with
      XDP buffer from XSK pool.
      
      Next, to add or remove per-queue XSK pool, stmmac_xdp_setup_pool()
      will call stmmac_xdp_enable_pool() or stmmac_xdp_disable_pool()
      that in-turn coordinates the tearing down and setting up RX ring via
      RX buffers and descriptors removal and reallocation through
      stmmac_disable_rx_queue() and stmmac_enable_rx_queue(). In addition,
      stmmac_xsk_wakeup() is added to initiate XDP RX buffer replenishing
      by signalling user application to add available XDP frames back to
      FILL queue.
      
      For RX processing using XDP zero-copy buffer, stmmac_rx_zc() is
      introduced which is implemented with the assumption that RX split
      header is disabled. For XDP verdict is XDP_PASS, the XDP buffer is
      copied into a sk_buff allocated through stmmac_construct_skb_zc()
      and sent to Linux network GRO inside stmmac_dispatch_skb_zc(). Free RX
      buffers are then replenished using stmmac_rx_refill_zc()
      
      v2: introduce __stmmac_disable_all_queues() to contain the original code
          that does napi_disable() and then make stmmac_setup_tc_block_cb()
          to use it. Move synchronize_rcu() into stmmac_disable_all_queues()
          that eventually calls __stmmac_disable_all_queues(). Then,
          make both stmmac_release() and stmmac_suspend() to use
          stmmac_disable_all_queues(). Thanks David Miller for spotting the
          synchronize_rcu() issue in v1 patch.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bba2556e
    • O
      net: stmmac: Refactor __stmmac_xdp_run_prog for XDP ZC · bba71cac
      Ong Boon Leong 提交于
      Prepare stmmac_xdp_run_prog() for AF_XDP zero-copy support which will be
      added by upcoming patches by splitting out the XDP verdict processing
      into __stmmac_xdp_run_prog() and it callable for XDP ZC path which does
      not need to verify bpf_prog is not NULL.
      
      The stmmac_xdp_run_prog() is used for regular XDP Rx path which requires
      bpf_prog to be verified.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bba71cac
    • O
      net: stmmac: rearrange RX and TX desc init into per-queue basis · de0b90e5
      Ong Boon Leong 提交于
      Below functions are made to be per-queue in preparation of XDP ZC:
      
       __init_dma_rx_desc_rings(struct stmmac_priv *priv, u32 queue, gfp_t flags)
       __init_dma_tx_desc_rings(struct stmmac_priv *priv, u32 queue)
      
      The original functions below are stay maintained for all queue usage:
      
       init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags)
       init_dma_tx_desc_rings(struct net_device *dev)
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de0b90e5
    • O
      net: stmmac: refactor stmmac_init_rx_buffers for stmmac_reinit_rx_buffers · da5ec7f2
      Ong Boon Leong 提交于
      The per-queue RX buffer allocation in stmmac_reinit_rx_buffers() can be
      made to use stmmac_alloc_rx_buffers() by merging the page_pool alloc
      checks for "buf->page" and "buf->sec_page" in stmmac_init_rx_buffers().
      
      This is in preparation for XSK pool allocation later.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da5ec7f2
    • O
      net: stmmac: introduce dma_recycle_rx_skbufs for stmmac_reinit_rx_buffers · 80f573c9
      Ong Boon Leong 提交于
      Rearrange RX buffer page_pool recycling logics into dma_recycle_rx_skbufs,
      so that we prepare stmmac_reinit_rx_buffers() for XSK pool expansion.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      80f573c9
    • O
      net: stmmac: rearrange RX buffer allocation and free functions · 4298255f
      Ong Boon Leong 提交于
      This patch restructures the per RX queue buffer allocation from page_pool
      to stmmac_alloc_rx_buffers().
      
      We also rearrange dma_free_rx_skbufs() so that it can be used in
      init_dma_rx_desc_rings() during freeing of RX buffer in the event of
      page_pool allocation failure to replace the more efficient method earlier.
      The replacement is needed to make the RX buffer alloc and free method
      scalable to XDP ZC xsk_pool alloc and free later.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4298255f
    • M
      of: net: pass the dst buffer to of_get_mac_address() · 83216e39
      Michael Walle 提交于
      of_get_mac_address() returns a "const void*" pointer to a MAC address.
      Lately, support to fetch the MAC address by an NVMEM provider was added.
      But this will only work with platform devices. It will not work with
      PCI devices (e.g. of an integrated root complex) and esp. not with DSA
      ports.
      
      There is an of_* variant of the nvmem binding which works without
      devices. The returned data of a nvmem_cell_read() has to be freed after
      use. On the other hand the return of_get_mac_address() points to some
      static data without a lifetime. The trick for now, was to allocate a
      device resource managed buffer which is then returned. This will only
      work if we have an actual device.
      
      Change it, so that the caller of of_get_mac_address() has to supply a
      buffer where the MAC address is written to. Unfortunately, this will
      touch all drivers which use the of_get_mac_address().
      
      Usually the code looks like:
      
        const char *addr;
        addr = of_get_mac_address(np);
        if (!IS_ERR(addr))
          ether_addr_copy(ndev->dev_addr, addr);
      
      This can then be simply rewritten as:
      
        of_get_mac_address(np, ndev->dev_addr);
      
      Sometimes is_valid_ether_addr() is used to test the MAC address.
      of_get_mac_address() already makes sure, it just returns a valid MAC
      address. Thus we can just test its return code. But we have to be
      careful if there are still other sources for the MAC address before the
      of_get_mac_address(). In this case we have to keep the
      is_valid_ether_addr() call.
      
      The following coccinelle patch was used to convert common cases to the
      new style. Afterwards, I've manually gone over the drivers and fixed the
      return code variable: either used a new one or if one was already
      available use that. Mansour Moufid, thanks for that coccinelle patch!
      
      <spml>
      @a@
      identifier x;
      expression y, z;
      @@
      - x = of_get_mac_address(y);
      + x = of_get_mac_address(y, z);
        <...
      - ether_addr_copy(z, x);
        ...>
      
      @@
      identifier a.x;
      @@
      - if (<+... x ...+>) {}
      
      @@
      identifier a.x;
      @@
        if (<+... x ...+>) {
            ...
        }
      - else {}
      
      @@
      identifier a.x;
      expression e;
      @@
      - if (<+... x ...+>@e)
      -     {}
      - else
      + if (!(e))
            {...}
      
      @@
      expression x, y, z;
      @@
      - x = of_get_mac_address(y, z);
      + of_get_mac_address(y, z);
        ... when != x
      </spml>
      
      All drivers, except drivers/net/ethernet/aeroflex/greth.c, were
      compile-time tested.
      Suggested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      83216e39
  10. 04 4月, 2021 6 次提交
    • O
      net: stmmac: Add support for XDP_REDIRECT action · 8b278a5b
      Ong Boon Leong 提交于
      This patch adds the support of XDP_REDIRECT to another remote cpu for
      further action. It also implements ndo_xdp_xmit ops, enabling the driver
      to transmit packets forwarded to it by XDP program running on another
      interface.
      
      This patch has been tested using "xdp_redirect_cpu" for XDP_REDIRECT
      + drop testing. It also been tested with "xdp_redirect" sample app
      which can be used to exercise ndo_xdp_xmit ops. The burst traffics are
      generated using pktgen_sample03_burst_single_flow.sh in samples/pktgen
      directory.
      
      v4: Move xdp_do_flush() processing into stmmac_finalize_xdp_rx() and
          combined the XDP verdict of XDP TX and REDIRECT together.
      
      v3: Added 'nq->trans_start = jiffies' to avoid TX time-out as we are
          sharing TX queue between slow path and XDP. Thanks to Jakub Kicinski
          for point out.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8b278a5b
    • O
      net: stmmac: Add support for XDP_TX action · be8b38a7
      Ong Boon Leong 提交于
      This patch adds support for XDP_TX action which enables XDP program to
      transmit back received frames.
      
      This patch has been tested with the "xdp2" app located in samples/bpf
      dir. The DUT receives burst traffic packet generated using pktgen script
      'pktgen_sample03_burst_single_flow.sh'.
      
      v4: Moved stmmac_tx_timer_arm() to be done once at the end of NAPI RX.
          Fixed stmmac_xdp_xmit_back() to return STMMAC_XDP_CONSUMED if
          XDP buffer to frame conversion fails. Thanks to Jakub's input.
      
      v3: Added 'nq->trans_start = jiffies' to avoid TX time-out as we are
          sharing TX queue between slow path and XDP. Thanks to Jakub Kicinski
          for pointing out.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be8b38a7
    • O
      net: stmmac: Add initial XDP support · 5fabb012
      Ong Boon Leong 提交于
      This patch adds the initial XDP support to stmmac driver. It supports
      XDP_PASS, XDP_DROP and XDP_ABORTED actions. Upcoming patches will add
      support for XDP_TX and XDP_REDIRECT.
      
      To support XDP headroom, this patch adds page_offset into RX buffer and
      change the dma_sync_single_for_device|cpu(). The DMA address used for
      RX operation are changed to take into page_offset too. As page_pool
      can handle dma_sync_single_for_device() on behalf of driver with
      PP_FLAG_DMA_SYNC_DEV flag, we skip doing that in stmmac driver.
      
      Current stmmac driver supports split header support (SPH) in RX but
      the flexibility of splitting header and payload at different position
      makes it very complex to be supported for XDP processing. In addition,
      jumbo frame is not supported in XDP to keep the initial codes simple.
      
      This patch has been tested with the sample app "xdp1" located in
      samples/bpf directory for both SKB and Native (XDP) mode. The burst
      traffic generated using pktgen_sample03_burst_single_flow.sh in
      samples/pktgen directory.
      
      Changes in v3:
       - factor in xdp header and tail adjustment done by XDP program.
         Thanks to Jakub Kicinski for pointing out the gap in v2.
      
      Changes in v2:
       - fix for "warning: variable 'len' set but not used" reported by lkp.
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5fabb012
    • O
      net: stmmac: arrange Tx tail pointer update to stmmac_flush_tx_descriptors · d96febed
      Ong Boon Leong 提交于
      This patch organizes TX tail pointer update into a new function called
      stmmac_flush_tx_descriptors() so that we can reuse it in stmmac_xmit(),
      stmmac_tso_xmit() and up-coming XDP implementation.
      
      Changes to v2:
       - Fix for warning: unused variable ‘desc_size’
         https://patchwork.hopto.org/static/nipa/457321/12170149/build_32bit/stderrSigned-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d96febed
    • O
      net: stmmac: make SPH enable/disable to be configurable · d08d32d1
      Ong Boon Leong 提交于
      SPH functionality splits header and payload according to split mode and
      offsef fields (SPLM and SPLOFST). It is beneficials for Linux network
      stack RX processing however it adds a lot of complexity in XDP
      processing.
      
      So, this patch makes the split-header (SPH) capability of the controller
      is stored in "priv->sph_cap" and the enabling/disabling of SPH is decided
      by "priv->sph".
      
      This is to prepare initial XDP enabling for stmmac to disable the use of
      SPH whenever XDP is enabled.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d08d32d1
    • O
      net: stmmac: set IRQ affinity hint for multi MSI vectors · 8deec94c
      Ong Boon Leong 提交于
      Certain platform likes Intel mGBE has independent hardware IRQ resources
      for TX and RX DMA operation. In preparation to support XDP TX, we add IRQ
      affinity hint to group both RX and TX queue of the same queue ID to the
      same CPU.
      
      Changes in v2:
       - IRQ affinity hint need to set to null before IRQ is released.
         Thanks to issue reported by Song, Yoong Siang.
      Reported-by: NSong, Yoong Siang <yoong.siang.song@intel.com>
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8deec94c
  11. 29 3月, 2021 1 次提交
  12. 27 3月, 2021 1 次提交
    • M
      net: stmmac: Fix kernel panic due to NULL pointer dereference of fpe_cfg · 63c173ff
      Mohammad Athari Bin Ismail 提交于
      In this patch, "net: stmmac: support FPE link partner hand-shaking
      procedure", priv->plat->fpe_cfg wouldn`t be "devm_kzalloc"ed if
      dma_cap->frpsel is 0 (Flexible Rx Parser is not supported in SoC) in
      tc_init(). So, fpe_cfg will be remain as NULL and accessing it will cause
      kernel panic.
      
      To fix this, move the "devm_kzalloc"ing of priv->plat->fpe_cfg before
      dma_cap->frpsel checking in tc_init(). Additionally, checking of
      priv->dma_cap.fpesel is added before calling stmmac_fpe_link_state_handle()
      as only FPE supported SoC is allowed to call the function.
      
      Below is the kernel panic dump reported by Marek Szyprowski
      <m.szyprowski@samsung.com>:
      
      meson8b-dwmac ff3f0000.ethernet eth0: PHY [0.0:00] driver [RTL8211F Gigabit Ethernet] (irq=35)
      meson8b-dwmac ff3f0000.ethernet eth0: No Safety Features support found
      meson8b-dwmac ff3f0000.ethernet eth0: PTP not supported by HW
      meson8b-dwmac ff3f0000.ethernet eth0: configuring for phy/rgmii link mode
      Unable to handle kernel NULL pointer dereference at virtual address 0000000000000001
      Mem abort info:
      ...
      user pgtable: 4k pages, 48-bit VAs, pgdp=00000000044eb000
      [0000000000000001] pgd=0000000000000000, p4d=0000000000000000
      Internal error: Oops: 96000004 [#1] PREEMPT SMP
      Modules linked in: dw_hdmi_i2s_audio dw_hdmi_cec meson_gxl realtek meson_gxbb_wdt snd_soc_meson_axg_sound_card dwmac_generic axg_audio meson_dw_hdmi crct10dif_ce snd_soc_meson_card_utils snd_soc_meson_axg_tdmout panfrost rc_odroid gpu_sched reset_meson_audio_arb meson_ir snd_soc_meson_g12a_tohdmitx snd_soc_meson_axg_frddr sclk_div clk_phase snd_soc_meson_codec_glue dwmac_meson8b snd_soc_meson_axg_fifo stmmac_platform meson_rng meson_drm stmmac rtc_meson_vrtc rng_core meson_canvas pwm_meson dw_hdmi mdio_mux_meson_g12a pcs_xpcs snd_soc_meson_axg_tdm_interface snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
      CPU: 1 PID: 7 Comm: kworker/u8:0 Not tainted 5.12.0-rc4-next-20210325+
      Hardware name: Hardkernel ODROID-C4 (DT)
      Workqueue: events_power_efficient phylink_resolve
      pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--)
      pc : stmmac_mac_link_up+0x14c/0x348 [stmmac]
      lr : stmmac_mac_link_up+0x284/0x348 [stmmac] ...
      Call trace:
       stmmac_mac_link_up+0x14c/0x348 [stmmac]
       phylink_resolve+0x104/0x420
       process_one_work+0x2a8/0x718
       worker_thread+0x48/0x460
       kthread+0x134/0x160
       ret_from_fork+0x10/0x18
      Code: b971ba60 350007c0 f958c260 f9402000 (39400401)
      ---[ end trace 0c9deb6c510228aa ]---
      
      Fixes: 5a558611 ("net: stmmac: support FPE link partner hand-shaking
      procedure")
      Reported-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NMohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
      Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63c173ff
  13. 26 3月, 2021 4 次提交
  14. 25 3月, 2021 1 次提交
  15. 19 3月, 2021 2 次提交
  16. 18 3月, 2021 2 次提交
    • O
      net: stmmac: add per-queue TX & RX coalesce ethtool support · db2f2842
      Ong Boon Leong 提交于
      Extending the driver to support per-queue RX and TX coalesce settings in
      order to support below commands:
      
      To show per-queue coalesce setting:-
       $ ethtool --per-queue <DEVNAME> queue_mask <MASK> --show-coalesce
      
      To set per-queue coalesce setting:-
       $ ethtool --per-queue <DEVNAME> queue_mask <MASK> --coalesce \
           [rx-usecs N] [rx-frames M] [tx-usecs P] [tx-frames Q]
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Acked-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db2f2842
    • V
      net: stmmac: add timestamp correction to rid CDC sync error · 3600be5f
      Voon Weifeng 提交于
      According to Synopsis DesignWare EQoS Databook, the Clock Domain Cross
      synchronization error is introduced tue to the clock(GMII Tx/Rx clock)
      being different at the capture as compared to the PTP
      clock(clk_ptp_ref_i) that is used to generate the time.
      
      The CDC synchronization error is almost equal to 2 times the clock
      period of the PTP clock(clk_ptp_ref_i).
      
      On a Intel Tigerlake platform (with Marvell 88E2110 external PHY):
      
      Before applying this patch (with CDC synchronization error):
      ptp4l[64.044]: rms    8 max   13 freq +30877 +/-  11 delay   216 +/-   0
      ptp4l[65.047]: rms   13 max   20 freq +30869 +/-  17 delay   213 +/-   0
      ptp4l[66.050]: rms   12 max   20 freq +30857 +/-  11 delay   213 +/-   0
      ptp4l[67.052]: rms   11 max   22 freq +30849 +/-  10 delay   215 +/-   0
      ptp4l[68.055]: rms   10 max   16 freq +30853 +/-  13 delay   215 +/-   0
      ptp4l[69.057]: rms    7 max   13 freq +30848 +/-   9 delay   216 +/-   0
      ptp4l[70.060]: rms    8 max   13 freq +30846 +/-  10 delay   216 +/-   0
      ptp4l[71.063]: rms    9 max   15 freq +30836 +/-   8 delay   218 +/-   0
      
      After applying this patch (CDC syncrhonization error is taken care of):
      ptp4l[61.516]: rms  773 max  824 freq +31526 +/- 158 delay   200 +/-   0
      ptp4l[62.519]: rms  427 max  596 freq +31668 +/-  39 delay   198 +/-   0
      ptp4l[63.522]: rms  113 max  206 freq +31482 +/-  57 delay   198 +/-   0
      ptp4l[64.525]: rms   40 max   56 freq +31316 +/-  29 delay   200 +/-   0
      ptp4l[65.528]: rms   47 max   56 freq +31255 +/-  17 delay   200 +/-   0
      ptp4l[66.531]: rms   26 max   36 freq +31246 +/-   9 delay   200 +/-   0
      ptp4l[67.534]: rms   12 max   18 freq +31254 +/-  12 delay   202 +/-   0
      ptp4l[68.537]: rms    7 max   12 freq +31263 +/-  10 delay   202 +/-   0
      Signed-off-by: NVoon Weifeng <weifeng.voon@intel.com>
      Signed-off-by: NWong Vee Khee <vee.khee.wong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3600be5f
  17. 16 3月, 2021 4 次提交
  18. 06 3月, 2021 1 次提交
    • O
      net: stmmac: Fix VLAN filter delete timeout issue in Intel mGBE SGMII · 9a7b3950
      Ong Boon Leong 提交于
      For Intel mGbE controller, MAC VLAN filter delete operation will time-out
      if serdes power-down sequence happened first during driver remove() with
      below message.
      
      [82294.764958] intel-eth-pci 0000:00:1e.4 eth2: stmmac_dvr_remove: removing driver
      [82294.778677] intel-eth-pci 0000:00:1e.4 eth2: Timeout accessing MAC_VLAN_Tag_Filter
      [82294.779997] intel-eth-pci 0000:00:1e.4 eth2: failed to kill vid 0081/0
      [82294.947053] intel-eth-pci 0000:00:1d.2 eth1: stmmac_dvr_remove: removing driver
      [82295.002091] intel-eth-pci 0000:00:1d.1 eth0: stmmac_dvr_remove: removing driver
      
      Therefore, we delay the serdes power-down to be after unregister_netdev()
      which triggers the VLAN filter delete.
      
      Fixes: b9663b7c ("net: stmmac: Enable SERDES power up/down sequence")
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a7b3950