1. 07 2月, 2017 1 次提交
  2. 06 2月, 2017 1 次提交
  3. 31 1月, 2017 1 次提交
  4. 26 1月, 2017 1 次提交
    • D
      bpf: add initial bpf tracepoints · a67edbf4
      Daniel Borkmann 提交于
      This work adds a number of tracepoints to paths that are either
      considered slow-path or exception-like states, where monitoring or
      inspecting them would be desirable.
      
      For bpf(2) syscall, tracepoints have been placed for main commands
      when they succeed. In XDP case, tracepoint is for exceptions, that
      is, f.e. on abnormal BPF program exit such as unknown or XDP_ABORTED
      return code, or when error occurs during XDP_TX action and the packet
      could not be forwarded.
      
      Both have been split into separate event headers, and can be further
      extended. Worst case, if they unexpectedly should get into our way in
      future, they can also removed [1]. Of course, these tracepoints (like
      any other) can be analyzed by eBPF itself, etc. Example output:
      
        # ./perf record -a -e bpf:* sleep 10
        # ./perf script
        sock_example  6197 [005]   283.980322:      bpf:bpf_map_create: map type=ARRAY ufd=4 key=4 val=8 max=256 flags=0
        sock_example  6197 [005]   283.980721:       bpf:bpf_prog_load: prog=a5ea8fa30ea6849c type=SOCKET_FILTER ufd=5
        sock_example  6197 [005]   283.988423:   bpf:bpf_prog_get_type: prog=a5ea8fa30ea6849c type=SOCKET_FILTER
        sock_example  6197 [005]   283.988443: bpf:bpf_map_lookup_elem: map type=ARRAY ufd=4 key=[06 00 00 00] val=[00 00 00 00 00 00 00 00]
        [...]
        sock_example  6197 [005]   288.990868: bpf:bpf_map_lookup_elem: map type=ARRAY ufd=4 key=[01 00 00 00] val=[14 00 00 00 00 00 00 00]
             swapper     0 [005]   289.338243:    bpf:bpf_prog_put_rcu: prog=a5ea8fa30ea6849c type=SOCKET_FILTER
      
        [1] https://lwn.net/Articles/705270/Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a67edbf4
  5. 21 1月, 2017 1 次提交
    • A
      qed: avoid possible stack overflow in qed_ll2_acquire_connection · 0629a330
      Arnd Bergmann 提交于
      struct qed_ll2_info is rather large, so putting it on the stack
      can cause an overflow, as this warning tries to tell us:
      
      drivers/net/ethernet/qlogic/qed/qed_ll2.c: In function 'qed_ll2_start':
      drivers/net/ethernet/qlogic/qed/qed_ll2.c:2159:1: error: the frame size of 1056 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
      
      qed_ll2_start_ooo() already uses a dynamic allocation for the structure
      to work around that problem, and we could do the same in qed_ll2_start()
      as well as qed_roce_ll2_start(), but since the structure is only
      used to pass a couple of initialization values here, it seems nicer
      to replace it with a different structure.
      
      Lacking any idea for better naming, I'm adding 'struct qed_ll2_conn',
      which now contains all the initialization data, and this now simply
      gets copied into struct qed_ll2_info rather than assigning all members
      one by one.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0629a330
  6. 18 1月, 2017 1 次提交
  7. 09 1月, 2017 1 次提交
  8. 02 1月, 2017 12 次提交
  9. 18 12月, 2016 1 次提交
  10. 15 12月, 2016 1 次提交
  11. 14 12月, 2016 1 次提交
  12. 09 12月, 2016 1 次提交
  13. 06 12月, 2016 1 次提交
  14. 04 12月, 2016 1 次提交
  15. 03 12月, 2016 3 次提交
  16. 01 12月, 2016 11 次提交
    • M
      qede: Add support for XDP_TX · cb6aeb07
      Mintz, Yuval 提交于
      Add support for forwarding via XDP. Once the eBPF is attached,
      driver would allocate & configure a designated transmission queue
      meant solely for forwarding packets. Said queue would share the
      receive-queue's interrupt line, and would have it's own Tx statistics.
      
      Infrastructure changes required for this [spread-out through the code]:
       - Determine the DMA direction of the receive buffers based on the presence
      of the eBPF program.
       - Turn the sw Tx ring into a union, as regular/XDP queues have different
      needs for releasing resources after completion [regular requires the SKB,
      XDP requires the transmitted page].
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cb6aeb07
    • M
      qede: Add basic XDP support · 496e0517
      Mintz, Yuval 提交于
      Add support for the ndo_xdp callback. This patch would support XDP_PASS,
      XDP_DROP and XDP_ABORTED commands.
      
      This also adds a per Rx queue statistic which counts number of packets
      which didn't reach the stack [due to XDP].
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      496e0517
    • M
      qede: Better utilize the qede_[rt]x_queue · 9eb22357
      Mintz, Yuval 提交于
      Improve the cacheline usage of both queues by reordering -
      This reduces the cachelines required for egress datapath processing
      from 3 to 2 and those required by ingress datapath processing by 2.
      
      It also changes a couple of datapath related functions that currently
      require either the fastpath or the qede_dev, changing them to be based
      on the tx/rx queue instead.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9eb22357
    • M
      qede: Don't check netdevice for rx-hash · 8a472530
      Mintz, Yuval 提交于
      Receive-hashing is a fixed feature, so there's no need to check
      during the ingress datapath whether it's set or not.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a472530
    • M
      qed*: Handle-based L2-queues. · 3da7a37a
      Mintz, Yuval 提交于
      The driver needs to maintain several FW/HW-indices for each one of
      its queues. Currently, that mapping is done by the QED where it uses
      an rx/tx array of so-called hw-cids, populating them whenever a new
      queue is opened and clearing them upon destruction of said queues.
      
      This maintenance is far from ideal - there's no real reason why
      QED needs to maintain such a data-structure. It becomes even worse
      when considering the fact that the PF's queues and its child VFs' queues
      are all mapped into the same data-structure.
      As a by-product, the set of parameters an interface needs to supply for
      queue APIs is non-trivial, and some of the variables in the API
      structures have different meaning depending on their exact place
      in the configuration flow.
      
      This patch re-organizes the way L2 queues are configured and maintained.
      In short:
        - Required parameters for queue init are now well-defined.
        - Qed would allocate a queue-cid based on parameters.
          Upon initialization success, it would return a handle to caller.
        - Queue-handle would be maintained by entity requesting queue-init,
          not necessarily qed.
        - All further queue-APIs [update, destroy] would use the opaque
          handle as reference for the queue instead of various indices.
      
      The possible owners of such handles:
        - PF queues [qede] - complete handles based on provided configuration.
        - VF queues [qede] - fw-context-less handles, containing only relative
          information; Only the PF-side would need the absolute indices
          for configuration, so they're omitted here.
        - VF queues [qed, PF-side] - complete handles based on VF initialization.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3da7a37a
    • M
      qede: Revise state locking scheme · 567b3c12
      Mintz, Yuval 提交于
      As qede utilizes an internal-reload sequence as result of various
      configuration changes, the netif state wouldn't always accurately describe
      the status of the configuration.
      To compensate, we're storing an internal state of the device, which should
      only be accessed under the qede_lock.
      
      This patch fixes and improves several state/lock interactions:
        - The internal state should only be checked while locked.
        - While holding lock, it's preferable to check state rather than
          the netdevice's state.
        - The reload sequence is not 'atomic' - unload and subsequent load
          are not in the same critical section.
      
      This also add the 'locked' variant for the reload, which would later be
      used by XDP - useful in the case where the correct sequence is 'lock,
      check state and re-configure if good', instead of allowing the reload
      itself to make the decision regarding the configurability of the device.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      567b3c12
    • M
      qede: Refactor data-path Rx flow · f4fad34c
      Mintz, Yuval 提交于
      Driver's NAPI poll is using a long sequence for processing ingress
      packets, and it's going to get even longer once we do XDP.
      Break down the main loop into a series of sub-functions to allow
      better readability of the function.
      
      While we're at it, correct the accounting of the NAPI budget -
      currently we're counting only packets passed to the stack against
      the budget, even in case those are actually aggregations.
      After refactoring every CQE processed would be counted against the budget.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f4fad34c
    • M
      qede: Refactor statistics gathering · 4dbcd640
      Mintz, Yuval 提交于
      Refactor logic for gathering statistics into a per-queue function.
      This improves readability of the driver statistics' flows.
      
      In addition, this would be required by the XDP forwarding queues
      [as we'll need the Txq statistics gathering methods for those as well].
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4dbcd640
    • M
      qede: Remove 'num_tc'. · 80439a17
      Mintz, Yuval 提交于
      Driver currently doesn't support multi-CoS, but it contains logic
      where multiple transmission queues could be theoretically manipulated.
      No point in maintaining the infrastructure at the moment.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      80439a17
    • M
      qed: Optimize qed_chain datapath usage · 6d937acf
      Mintz, Yuval 提交于
      The chain structure and functions are widely used by the qed* modules,
      both for configuration and datapath.
      E.g., qede's Tx has one such chain and its Rx has two.
      
      Currently, the strucutre's fields which are required for datapath
      related functions [produce/consume] are intertwined with fields which
      are required only for configuration purposes [init/destroy/etc.].
      
      This patch re-arranges the chain structure so that all the fields which
      are required for datapath usage could reside in a single cacheline instead
      of the two which are required today.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6d937acf
    • M
      qede: Optimize aggregation information size · 01e23015
      Mintz, Yuval 提交于
      Driver needs to maintain a structure per-each concurrent possible
      open aggregation, but the structure storing that metadata is far from
      being optimized - biggest waste in it is that there are 2 buffer metadata,
      one for a replacement buffer when the aggregation begins and the other for
      holding the first aggregation's buffer after it begins [as firmware might
      still update it]. Those 2 can safely be united into a single metadata
      structure.
      
      struct qede_agg_info changes the following:
      
      	/* size: 120, cachelines: 2, members: 9 */
      	/* sum members: 114, holes: 1, sum holes: 4 */
      	/* padding: 2 */
      	/* paddings: 2, sum paddings: 8 */
      	/* last cacheline: 56 bytes */
       -->
      	/* size: 48, cachelines: 1, members: 9 */
      	/* paddings: 1, sum paddings: 4 */
      	/* last cacheline: 48 bytes */
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      01e23015
  17. 11 11月, 2016 1 次提交