1. 09 1月, 2021 1 次提交
  2. 17 12月, 2020 1 次提交
    • I
      dpaa2-eth: fix the size of the mapped SGT buffer · 54a57d1c
      Ioana Ciornei 提交于
      This patch fixes an error condition triggered when the code path which
      transmits a S/G frame descriptor when the skb's headroom is not enough
      for DPAA2's needs.
      
      We are greated with a splat like the one below when a SGT structure is
      recycled and that is because even though a dma_unmap is performed on the
      Tx confirmation path, the unmap is not done with the proper size.
      
      [  714.464927] WARNING: CPU: 13 PID: 0 at drivers/iommu/io-pgtable-arm.c:281 __arm_lpae_map+0x2d4/0x30c
      (...)
      [  714.465343] Call trace:
      [  714.465348]  __arm_lpae_map+0x2d4/0x30c
      [  714.465353]  __arm_lpae_map+0x114/0x30c
      [  714.465357]  __arm_lpae_map+0x114/0x30c
      [  714.465362]  __arm_lpae_map+0x114/0x30c
      [  714.465366]  arm_lpae_map+0xf4/0x180
      [  714.465373]  arm_smmu_map+0x4c/0xc0
      [  714.465379]  __iommu_map+0x100/0x2bc
      [  714.465385]  iommu_map_atomic+0x20/0x30
      [  714.465391]  __iommu_dma_map+0xb0/0x110
      [  714.465397]  iommu_dma_map_page+0xb8/0x120
      [  714.465404]  dma_map_page_attrs+0x1a8/0x210
      [  714.465413]  __dpaa2_eth_tx+0x384/0xbd0 [fsl_dpaa2_eth]
      [  714.465421]  dpaa2_eth_tx+0x84/0x134 [fsl_dpaa2_eth]
      [  714.465427]  dev_hard_start_xmit+0x10c/0x2b0
      [  714.465433]  sch_direct_xmit+0x1a0/0x550
      (...)
      
      The dpaa2-eth driver uses an area of software annotations to transmit
      necessary information from the Tx path to the Tx confirmation one. This
      SWA structure has a different layout for each kind of frame that we are
      dealing with: linear, S/G or XDP.
      
      The commit referenced was incorrectly setting up the 'sgt_size' field
      for the S/G type of SWA even though we are dealing with a linear skb
      here.
      
      Fixes: d70446ee ("dpaa2-eth: send a scatter-gather FD instead of realloc-ing")
      Reported-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Tested-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Link: https://lore.kernel.org/r/20201211171607.108034-1-ciorneiioana@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      54a57d1c
  3. 01 12月, 2020 1 次提交
  4. 24 11月, 2020 1 次提交
  5. 03 10月, 2020 2 次提交
  6. 26 9月, 2020 3 次提交
    • I
      dpaa2-eth: install a single steering rule when SHARED_FS is enabled · 5e29c16f
      Ionut-robert Aron 提交于
      When SHARED_FS is enabled on a DPNI object the flow steering tables are
      shared between all the traffic classes. Modify the driver so that we
      only add a new flow steering entry on the TC#0 when this new option is
      enabled.
      Signed-off-by: NIonut-robert Aron <ionut-robert.aron@nxp.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5e29c16f
    • I
      dpaa2-eth: no need to check link state right after ndo_open · 4c33a5bd
      Ioana Ciornei 提交于
      The call to dpaa2_eth_link_state_update() is a leftover from the time
      when on DPAA2 platforms the PHYs were started at boot time so when an
      ifconfig was issued on the associated interface, the link status needed
      to be checked directly from the ndo_open() callback.
      This is not needed anymore since we are now properly integrated with the
      PHY layer thus a link interrupt will come directly from the PHY
      eventually without the need to call the sync function.
      Fix this up by removing the call to dpaa2_eth_link_state_update().
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c33a5bd
    • J
      drivers/net/ethernet: clean up mis-targeted comments · d0ea5cbd
      Jesse Brandeburg 提交于
      As part of the W=1 cleanups for ethernet, a million [*] driver
      comments had to be cleaned up to get the W=1 compilation to
      succeed. This change finally makes the drivers/net/ethernet tree
      compile with W=1 set on the command line. NOTE: The kernel uses
      kdoc style (see Documentation/process/kernel-doc.rst) when
      documenting code, not doxygen or other styles.
      
      After this patch the x86_64 build has no warnings from W=1, however
      scripts/kernel-doc says there are 1545 more warnings in source files, that
      I need to develop a script to fix in a followup patch.
      
      The errors fixed here are all kdoc of a few classes, with a few outliers:
      In file included from drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c:10:
      drivers/net/ethernet/qlogic/netxen/netxen_nic.h:1193:18: warning: ‘FW_DUMP_LEVELS’ defined but not used [-Wunused-const-variable=]
       1193 | static const u32 FW_DUMP_LEVELS[] = { 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff };
            |                  ^~~~~~~~~~~~~~
      ... repeats 4 times...
      drivers/net/ethernet/sun/cassini.c:2084:24: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
       2084 |    RX_USED_ADD(page, i);
      drivers/net/ethernet/natsemi/ns83820.c: In function ‘phy_intr’:
      drivers/net/ethernet/natsemi/ns83820.c:603:6: warning: variable ‘tbisr’ set but not used [-Wunused-but-set-variable]
        603 |  u32 tbisr, tanar, tanlpar;
            |      ^~~~~
      drivers/net/ethernet/natsemi/ns83820.c: In function ‘ns83820_get_link_ksettings’:
      drivers/net/ethernet/natsemi/ns83820.c:1207:11: warning: variable ‘tanar’ set but not used [-Wunused-but-set-variable]
       1207 |  u32 cfg, tanar, tbicr;
            |           ^~~~~
      drivers/net/ethernet/packetengines/yellowfin.c:1063:18: warning: variable ‘yf_size’ set but not used [-Wunused-but-set-variable]
       1063 |   int data_size, yf_size;
            |                  ^~~~~~~
      
      Normal kdoc fixes:
      warning: Function parameter or member 'x' not described in 'y'
      warning: Excess function parameter 'x' description in 'y'
      warning: Cannot understand <string> on line <NNN> - I thought it was a doc line
      
      [*] - ok it wasn't quite a million, but it felt like it.
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0ea5cbd
  7. 21 9月, 2020 1 次提交
  8. 19 9月, 2020 4 次提交
    • Y
      dpaa2-eth: support PTP Sync packet one-step timestamping · c5521189
      Yangbo Lu 提交于
      This patch is to add PTP sync packet one-step timestamping support.
      Before egress, one-step timestamping enablement needs,
      
      - Enabling timestamp and FAS (Frame Annotation Status) in
        dpni buffer layout.
      
      - Write timestamp to frame annotation and set PTP bit in
        FAS to mark as one-step timestamping event.
      
      - Enabling one-step timestamping by dpni_set_single_step_cfg()
        API, with offset provided to insert correction time on frame.
        The offset must respect all MAC headers, VLAN tags and other
        protocol headers accordingly. The correction field update can
        consider delays up to one second. So PTP frame needs to be
        filtered and parsed, and written timestamp into Sync frame
        originTimestamp field.
      
      The operation of API dpni_set_single_step_cfg() has to be done
      when no one-step timestamping frames are in flight. So we have
      to make sure the last one-step timestamping frame has already
      been transmitted on hardware before starting to send the current
      one. The resolution is,
      
      - Utilize skb->cb[0] to mark timestamping request per packet.
        If it is one-step timestamping PTP sync packet, queue to skb queue.
        If not, transmit immediately.
      
      - Schedule a work to transmit skbs in skb queue.
      
      - mutex lock is used to ensure the last one-step timestamping packet
        has already been transmitted on hardware through TX confirmation queue
        before transmitting current packet.
      Signed-off-by: NYangbo Lu <yangbo.lu@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c5521189
    • Y
      dpaa2-eth: utilize skb->cb[0] for hardware timestamping · 1cf773bd
      Yangbo Lu 提交于
      This patch is a preparation for next hardware one-step timestamping
      support. For DPAA2, the one step timestamping configuration on
      hardware registers has to be done when there is no one-step timestamping
      packet in flight. So we will have to use workqueue and skb queue
      for such packets transmitting, to make sure waiting the last packet has
      already been sent on hardware, and starting to transmit the current one.
      
      So the tx timestamping flag in private data may not reflect the actual
      request for the one-step timestamping packets of skb queue. This also
      affects skb headroom allocation. Let's use skb->cb[0] to mark the
      timestamping request for each skb.
      Signed-off-by: NYangbo Lu <yangbo.lu@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1cf773bd
    • Y
      dpaa2-eth: invoke dpaa2_eth_enable_tx_tstamp() once in code · 64a965de
      Yangbo Lu 提交于
      Invoke dpaa2_eth_enable_tx_tstamp() once in code after building FD,
      rather than calling it in dpaa2_eth_build_single_fd(),
      dpaa2_eth_build_sg_fd_single_buf(), and dpaa2_eth_build_sg_fd().
      Signed-off-by: NYangbo Lu <yangbo.lu@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      64a965de
    • Y
      dpaa2-eth: define a global ptp_qoriq structure pointer · d21c784c
      Yangbo Lu 提交于
      Define a global ptp_qoriq structure pointer, and export to use.
      The ptp clock operations will be used in dpaa2-eth driver.
      For example, supporting one step timestamping needs to write
      current time to hardware frame annotation before sending and
      then hardware inserts the delay time on frame during sending.
      So in driver, at least clock gettime operation will be needed
      to make sure right time is written to hardware frame annotation
      for one step timestamping.
      Signed-off-by: NYangbo Lu <yangbo.lu@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d21c784c
  9. 02 9月, 2020 1 次提交
  10. 24 8月, 2020 1 次提交
  11. 05 8月, 2020 1 次提交
  12. 04 8月, 2020 1 次提交
    • J
      dpaa2-eth: use napi_schedule to be compatible with PREEMPT_RT · 6c33ae1a
      Jiafei Pan 提交于
      The driver calls napi_schedule_irqoff() from a context where, in RT,
      hardirqs are not disabled, since the IRQ handler is force-threaded.
      
      In the call path of this function, __raise_softirq_irqoff() is modifying
      its per-CPU mask of pending softirqs that must be processed, using
      or_softirq_pending(). The or_softirq_pending() function is not atomic,
      but since interrupts are supposed to be disabled, nobody should be
      preempting it, and the operation should be safe.
      
      Nonetheless, when running with hardirqs on, as in the PREEMPT_RT case,
      it isn't safe, and the pending softirqs mask can get corrupted,
      resulting in softirqs being lost and never processed.
      
      To have common code that works with PREEMPT_RT and with mainline Linux,
      we can use plain napi_schedule() instead. The difference is that
      napi_schedule() (via __napi_schedule) also calls local_irq_save, which
      disables hardirqs if they aren't already. But, since they already are
      disabled in non-RT, this means that in practice we don't see any
      measurable difference in throughput or latency with this patch.
      Signed-off-by: NJiafei Pan <Jiafei.Pan@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6c33ae1a
  13. 26 7月, 2020 1 次提交
  14. 22 7月, 2020 2 次提交
  15. 16 7月, 2020 1 次提交
  16. 07 7月, 2020 1 次提交
  17. 30 6月, 2020 2 次提交
  18. 26 6月, 2020 2 次提交
  19. 12 6月, 2020 1 次提交
  20. 02 6月, 2020 6 次提交
  21. 17 5月, 2020 1 次提交
  22. 16 5月, 2020 1 次提交
  23. 15 5月, 2020 1 次提交
    • J
      dpaa2-eth: Add XDP frame size · 4a9b052a
      Jesper Dangaard Brouer 提交于
      The dpaa2-eth driver reserve some headroom used for hardware and
      software annotation area in RX/TX buffers. Thus, xdp.data_hard_start
      doesn't start at page boundary.
      
      When XDP is configured the area reserved via dpaa2_fd_get_offset(fd) is
      448 bytes of which XDP have reserved 256 bytes. As frame_sz is
      calculated as an offset from xdp_buff.data_hard_start, an adjust from
      the full PAGE_SIZE == DPAA2_ETH_RX_BUF_RAW_SIZE.
      
      When doing XDP_REDIRECT, the driver doesn't need this reserved headroom
      any-longer and allows xdp_do_redirect() to use it. This is an advantage
      for the drivers own ndo-xdp_xmit, as it uses part of this headroom for
      itself.  Patch also adjust frame_sz in this case.
      
      The driver cannot support XDP data_meta, because it uses the headroom
      just before xdp.data for struct dpaa2_eth_swa (DPAA2_ETH_SWA_SIZE=64),
      when transmitting the packet. When transmitting a xdp_frame in
      dpaa2_eth_xdp_xmit_frame (call via ndo_xdp_xmit) is uses this area to
      store a pointer to xdp_frame and dma_size, which is used in TX
      completion (free_tx_fd) to return frame via xdp_return_frame().
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Cc: Ioana Radulescu <ruxandra.radulescu@nxp.com>
      Link: https://lore.kernel.org/bpf/158945339348.97035.8562488847066908856.stgit@firesoul
      4a9b052a
  24. 08 5月, 2020 1 次提交
  25. 01 5月, 2020 1 次提交
  26. 26 4月, 2020 1 次提交