1. 03 5月, 2017 4 次提交
    • S
      net: thunderx: Add support for XDP_TX · 16f2bccd
      Sunil Goutham 提交于
      Adds support for XDP_TX i.e transmits packet out of
      the XDP TX queue mapped to the corresponding Rx queue
      on which packet is received.
      
      Since SQ for XDP TX will be used only on a single cpu i.e
      SQ description creation and freeing, using atomic free count
      is not necessary and will become a bottleneck. Hence added
      a separate 'xdp_free_cnt' used for SQs designated for XDP
      to track descriptor free count.
      
      Changes also include
      - A new entry 'xdp_page' is added to save transmitted packet's
        page pointer for later cleanup.
      - XDP Tx SQ's doorbell is ringed once per NAPI instance.
      - Retrieving designated SQ for packets being sent out by stack
        via 'nicvf_xmit'.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16f2bccd
    • S
      net: thunderx: Add support for XDP_DROP · c56d91ce
      Sunil Goutham 提交于
      Adds support for XDP_DROP.
      Also since in XDP mode there is just a single buffer per page,
      made changes to recycle DMA mapping info as well along with pages.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c56d91ce
    • S
      net: thunderx: Add basic XDP support · 05c773f5
      Sunil Goutham 提交于
      Adds basic XDP support i.e attaching a BPF program to an
      interface. Also takes care of allocating separate Tx queues
      for XDP path and for network stack packet transmission.
      
      This patch doesn't support handling of any of the XDP actions,
      all are treated as XDP_PASS i.e packets will be handed over to
      the network stack.
      
      Changes also involve allocating one receive buffer per page in XDP
      mode and multiple in normal mode i.e when no BPF program is attached.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05c773f5
    • S
      net: thunderx: Optimize CQE_TX handling · 0dada88b
      Sunil Goutham 提交于
      Optimized CQE handling with below changes
      - Feeing descriptors back to SQ in bulk i.e once per NAPI
        instance instead for every CQE_TX, this will reduce number
        of atomic updates to 'sq->free_cnt'.
      - Checking errors in CQE_TX and CQE_RX before calling appropriate
        fn()s to update error stats i.e reduce branching.
      
      Also removed debug messages in packet handling path which otherwise
      causes issues if DEBUG is enabled.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0dada88b
  2. 11 4月, 2017 1 次提交
  3. 08 4月, 2017 1 次提交
  4. 10 3月, 2017 1 次提交
    • S
      net: thunderx: Fix IOMMU translation faults · 83abb7d7
      Sunil Goutham 提交于
      ACPI support has been added to ARM IOMMU driver in 4.10 kernel
      and that has resulted in VNIC interfaces throwing translation
      faults when kernel is booted with ACPI as driver was not using
      DMA API. This patch fixes the issue by using DMA API which inturn
      will create translation tables when IOMMU is enabled.
      
      Also VNIC doesn't have a seperate receive buffer ring per receive
      queue, so there is no 1:1 descriptor index matching between CQE_RX
      and the index in buffer ring from where a buffer has been used for
      DMA'ing. Unlike other NICs, here it's not possible to maintain dma
      address to virt address mappings within the driver. This leaves us
      no other choice but to use IOMMU's IOVA address conversion API to
      get buffer's virtual address which can be given to network stack
      for processing.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      83abb7d7
  5. 31 1月, 2017 1 次提交
  6. 12 1月, 2017 1 次提交
  7. 09 1月, 2017 1 次提交
  8. 03 12月, 2016 1 次提交
    • S
      net: thunderx: Fix transmit queue timeout issue · bd3ad7d3
      Sunil Goutham 提交于
      Transmit queue timeout issue is seen in two cases
      - Due to a race condition btw setting stop_queue at xmit()
        and checking for stopped_queue in NAPI poll routine, at times
        transmission from a SQ comes to a halt. This is fixed
        by using barriers and also added a check for SQ free descriptors,
        incase SQ is stopped and there are only CQE_RX i.e no CQE_TX.
      - Contrary to an assumption, a HW errata where HW doesn't stop transmission
        even though there are not enough CQEs available for a CQE_TX is
        not fixed in T88 pass 2.x. This results in a Qset error with
        'CQ_WR_FULL' stalling transmission. This is fixed by adjusting
        RXQ's  RED levels for CQ level such that there is always enough
        space left for CQE_TXs.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd3ad7d3
  9. 26 11月, 2016 2 次提交
  10. 17 11月, 2016 3 次提交
    • S
      net: thunderx: Fix memory leak and other issues upon interface toggle · c94acf80
      Sunil Goutham 提交于
      This patch fixes the following
      1. When interface is being teardown and queues are being cleaned up,
         free pending SKBs that are in SQ which are either not transmitted
         or freed as NAPI is disabled by that time.
      2. While interface initialization, delay CFG_DONE notification till
         the end to avoid corner cases where TXQs are enabled but CQ
         interrupts are not which results blocking transmission and kicking
         off watchdog.
      3. Check for IFF_UP while re-enabling RBDR interrupts from tasklet.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c94acf80
    • S
      net: thunderx: Fix VF driver's interface statistics · 964cb69b
      Sunil Goutham 提交于
      This patch fixes multiple issues
      1. Convert all driver statistics to percpu counters for accuracy.
      2. To avoid multiple CQEs posted by a TSO packet appended to HW,
         TSO pkt's SQE has 'post_cqe' not set but a dummy SQE is added
         for getting HW transmit completion notification. This dummy
         SQE has 'dont_send' set and HW drops the pkt pointed to in this
         thus Tx drop counter increases. This patch fixes this by subtracting
         SW tx tso counter from HW Tx drop counter for actual packet drop counter.
      3. Reset all individual queue's and VNIC HW stats when interface is going down.
      4. Getrid off unnecessary counters in hot path.
      5. Bringout all CQE error stats i.e both Rx and Tx.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      964cb69b
    • S
      net: thunderx: Program LMAC credits based on MTU · 712c3185
      Sunil Goutham 提交于
      Programming LMAC credits taking 9K frame size by default is incorrect
      as for an interface which is one of the many on the same BGX/QLM
      no of credits available will be less as Tx FIFO will be divided
      across all interfaces. So let's say a BGX with 40G interface and another
      BGX with multiple 10G, bandwidth of 10G interfaces will be effected when
      traffic is running on both 40G and 10G interfaces simultaneously.
      
      This patch fixes this issue by programming credits based on netdev's MTU.
      Also fixed configuring MTU to HW and added CQE counter for pkts which
      exceed this value.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      712c3185
  11. 18 10月, 2016 1 次提交
  12. 24 9月, 2016 1 次提交
  13. 02 9月, 2016 1 次提交
    • S
      net: thunderx: Fix for issues with multiple CQEs posted for a TSO packet · 7ceb8a13
      Sunil Goutham 提交于
      On ThunderX 88xx pass 2.x chips when TSO is offloaded to HW,
      HW posts a CQE for every TSO segment transmitted. Current code
      does handles this, but is prone to issues when segment sizes are
      small resulting in SW processing too many CQEs and also at times
      frees a SKB which is not yet transmitted.
      
      This patch handles the errata in a different way and eliminates issues
      with earlier approach, TSO packet is submitted to HW with post_cqe=0,
      so that no CQE is posted upon completion of transmission of TSO packet
      but a additional HDR + IMMEDIATE descriptors are added to SQ due to
      which a CQE is posted and will have required info to be used while
      cleanup in napi. This way only one CQE is posted for a TSO packet.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ceb8a13
  14. 14 8月, 2016 7 次提交
  15. 05 5月, 2016 1 次提交
  16. 18 2月, 2016 3 次提交
  17. 12 2月, 2016 3 次提交
  18. 12 12月, 2015 1 次提交
  19. 03 12月, 2015 1 次提交
  20. 17 11月, 2015 1 次提交
  21. 16 11月, 2015 1 次提交
  22. 26 10月, 2015 1 次提交
  23. 31 8月, 2015 2 次提交