1. 17 9月, 2020 22 次提交
    • L
      cxgb4vf: convert to use DEFINE_SEQ_ATTRIBUTE macro · b948577b
      Liu Shixin 提交于
      Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.
      Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b948577b
    • S
      ionic: dynamic interrupt moderation · 04a83459
      Shannon Nelson 提交于
      Use the dim library to manage dynamic interrupt
      moderation in ionic.
      
      v3: rebase
      v2: untangled declarations in ionic_dim_work()
      Signed-off-by: NShannon Nelson <snelson@pensando.io>
      Acked-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      04a83459
    • K
      net/smc: check variable before dereferencing in smc_close.c · ddcc9b7f
      Karsten Graul 提交于
      smc->clcsock and smc->clcsock->sk are used before the check if they can
      be dereferenced. Fix this by checking the variables first.
      
      Fixes: a60a2b1e ("net/smc: reduce active tcp_listen workers")
      Reported-by: Nkernel test robot <lkp@intel.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ddcc9b7f
    • N
      net: bridge: mcast: don't ignore return value of __grp_src_toex_excl · d5bf31dd
      Nikolay Aleksandrov 提交于
      When we're handling TO_EXCLUDE report in EXCLUDE filter mode we should
      not ignore the return value of __grp_src_toex_excl() as we'll miss
      sending notifications about group changes.
      
      Fixes: 5bf1e00b ("net: bridge: mcast: support for IGMPV3/MLDv2 CHANGE_TO_INCLUDE/EXCLUDE report")
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d5bf31dd
    • S
      net: stmmac: Add support to Ethtool get/set ring parameters · aa042f60
      Song, Yoong Siang 提交于
      This patch add support to --show-ring & --set-ring Ethtool functions:
      - Adding min, max, power of two check to new ring parameter's value.
      - Bring down the network interface before changing the value of ring
        parameters.
      - Bring up the network interface after changing the value of ring
        parameters.
      Signed-off-by: NSong, Yoong Siang <yoong.siang.song@intel.com>
      Signed-off-by: NVoon Weifeng <weifeng.voon@intel.com>
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aa042f60
    • D
      Merge branch 'mlxsw-Refactor-headroom-management' · 18e9a407
      David S. Miller 提交于
      Ido Schimmel says:
      
      ====================
      mlxsw: Refactor headroom management
      
      Petr says:
      
      On Spectrum, port buffers, also called port headroom, is where packets are
      stored while they are parsed and the forwarding decision is being made. For
      lossless traffic flows, in case shared buffer admission is not allowed,
      headroom is also where to put the extra traffic received before the sent
      PAUSE takes effect. Another aspect of the port headroom is the so called
      internal buffer, which is used for egress mirroring.
      
      Linux supports two DCB interfaces related to the headroom: dcbnl_setbuffer
      for configuration, and dcbnl_getbuffer for inspection. In order to make it
      possible to implement these interfaces, it is first necessary to clean up
      headroom handling, which is currently strewn in several places in the
      driver.
      
      The end goal is an architecture whereby it is possible to take a copy of
      the current configuration, adjust parameters, and then hand the proposed
      configuration over to the system to implement it. When everything works,
      the proposed configuration is accepted and saved. First, this centralizes
      the reconfiguration handling to one function, which takes care of
      coordinating buffer size changes and priority map changes to avoid
      introducing drops. Second, the fact that the configuration is all in one
      place makes it easy to keep a backup and handle error path rollbacks, which
      were previously hard to understand.
      
      Patch #1 introduces struct mlxsw_sp_hdroom, which will keep port headroom
      configuration.
      
      Patch #2 unifies handling of delay provision between PFC and PAUSE. From
      now on, delay is to be measured in bytes of extra space, and will not
      include MTU. PFC handler sets the delay directly from the parameter it gets
      through the DCB interface. For PAUSE, MLXSW_SP_PAUSE_DELAY is converted to
      have the same meaning.
      
      In patches #3-#5, MTU, lossiness and priorities are gradually moved over to
      struct mlxsw_sp_hdroom.
      
      In patches #6-#11, handling of buffer resizing and priority maps is moved
      from spectrum.c and spectrum_dcb.c to spectrum_buffers.c. The API is
      gradually adapted so that struct mlxsw_sp_hdroom becomes the main interface
      through which the various clients express how the headroom should be
      configured.
      
      Patch #12 is a small cleanup that the previous transformation made
      possible.
      
      In patch #13, the port init code becomes a boring client of the headroom
      code, instead of rolling its own thing.
      
      Patches #14 and #15 move handling of internal mirroring buffer to the new
      headroom code as well. Previously, this code was in the SPAN module. This
      patchset converts the SPAN module to another boring client of the headroom
      code.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      18e9a407
    • P
      mlxsw: spectrum_buffers: Manage internal buffer in the hdroom code · 22881adf
      Petr Machata 提交于
      Traffic mirroring modes that are in-chip implemented on egress need an
      internal buffer to work. As the only client, the SPAN module was managing
      the buffer so far. However logically it belongs to the buffers module. E.g.
      buffer size validation needs to take the size of the internal buffer into
      account.
      
      Therefore move the related code from SPAN to spectrum_buffers. Move over
      the callbacks that determine the minimum buffer size as a function of
      maximum speed and MTU. Add a field describing the internal buffer to struct
      mlxsw_sp_hdroom. Extend mlxsw_sp_hdroom_bufs_reset_sizes() to take care of
      sizing the internal buffer as well. Change the SPAN module to invoke that
      function and mlxsw_sp_hdroom_configure() like all the other hdroom clients.
      Drop the now-unnecessary mlxsw_sp_span_port_buffer_disable().
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22881adf
    • P
      mlxsw: spectrum_buffers: Introduce shared buffer ops · a41b9626
      Petr Machata 提交于
      The size of the internal buffer is currently calculated in the SPAN module.
      Logically it belongs to the spectrum_buffers module, where it should be
      moved. However, that being a chip-specific operation, it needs dynamic
      dispatch. There currently is a chip-specific structure for description of
      shared buffer values, struct mlxsw_sp_sb_vals. However placing ops into
      this structure would be confusing. Therefore introduce a new per-chip
      structure, currently empty, and initialize the ops pointer as appropriate.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a41b9626
    • P
      mlxsw: spectrum_buffers: Convert mlxsw_sp_port_headroom_init() · 0cda1a9b
      Petr Machata 提交于
      Currently mlxsw_sp_port_headroom_init() configures both priomap and buffers
      by hand. Additionally, for port buffers, it configures buffer 0 with a size
      that it will never again have if PFC configuration is touched.
      
      Rewrite the init code to become a client of the new hdroom code. The only
      difference in invocation is that the configuration is forced, so that it is
      issued even if the desired configuration happens to match what is contained
      in (hitherto not initialized with meaningful values) mlxsw_sp_port->hdroom.
      
      Since now mlxsw_sp_port_headroom_init() initializes all the PG buffers to
      meaningful values, mlxsw_sp_hdroom_configure_buffers() can avoid querying
      the current configuration, and can fill the whole PBMC itself.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0cda1a9b
    • P
      mlxsw: spectrum_buffers: Inline mlxsw_sp_sb_max_headroom_cells() · bd3e86a5
      Petr Machata 提交于
      This function is now only used from the buffers module, and is a trivial
      field reference. Just inline it and drop the related artifacts.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd3e86a5
    • P
      mlxsw: spectrum_buffers: Move here the new headroom code · 4c22f29f
      Petr Machata 提交于
      Move all the headroom code to the spectrum_buffers module, where it
      belongs.
      
      Rename mlxsw_sp_pg_buf_threshold_get() and mlxsw_sp_pg_buf_pack() to
      ..._hdroom_... to match the naming convention of the new headroom code.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c22f29f
    • P
      mlxsw: spectrum: Move here the three-step headroom configuration from DCB · 7ace2c36
      Petr Machata 提交于
      The ETS handler performs the headroom configuration in three steps: first
      it resizes the buffers and adds any new ones. Then it redirects priorities
      to the new buffers. And finally it sets the size of the now-unused buffers
      to zero. This way no packet drops are introduced.
      
      This sort of careful approach will also be useful for configuring port
      buffer sizes and priority map by hand, through dcbnl_setbuffer. Therefore
      move the code from the DCB handler to the generic headroom function.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ace2c36
    • P
      mlxsw: spectrum_dcb: Convert mlxsw_sp_port_pg_prio_map() to hdroom code · e9c97e0e
      Petr Machata 提交于
      The new hdroom code has certain conventions: iteration over priorities is
      done through a variable named `prio', configuration is not pushed unless it
      is dirty, but a `force' flag can be used to override this, updated
      configuration is written to port. Convert the function
      mlxsw_sp_port_pg_prio_map() to use these conventions and rename
      appropriately to fit in.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9c97e0e
    • P
      mlxsw: spectrum_dcb: Convert ETS handler fully to mlxsw_sp_hdroom_configure() · 8ec5e6b9
      Petr Machata 提交于
      The ETS handler performs the headroom configuration in three steps: first
      it resizes the buffers and adds any new ones. Then it redirects priorities
      to the new buffers. And finally it sets the size of the now-unused buffers
      to zero. This way no packet drops are introduced.
      
      Both of the buffer size configuration operations are simply buffer size
      configurations, there is no material difference between setting buffers to
      zero and any other value. Therefore simply invoke the same
      mlxsw_sp_hdroom_configure(), and drop mlxsw_sp_port_pg_destroy() and
      mlxsw_sp_ets_has_pg() which are now unused.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8ec5e6b9
    • P
      mlxsw: spectrum: Split headroom autoresize out of buffer configuration · 2d9f703f
      Petr Machata 提交于
      Split mlxsw_sp_port_headroom_set() to three functions.
      mlxsw_sp_hdroom_bufs_reset_sizes() changes the sizes of the individual PG
      buffers, and mlxsw_sp_hdroom_configure_buffers() will actually apply the
      configuration. A third function, mlxsw_sp_hdroom_bufs_fit(), verifies that
      the requested buffer configuration matches total headroom size
      requirements.
      
      Add wrappers, mlxsw_sp_hdroom_configure() and __..., that will eventually
      perform full headroom configuration, but for now, only have them verify the
      configured headroom size, and invoke mlxsw_sp_hdroom_configure_buffers().
      Have them take the `force` argument to prepare for a later patch, even
      though it is currently unused.
      
      Note that the loop in mlxsw_sp_hdroom_configure_buffers() only goes through
      DCBX_MAX_BUFFERS. Since there is no logic to configure the control buffer,
      it needs to keep the values queried from the FW. Eventually this function
      should configure all the PGs.
      
      Note that conversion of __mlxsw_sp_dcbnl_ieee_setets() is not trivial. That
      function performs the headroom configuration in three steps: first it
      resizes the buffers and adds any new ones. Then it redirects priorities to
      the new buffers. And finally it sets the size of the now-unused buffers to
      zero. This way no packet drops are introduced.
      
      So after invoking mlxsw_sp_hdroom_bufs_reset_sizes(), tweak the
      configuration to keep the old sizes of PG buffers for those buffers whose
      size was set to zero.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d9f703f
    • P
      mlxsw: spectrum: Track buffer sizes in struct mlxsw_sp_hdroom · aa7c0621
      Petr Machata 提交于
      So far, port buffers were always autoconfigured. When dcbnl_setbuffer
      callback is implemented, it will allow the user to change the buffer size
      configuration by hand. The sizes therefore need to be a configuration
      parameter, not always deduced, and therefore belong to struct
      mlxsw_sp_hdroom, where the configuration routine should take them from.
      
      Update mlxsw_sp_port_headroom_set() to update these sizes. Have the
      function update the sizes even for the case that a given buffer is not
      used.
      
      Additionally, change the loop iteration end to DCBX_MAX_BUFFERS instead of
      IEEE_8021QAZ_MAX_TCS. The value is the same, but the semantics differ.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aa7c0621
    • P
      mlxsw: spectrum: Track lossiness in struct mlxsw_sp_hdroom · ca21e84e
      Petr Machata 提交于
      Client-side configuration has lossiness as an attribute of a priority.
      Therefore add a "lossy" attribute to struct mlxsw_sp_hdroom_prio.
      
      To a Spectrum ASIC, lossiness is a feature of a port buffer. Therefore add
      struct mlxsw_sp_hdroom_buf, which in the following patches will get more
      attributes, but right now only use it to track port buffer lossiness.
      
      Instead of passing around the primary indicators of PFC and pause_en, add a
      function mlxsw_sp_hdroom_bufs_reset_lossiness() to compute the buffer
      lossiness from the priority map and priority lossiness. Change
      mlxsw_sp_port_headroom_set() to take the buffer lossy flag from the
      headroom configuration. Have the PFC and pause handlers configure priority
      lossiness in mlxsw_sp_hdroom, from where it will propagate.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ca21e84e
    • P
      mlxsw: spectrum: Track priorities in struct mlxsw_sp_hdroom · 5df825ed
      Petr Machata 提交于
      The mapping from priorities to buffers determines which buffers should be
      configured. Lossiness of these priorities combined with the mapping
      determines whether a given buffer should be lossy.
      
      Currently this configuration is stored implicitly in DCB ETS, PFC and
      ethtool PAUSE configuration. Keeping it together with the rest of the
      headroom configuration and deriving it as needed from PFC / ETS / PAUSE
      will make things clearer. To that end, add a field "prios" to struct
      mlxsw_sp_hdroom.
      
      Previously, __mlxsw_sp_port_headroom_set() took prio_tc as an argument, and
      assumed that the same mapping as we use on the egress should be used on
      ingress as well. Instead, track this configuration at each priority, so
      that it can be adjusted flexibly.
      
      In the following patches, as dcbnl_setbuffer is implemented, it will need
      to store its own mapping, and it will also be sometimes necessary to revert
      back to the original ETS mapping. Therefore track two buffer indices: the
      one for chip configuration (buf_idx), and the source one (ets_buf_idx).
      Introduce a function to configure the chip-level buffer index, and for now
      have it simply copy the ETS mapping over to the chip mapping.
      
      Update the ETS handler to project prio_tc to the ets_buf_idx and invoke the
      buf_idx recomputation.
      
      Now that there is a canonical place to look for this configuration,
      mlxsw_sp_port_headroom_set() does not need to invent def_prio_tc to use if
      DCB is compiled out.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5df825ed
    • P
      mlxsw: spectrum: Track MTU in struct mlxsw_sp_hdroom · 0103a3e4
      Petr Machata 提交于
      MTU influences sizes of auto-allocated buffers. Make it a part of port
      buffer configuration and have __mlxsw_sp_port_headroom_set() take it from
      there, instead of as an argument.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0103a3e4
    • P
      mlxsw: spectrum: Unify delay handling between PFC and pause · b7e07bbd
      Petr Machata 提交于
      When a priority is marked as lossless using DCB PFC, or when pause frames
      are enabled on a port, mlxsw adds to port buffers an extra space to cover
      the traffic that will arrive between the time that a pause or PFC frame is
      emitted, and the time traffic actually stops. This is called the delay. The
      concept is the same in PFC and pause, however the way the extra buffer
      space is calculated differs.
      
      In this patch, unify this handling. Delay is to be measured in bytes of
      extra space, and will not include MTU. PFC handler sets the delay directly
      from the parameter it gets through the DCB interface.
      
      To convert pause handler, move MLXSW_SP_PAUSE_DELAY to ethtool module,
      convert to bytes, and reduce it by maximum MTU, and divide by two. Then it
      has the same meaning as the delay_bytes set by the PFC handler.
      
      Keep the delay_bytes value in struct mlxsw_sp_hdroom introduced in the
      previous patch. Change PFC and pause handlers to store the new delay value
      there and have __mlxsw_sp_port_headroom_set() take it from there.
      
      Instead of mlxsw_sp_pfc_delay_get() and mlxsw_sp_pg_buf_delay_get(),
      introduce mlxsw_sp_hdroom_buf_delay_get() to calculate the delay provision.
      Drop the unnecessary MLXSW_SP_CELL_FACTOR, and instead add an explanatory
      comment describing the formula used.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7e07bbd
    • P
      mlxsw: spectrum_buffers: Add struct mlxsw_sp_hdroom · 3a77f5a2
      Petr Machata 提交于
      The port headroom handling is currently strewn across several modules and
      tricky to follow: MTU, DCB PFC, DCB ETS and ethtool pause all influence the
      settings, and then there is the completely separate initial configuraion in
      spectrum_buffers. A following patch will implement the dcbnl_setbuffer
      callback, which is going to further complicate the landscape.
      
      In order to simplify work with port buffers, the following patches are
      going to centralize all port-buffer handling in spectrum_buffers. As a
      first step, introduce a (currently empty) struct mlxsw_sp_hdroom that will
      keep the configuration parameters, and allocate and free it in appropriate
      places.
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a77f5a2
    • D
      Merge tag 'mlx5-updates-2020-09-15' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 045e42f3
      David S. Miller 提交于
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2020-09-15
      
      Various updates to mlx5 driver,
      
      1) Eli adds support for TC trap action.
      2) Eran, minor improvements to clock.c code structure
      3) Better handling of error reporting in LAG from Jianbo
      4) IPv6 traffic class (DSCP) header rewrite support from Maor
      5) Ofer Levi adds support for CQE compression of multi-strides packets
      6) Vu, Enables use of vport meta data by default.
      7) Some minor code cleanup
      ====================
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      045e42f3
  2. 16 9月, 2020 18 次提交