1. 01 3月, 2018 25 次提交
  2. 28 2月, 2018 15 次提交
    • D
      Merge tag 'mlx5-updates-2018-02-23' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux · fb66cb07
      David S. Miller 提交于
      Saeed Mahameed says:
      
      mlx5-update-2018-02-23 (IB representors)
      
      From: Mark Bloch <markb@mellanox.com>
      =========
      Add IB representor when in switchdev mode
      
      The following series adds support for an IB (RAW Ethernet only) device
      representor which is created when the user switches to switchdev mode.
      
      Today when switching to switchdev mode the only representors which are
      created are net devices. Each netdev is a representor of a virtual
      function and any data sent via the representor is received on the virtual
      function, and any data sent via the virtual function is received by the
      representor.
      
      For the mlx5 driver the main use of this functionality is to be able to
      use Open vSwitch on the hypervisor in order to manage/control traffic
      from/to the virtual functions. Open vSwitch can also work with  DPDK
      devices and not just net devices, this series exposes an IB device, which
      Mellanox PMD driver uses, which then can be used by Open vSwitch DPDK.
      
      An IB device representor exposes only RAW Ethernet QP capabilities and
      the ability to create flow rules to direct traffic to its RX queues. The
      state of the IB device (ACTIVE/DOWN etc..) is based on the state of the
      corresponding net device representor. No other RDMA/RoCE functionality is
      currently supported and no GID table is exposed.
      =========
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fb66cb07
    • D
      Merge branch 'mlx4-misc' · 3f5a6830
      David S. Miller 提交于
      Tariq Toukan says:
      
      ====================
      mlx4_en misc for 4.17
      
      This patchset contains misc enhancements from the team
      to the mlx4 Eth driver.
      
      Patch 1 by Eran adds physical layer counters.
      Patch 2 by Eran cleans-up a redundant warn print.
      Patch 3 combines the checks of two end cases into a single if statement.
      Patch 4 takes common code structures out of the #ifdef, following your
      comment on a previous patch.
      
      Series generated against net-next commit:
      f74290fd Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3f5a6830
    • T
      net/mlx4_en: RX csum, pre-define enabled protocols for IP status masking · a970d8db
      Tariq Toukan 提交于
      Pre-define a mask for IP status of a completion, that tests the
      MLX4_CQE_STATUS_IPV6 only in case CONFIG_IPV6 is enabled.
      Use it for IP status testing upon completion, instead of separating
      the datapath into two flows.
      This takes common code structures (such as closing parenthesis)
      back to their original place, and makes code more readable.
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Suggested-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a970d8db
    • T
      net/mlx4_en: Combine checks of end-cases in RX completion function · 1cb8b121
      Tariq Toukan 提交于
      Combine two end-cases in the same if statement with a single return value.
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1cb8b121
    • E
      net/mlx4_en: Remove unnecessary warn print in reset config · 4f32e1c4
      Eran Ben Elisha 提交于
      In mlx4_en_reset_config, there was a redundant warn print that was left
      from previous versions of this function. No warn is needed anymore.
      
      This warn can be confusing when RX-FCS is changed:
      Turn OFF RX-FCS:
        mlx4_en: eth1: Changing device configuration rx filter(0) rx vlan(1)
      Turn ON RX-FCS:
        mlx4_en: eth1: Changing device configuration rx filter(0) rx vlan(1)
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f32e1c4
    • E
      net/mlx4_en: Add physical RX/TX bytes/packets counters · f26d0d25
      Eran Ben Elisha 提交于
      Add physical RX/TX packets/bytes counters into ethtool output to monitor
      all traffic that was received and transmitted on the port. These
      counters are available only for none Virtual Function.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f26d0d25
    • D
      Merge branch 'mlxsw-Offloading-encapsulated-SPAN' · 431c7ec3
      David S. Miller 提交于
      Jiri Pirko says:
      
      ====================
      mlxsw: Offloading encapsulated SPAN
      
      Petr says:
      
      This patch series introduces support for mirroring with GRE
      encapsulation. It offloads tc action mirred mirror from a mlxsw port to
      either a gretap or an ip6gretap netdevice.
      
      Spectrum hardware needs to know all the details of the requested
      encapsulation: source and destination MAC and IP addresses, details of
      VLAN tagging, etc. The only variables are the encapsulated packet
      itself, and TOS field, which may be inherited. To that end, mlxsw driver
      resolves the route that encapsulated packets would take, queries the
      corresponding neighbor, and with that configuration in hand, configures
      the mirroring in the hardware.
      
      The driver also hooks into event handlers for netdevice changes, FIB and
      neighbor events, and reconsiders the configuration on each such change.
      When the new configuration differs from the currently-offloaded one, the
      existing offload is removed and replaced with a new one.
      
      It is possible to mirror to {ip6,}gretap from a matchall rule as well as
      from a flower match.
      
      ** Note that with this patch set, mlxsw build depends on NET_IPGRE and
         IPV6_GRE.
      
      Current limitations:
      
      - There has to be a route that directs packets to an mlxsw port. We
        intend to extend the logic to support other netdevice types in the
        future, but the eventual egress netdevice will have to be an mlxsw
        port in any case.
      
      - Offload reconfiguration due to changes in netdevice configuration
        creates a window of time where packets are not mirrored. Under some
        circumstances this can be prevented by configuring an unused port
        analyzer and migrating mirrors over to that. However that's currently
        not implemented.
      
      - Remote address of a tunnel device needs to be set, there may not be a
        GRE key, checksumming or sequence numbers, and TTL needs to be fixed
        (non-inherit). These are hard requirements imposed by the underlying
        hardware.
      
      - TOS of a tunnel device needs to be "inherit". The hardware supports a
        fixed TOS, but that's currently not implemented.
      
      The series start with two patches, #1 and #2, that publish one function
      and add support for querying IPv6 tunnel parameters.
      
      In patches #3 and #4, we introduce helpers to GRE and tunneling code
      that we will use later in the patchset from the SPAN code.
      
      Patches #5 and #6 introduce support for encapsulated SPAN in reg.h.
      
      The following seven patches, #7-#13, then prepare the SPAN codebase for
      introduction of mirroring to netdevices that don't correspond to front
      panel ports.
      
      Then #14 and #15 pull all this together to implement mirroring to
      {ip6,}gretap netdevices.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      431c7ec3
    • P
      mlxsw: spectrum_span: Support mirror to ip6gretap · 8f08a528
      Petr Machata 提交于
      Similarly to mirror-to-gretap, this enables mirroring to IPv6 gretap
      netdevice.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f08a528
    • P
      mlxsw: spectrum_span: Support mirror to gretap · 27cf76fe
      Petr Machata 提交于
      When a user requests mirror from a mlxsw physical port (possibly based
      on an ACL match) to a gretap netdevice, the driver needs to resolve the
      request to a particular physical port that the mirrored packets will
      egress through, and a suite of configuration keys (importantly, IP and
      MAC addresses). That means calling into routing and neighbor kernel code
      to simulate the decisions made by the system for packets passing through
      a gretap netdevice.
      
      Add a new instance of mlxsw_sp_span_entry_ops to support this.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      27cf76fe
    • P
      mlxsw: Move a mirroring check to mlxsw_sp_span_entry_create · 52a6444c
      Petr Machata 提交于
      The check for whether a mirror port (which is a mlxsw front panel port)
      belongs to the same mlxsw instance as the mirrored port, is currently
      only done in spectrum_acl, even though it's applicable for the matchall
      case as well. Thus move it to mlxsw_sp_span_entry_create().
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      52a6444c
    • P
      mlxsw: Handle config changes pertinent to SPAN · 803335ac
      Petr Machata 提交于
      For some netdevices, for which mlxsw offloads mirroring, may have a
      complex relationship between the declared intent and low-level
      device configuration.
      
      Trying to accurately track which changes might influence offloading
      decisions is finicky and error-prone. Instead, this patch introduces a
      function mlxsw_sp_span_entry_respin, which re-queries the configuration
      anew and, if different, removes the existing offloads and installs new
      ones.
      
      Call this function strategically at event handlers that might influence
      the mirroring configuration.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      803335ac
    • P
      mlxsw: spectrum_span: Generalize SPAN support · 169b5d95
      Petr Machata 提交于
      To support mirroring to different device types, the functions that
      partake in configuring the port analyzer need to be extended to admit
      non-trivial SPAN types.
      
      Create a structure where all details of SPAN configuration are kept,
      struct mlxsw_sp_span_parms. Also create struct mlxsw_sp_span_entry_ops
      to keep per-SPAN-type operations.
      
      Instantiate the latter once for MLXSW_REG_MPAT_SPAN_TYPE_LOCAL_ETH, and
      once for a suite of NOP callbacks used for invalidated SPAN entry. Put
      the formet as a sole member of a new array mlxsw_sp_span_entry_types,
      where all known SPAN types are kept. Introduce a new function,
      mlxsw_sp_span_entry_ops(), to look up the right ops suite given a
      netdevice.
      
      Change mlxsw_sp_span_mirror_add() to use both parms and ops structures.
      Change mlxsw_sp_span_entry_get() and mlxsw_sp_span_entry_create() to
      take these as arguments. Modify mlxsw_sp_span_entry_configure() and
      mlxsw_sp_span_entry_deconfigure() to dispatch to ops.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      169b5d95
    • P
      mlxsw: spectrum: Keep mirror netdev in mlxsw_sp_span_entry · 079c9f39
      Petr Machata 提交于
      Currently the only mirror action supported by mlxsw is mirror to another
      mlxsw physical port. Correspondingly, span_entry, which tracks each
      mlxsw mirror in the system, currently holds a u8 number of the
      destination port.
      
      To extend this system to mirror to gretap and ip6gretap netdevices, have
      struct mlxsw_sp_span_entry actually hold the destination netdevice
      itself.
      
      This change then trickles down in obvious manner to SPAN module API and
      mirror-related interfaces in struct mlxsw_afa_ops.
      
      To prevent use of invalid pointer, NETDEV_UNREGISTER needs to be hooked
      and the corresponding SPAN entry invalidated.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      079c9f39
    • P
      mlxsw: spectrum_span: Extract mlxsw_sp_span_entry_{de, }configure() · 7b2ef81f
      Petr Machata 提交于
      Configuring the hardware for encapsulated SPAN involves more code than
      the simple mirroring case. Extract the related code to a separate
      function to separate it from the rest of SPAN entry creation. Extract
      deconfigure as well for symmetry, even though disablement is the same
      regardless of SPAN type.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7b2ef81f
    • P
      mlxsw: spectrum_span: Initialize span_entry.id eagerly · 3546b03f
      Petr Machata 提交于
      It is known statically ahead of time which SPAN entry will have which
      ID. Just initialize it eagerly in mlxsw_sp_span_init(), don't wait until
      the entry is actually created. This simplifies some code in
      mlxsw_sp_span_entry_create()
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3546b03f