1. 29 9月, 2020 14 次提交
  2. 28 9月, 2020 1 次提交
  3. 27 9月, 2020 13 次提交
  4. 26 9月, 2020 9 次提交
    • J
      devlink: introduce flash update overwrite mask · 5d5b4128
      Jacob Keller 提交于
      Sections of device flash may contain settings or device identifying
      information. When performing a flash update, it is generally expected
      that these settings and identifiers are not overwritten.
      
      However, it may sometimes be useful to allow overwriting these fields
      when performing a flash update. Some examples include, 1) customizing
      the initial device config on first programming, such as overwriting
      default device identifying information, or 2) reverting a device
      configuration to known good state provided in the new firmware image, or
      3) in case it is suspected that current firmware logic for managing the
      preservation of fields during an update is broken.
      
      Although some devices are able to completely separate these types of
      settings and fields into separate components, this is not true for all
      hardware.
      
      To support controlling this behavior, a new
      DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK is defined. This is an
      nla_bitfield32 which will define what subset of fields in a component
      should be overwritten during an update.
      
      If no bits are specified, or of the overwrite mask is not provided, then
      an update should not overwrite anything, and should maintain the
      settings and identifiers as they are in the previous image.
      
      If the overwrite mask has the DEVLINK_FLASH_OVERWRITE_SETTINGS bit set,
      then the device should be configured to overwrite any of the settings in
      the requested component with settings found in the provided image.
      
      Similarly, if the DEVLINK_FLASH_OVERWRITE_IDENTIFIERS bit is set, the
      device should be configured to overwrite any device identifiers in the
      requested component with the identifiers from the image.
      
      Multiple overwrite modes may be combined to indicate that a combination
      of the set of fields that should be overwritten.
      
      Drivers which support the new overwrite mask must set the
      DEVLINK_SUPPORT_FLASH_UPDATE_OVERWRITE_MASK in the
      supported_flash_update_params field of their devlink_ops.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d5b4128
    • J
      devlink: convert flash_update to use params structure · bc75c054
      Jacob Keller 提交于
      The devlink core recently gained support for checking whether the driver
      supports a flash_update parameter, via `supported_flash_update_params`.
      However, parameters are specified as function arguments. Adding a new
      parameter still requires modifying the signature of the .flash_update
      callback in all drivers.
      
      Convert the .flash_update function to take a new `struct
      devlink_flash_update_params` instead. By using this structure, and the
      `supported_flash_update_params` bit field, a new parameter to
      flash_update can be added without requiring modification to existing
      drivers.
      
      As before, all parameters except file_name will require driver opt-in.
      Because file_name is a necessary field to for the flash_update to make
      sense, no "SUPPORTED" bitflag is provided and it is always considered
      valid. All future additional parameters will require a new bit in the
      supported_flash_update_params bitfield.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Cc: Jiri Pirko <jiri@mellanox.com>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Michael Chan <michael.chan@broadcom.com>
      Cc: Bin Luo <luobin9@huawei.com>
      Cc: Saeed Mahameed <saeedm@mellanox.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: Ido Schimmel <idosch@mellanox.com>
      Cc: Danielle Ratson <danieller@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc75c054
    • J
      devlink: check flash_update parameter support in net core · 22ec3d23
      Jacob Keller 提交于
      When implementing .flash_update, drivers which do not support
      per-component update are manually checking the component parameter to
      verify that it is NULL. Without this check, the driver might accept an
      update request with a component specified even though it will not honor
      such a request.
      
      Instead of having each driver check this, move the logic into
      net/core/devlink.c, and use a new `supported_flash_update_params` field
      in the devlink_ops. Drivers which will support per-component update must
      now specify this by setting DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT in
      the supported_flash_update_params in their devlink_ops.
      
      This helps ensure that drivers do not forget to check for a NULL
      component if they do not support per-component update. This also enables
      a slightly better error message by enabling the core stack to set the
      netlink bad attribute message to indicate precisely the unsupported
      attribute in the message.
      
      Going forward, any new additional parameter to flash update will require
      a bit in the supported_flash_update_params bitfield.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Cc: Jiri Pirko <jiri@mellanox.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Michael Chan <michael.chan@broadcom.com>
      Cc: Bin Luo <luobin9@huawei.com>
      Cc: Saeed Mahameed <saeedm@mellanox.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: Ido Schimmel <idosch@mellanox.com>
      Cc: Danielle Ratson <danieller@mellanox.com>
      Cc: Shannon Nelson <snelson@pensando.io>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22ec3d23
    • Y
      tcp: consolidate tcp_mark_skb_lost and tcp_skb_mark_lost · 534a2109
      Yuchung Cheng 提交于
      tcp_skb_mark_lost is used by RFC6675-SACK and can easily be replaced
      with the new tcp_mark_skb_lost handler.
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      534a2109
    • Y
      tcp: simplify tcp_mark_skb_lost · 68698970
      Yuchung Cheng 提交于
      This patch consolidates and simplifes the loss marking logic used
      by a few loss detections (RACK, RFC6675, NewReno). Previously
      each detection uses a subset of several intertwined subroutines.
      This unncessary complexity has led to bugs (and fixes of bug fixes).
      
      tcp_mark_skb_lost now is the single one routine to mark a packet loss
      when a loss detection caller deems an skb ist lost:
      
         1. rewind tp->retransmit_hint_skb if skb has lower sequence or
            all lost ones have been retransmitted.
      
         2. book-keeping: adjust flags and counts depending on if skb was
            retransmitted or not.
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      68698970
    • Y
      tcp: move tcp_mark_skb_lost · fd214674
      Yuchung Cheng 提交于
      A pure refactor to move tcp_mark_skb_lost to tcp_input.c to prepare
      for the later loss marking consolidation.
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd214674
    • Y
      tcp: consistently check retransmit hint · 179ac35f
      Yuchung Cheng 提交于
      tcp_simple_retransmit() used for path MTU discovery may not adjust
      the retransmit hint properly by deducting retrans_out before checking
      it to adjust the hint. This patch fixes this by a correct routine
      tcp_mark_skb_lost() already used by the RACK loss detection.
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      179ac35f
    • N
      net: bridge: mcast: remove only S,G port groups from sg_port hash · 74705582
      Nikolay Aleksandrov 提交于
      We should remove a group from the sg_port hash only if it's an S,G
      entry. This makes it correct and more symmetric with group add. Also
      since *,G groups are not added to that hash we can hide a bug.
      
      Fixes: 085b53c8 ("net: bridge: mcast: add sg_port rhashtable")
      Signed-off-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      74705582
    • F
      net: vlan: Avoid using BUG() in vlan_proto_idx() · d0186842
      Florian Fainelli 提交于
      While we should always make sure that we specify a valid VLAN protocol
      to vlan_proto_idx(), killing the machine when an invalid value is
      specified is too harsh and not helpful for debugging. All callers are
      capable of dealing with an error returned by vlan_proto_idx() so check
      the index value and propagate it accordingly.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0186842
  5. 25 9月, 2020 3 次提交