1. 09 12月, 2016 1 次提交
  2. 04 12月, 2016 1 次提交
  3. 03 12月, 2016 1 次提交
    • D
      bpf, xdp: drop rcu_read_lock from bpf_prog_run_xdp and move to caller · 366cbf2f
      Daniel Borkmann 提交于
      After 326fe02d ("net/mlx4_en: protect ring->xdp_prog with rcu_read_lock"),
      the rcu_read_lock() in bpf_prog_run_xdp() is superfluous, since callers
      need to hold rcu_read_lock() already to make sure BPF program doesn't
      get released in the background.
      
      Thus, drop it from bpf_prog_run_xdp(), as it can otherwise be misleading.
      Still keeping the bpf_prog_run_xdp() is useful as it allows for grepping
      in XDP supported drivers and to keep the typecheck on the context intact.
      For mlx4, this means we don't have a double rcu_read_lock() anymore. nfp can
      just make use of bpf_prog_run_xdp(), too. For qede, just move rcu_read_lock()
      out of the helper. When the driver gets atomic replace support, this will
      move to call-sites eventually.
      
      mlx5 needs actual fixing as it has the same issue as described already in
      326fe02d ("net/mlx4_en: protect ring->xdp_prog with rcu_read_lock"),
      that is, we're under RCU bh at this time, BPF programs are released via
      call_rcu(), and call_rcu() != call_rcu_bh(), so we need to properly mark
      read side as programs can get xchg()'ed in mlx5e_xdp_set() without queue
      reset.
      
      Fixes: 86994156 ("net/mlx5e: XDP fast RX drop bpf programs support")
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      366cbf2f
  4. 01 12月, 2016 9 次提交
    • 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: 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
      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
  5. 04 11月, 2016 1 次提交
    • M
      qede: Correctly map aggregation replacement pages · 9512925a
      Mintz, Yuval 提交于
      Driver allocates replacement buffers before-hand to make
      sure whenever an aggregation begins there would be a replacement
      for the Rx buffers, as we can't release the buffer until
      aggregation is terminated and driver logic assumes the Rx rings
      are always full.
      
      For every other Rx page that's being allocated [I.e., regular]
      the page is being completely mapped while for the replacement
      buffers only the first portion of the page is being mapped.
      This means that:
        a. Once replacement buffer replenishes the regular Rx ring,
      assuming there's more than a single packet on page we'd post unmapped
      memory toward HW [assuming mapping is actually done in granularity
      smaller than page].
        b. Unmaps are being done for the entire page, which is incorrect.
      
      Fixes: 55482edc ("qede: Add slowpath/fastpath support and enable hardware GRO")
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9512925a
  6. 01 11月, 2016 3 次提交
  7. 30 10月, 2016 1 次提交
  8. 23 10月, 2016 2 次提交
  9. 18 10月, 2016 1 次提交
  10. 14 10月, 2016 4 次提交
  11. 04 10月, 2016 1 次提交
  12. 24 9月, 2016 1 次提交
    • M
      net: Update API for VF vlan protocol 802.1ad support · 79aab093
      Moshe Shemesh 提交于
      Introduce new rtnl UAPI that exposes a list of vlans per VF, giving
      the ability for user-space application to specify it for the VF, as an
      option to support 802.1ad.
      We adjusted IP Link tool to support this option.
      
      For future use cases, the new UAPI supports multiple vlans. For now we
      limit the list size to a single vlan in kernel.
      Add IFLA_VF_VLAN_LIST in addition to IFLA_VF_VLAN to keep backward
      compatibility with older versions of IP Link tool.
      
      Add a vlan protocol parameter to the ndo_set_vf_vlan callback.
      We kept 802.1Q as the drivers' default vlan protocol.
      Suitable ip link tool command examples:
        Set vf vlan protocol 802.1ad:
          ip link set eth0 vf 1 vlan 100 proto 802.1ad
        Set vf to VST (802.1Q) mode:
          ip link set eth0 vf 1 vlan 100 proto 802.1Q
        Or by omitting the new parameter
          ip link set eth0 vf 1 vlan 100
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79aab093
  13. 10 9月, 2016 1 次提交
  14. 01 9月, 2016 1 次提交
  15. 24 8月, 2016 1 次提交
  16. 23 8月, 2016 1 次提交
    • Y
      qed*: Add support for VFs over legacy PFs · d8c2c7e3
      Yuval Mintz 提交于
      Modern VFs can't run on old non-compatible as the fastpath HSI is
      slightly changed - but as the HSI is actually very close [basically,
      a single bit whose meaning flipped] this can be supported with small
      modifications.
      
      The major differences would be in:
        - Recognizing that VF is running on top of a legacy PF.
        - Returning some slowpath configurations that are no longer needed
          on top of modern PFs, but would be required when working over
          the legacy ones.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d8c2c7e3
  17. 19 8月, 2016 3 次提交
  18. 16 8月, 2016 3 次提交
  19. 31 7月, 2016 2 次提交
  20. 01 7月, 2016 2 次提交