1. 30 11月, 2017 2 次提交
  2. 05 11月, 2017 1 次提交
  3. 10 10月, 2017 1 次提交
  4. 27 9月, 2017 1 次提交
    • D
      bpf: add meta pointer for direct access · de8f3a83
      Daniel Borkmann 提交于
      This work enables generic transfer of metadata from XDP into skb. The
      basic idea is that we can make use of the fact that the resulting skb
      must be linear and already comes with a larger headroom for supporting
      bpf_xdp_adjust_head(), which mangles xdp->data. Here, we base our work
      on a similar principle and introduce a small helper bpf_xdp_adjust_meta()
      for adjusting a new pointer called xdp->data_meta. Thus, the packet has
      a flexible and programmable room for meta data, followed by the actual
      packet data. struct xdp_buff is therefore laid out that we first point
      to data_hard_start, then data_meta directly prepended to data followed
      by data_end marking the end of packet. bpf_xdp_adjust_head() takes into
      account whether we have meta data already prepended and if so, memmove()s
      this along with the given offset provided there's enough room.
      
      xdp->data_meta is optional and programs are not required to use it. The
      rationale is that when we process the packet in XDP (e.g. as DoS filter),
      we can push further meta data along with it for the XDP_PASS case, and
      give the guarantee that a clsact ingress BPF program on the same device
      can pick this up for further post-processing. Since we work with skb
      there, we can also set skb->mark, skb->priority or other skb meta data
      out of BPF, thus having this scratch space generic and programmable
      allows for more flexibility than defining a direct 1:1 transfer of
      potentially new XDP members into skb (it's also more efficient as we
      don't need to initialize/handle each of such new members). The facility
      also works together with GRO aggregation. The scratch space at the head
      of the packet can be multiple of 4 byte up to 32 byte large. Drivers not
      yet supporting xdp->data_meta can simply be set up with xdp->data_meta
      as xdp->data + 1 as bpf_xdp_adjust_meta() will detect this and bail out,
      such that the subsequent match against xdp->data for later access is
      guaranteed to fail.
      
      The verifier treats xdp->data_meta/xdp->data the same way as we treat
      xdp->data/xdp->data_end pointer comparisons. The requirement for doing
      the compare against xdp->data is that it hasn't been modified from it's
      original address we got from ctx access. It may have a range marking
      already from prior successful xdp->data/xdp->data_end pointer comparisons
      though.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de8f3a83
  5. 30 6月, 2017 1 次提交
  6. 16 6月, 2017 1 次提交
  7. 03 5月, 2017 5 次提交
  8. 11 4月, 2017 1 次提交
  9. 08 4月, 2017 1 次提交
  10. 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
  11. 31 1月, 2017 1 次提交
  12. 12 1月, 2017 1 次提交
  13. 09 1月, 2017 1 次提交
  14. 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
  15. 26 11月, 2016 2 次提交
  16. 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
  17. 18 10月, 2016 1 次提交
  18. 24 9月, 2016 1 次提交
  19. 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
  20. 14 8月, 2016 7 次提交
  21. 05 5月, 2016 1 次提交
  22. 18 2月, 2016 3 次提交
  23. 12 2月, 2016 2 次提交