1. 12 10月, 2020 10 次提交
  2. 11 10月, 2020 9 次提交
  3. 10 10月, 2020 21 次提交
    • J
      Merge branch 'netlink-export-policy-on-validation-failures' · c77fb07f
      Jakub Kicinski 提交于
      Johannes Berg says:
      
      ====================
      netlink: export policy on validation failures
      
      Export the policy used for attribute validation when it fails,
      so e.g. for an out-of-range attribute userspace immediately gets
      the valid ranges back.
      
      v2 incorporates the suggestion from Jakub to have a function to
      estimate the size (netlink_policy_dump_attr_size_estimate()) and
      check that it does the right thing on the *normal* policy dumps,
      not (just) when calling it from the error scenario.
      
      v3 only addresses a few minor style issues.
      
      v4 fixes up a forgotten 'git add' ... sorry.
      
      v5 is a resend, I messed up v4's cover letter subject (saying v3)
      and apparently the second patch didn't go out at all.
      
      Tested using nl80211/iw in a few scenarios, seems to work fine
      and return the policy back, e.g.
      
      kernel reports: integer out of range
      policy: 04 00 0b 00 0c 00 04 00 01 00 00 00 00 00 00 00
              ^ padding
                          ^ minimum allowed value
      policy: 04 00 0b 00 0c 00 05 00 ff ff ff ff 00 00 00 00
              ^ padding
                          ^ maximum allowed value
      policy: 08 00 01 00 04 00 00 00
              ^ type 4 == U32
      
      for an out-of-range case.
      ====================
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      c77fb07f
    • J
      netlink: export policy in extended ACK · 44f3625b
      Johannes Berg 提交于
      Add a new attribute NLMSGERR_ATTR_POLICY to the extended ACK
      to advertise the policy, e.g. if an attribute was out of range,
      you'll know the range that's permissible.
      
      Add new NL_SET_ERR_MSG_ATTR_POL() and NL_SET_ERR_MSG_ATTR_POL()
      macros to set this, since realistically it's only useful to do
      this when the bad attribute (offset) is also returned.
      
      Use it in lib/nlattr.c which practically does all the policy
      validation.
      
      v2:
       - add and use netlink_policy_dump_attr_size_estimate()
      v3:
       - remove redundant break
      v4:
       - really remove redundant break ... sorry
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      44f3625b
    • J
      netlink: policy: refactor per-attr policy writing · d2681e93
      Johannes Berg 提交于
      Refactor the per-attribute policy writing into a new
      helper function, to be used later for dumping out the
      policy of a rejected attribute.
      
      v2:
       - fix some indentation
      v3:
       - change variable order in netlink_policy_dump_write()
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      d2681e93
    • J
      Merge branch 'net-smc-updates-2020-10-07' · c4cc0b9c
      Jakub Kicinski 提交于
      Karsten Graul says:
      
      ====================
      net/smc: updates 2020-10-07
      
      Patch 1 and 2 address warnings from static code checkers, and patch 3
      handles a case when all proposed ISM V2 devices fail to init and no V1
      devices are tried afterwards.
      ====================
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      c4cc0b9c
    • K
      net/smc: restore smcd_version when all ISM V2 devices failed to init · f29fa003
      Karsten Graul 提交于
      Field ini->smcd_version is set to SMC_V2 before calling
      smc_listen_ism_init(). This clears the V1 bit that may be set. When all
      matching ISM V2 devices fail to initialize then the smcd_version field
      needs to get restored to allow any possible V1 devices to initialize.
      And be consistent, always go to the not_found label when no device was
      found.
      Signed-off-by: NKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      f29fa003
    • K
      net/smc: cleanup buffer usage in smc_listen_work() · 9047a617
      Karsten Graul 提交于
      coccinelle informs about
      net/smc/af_smc.c:1770:10-11: WARNING: opportunity for kzfree/kvfree_sensitive
      
      Its not that kzfree() would help here, the memset() is done to prepare
      the buffer for another socket receive.
      Fix that warning message by reordering the calls, while at it eliminate
      the unneeded variable cclc2 and use sizeof(*buf) as above in the same
      function. No functional changes.
      Signed-off-by: NKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      9047a617
    • K
      net/smc: consolidate unlocking in same function · c60a2cef
      Karsten Graul 提交于
      Static code checkers warn of inconsistent returns because the lgr mutex
      is locked in one function and unlocked in a function called by the
      locking function:
      net/smc/af_smc.c:823 smc_connect_rdma() warn: inconsistent returns 'smc_client_lgr_pending'.
      net/smc/af_smc.c:897 smc_connect_ism() warn: inconsistent returns 'smc_server_lgr_pending'.
      
      Make the code consistent by doing the unlock in the same function that
      fetches the lock. No functional changes.
      Signed-off-by: NKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      c60a2cef
    • J
      Merge tag 'linux-can-next-for-5.10-20201007' of... · 8f5e71b9
      Jakub Kicinski 提交于
      Merge tag 'linux-can-next-for-5.10-20201007' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
      
      Marc Kleine-Budde says:
      
      ====================
      linux-can-next-for-5.10-20201007
      
      The first 3 patches are by me and fix several warnings found
      when compiling the  kernel with W=1.
      
      Lukas Bulwahn's patch adjusts the MAINTAINERS file, to accommodate
      the renaming of the mcp251xfd driver.
      
      Vincent Mailhol contributes 3 patches for the CAN networking layer.
      First error queue support is added the the CAN RAW protocol.
      The second patch converts the get_can_dlc() and get_canfd_dlc()
      in-Kernel-only macros from using __u8 to u8.
      The third patch adds a helper function to calculate the length of
      one bit in in multiple of time quanta.
      
      Oliver Hartkopp's patch add support for the ISO 15765-2:2016
      transport protocol to the CAN stack.
      
      Three patches by Lad Prabhakar add documentation for various
      new rcar controllers to the device tree bindings of the rcar_can
      and rcan_canfd driver.
      
      Michael Walle's patch adds various processors to the flexcan
      driver binding documentation.
      
      The next two patches are by me and target the flexcan driver aswell.
      The remove the ack_grp and ack_bit from the fsl,stop-mode DT property
      and the driver, as they are not used anymore. As these are the last
      two arguments this change will not break existing device trees.
      
      The last three patches are by Srinivas Neeli and target
      the xilinx_can driver.
      The first one increases the lower limit for the bit rate
      prescaler to 2, the other two fix sparse and coverity findings.
      ====================
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      8f5e71b9
    • J
      Merge branch '100GbE-Intel-Wired-LAN-Driver-Updates-2020-10-07' · 3b8f56ee
      Jakub Kicinski 提交于
      Tony Nguyen says:
      
      ====================
      100GbE Intel Wired LAN Driver Updates 2020-10-07
      
      This series contains updates to ice driver only.
      
      Andy Shevchenko changes usage to %*phD format to print small buffer as hex
      string.
      
      Bruce removes repeated words reported by checkpatch.
      
      Ani changes ice_info_get_dsn() to return void as it always returns
      success.
      
      Jake adds devlink reporting of fw.app.bundle_id. Moves devlink_port
      structure to ice_vsi to resolve issues with cleanup. Adds additional
      debug info for firmware updates.
      
      Bixuan Cui resolves -Wpointer-to-int-cast warnings.
      
      Dan adds additional packet type masks and checks to prevent overwriting
      existing Flow Director rules.
      ====================
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      3b8f56ee
    • D
      ice: fix adding IP4 IP6 Flow Director rules · 051d2b5c
      Dan Nowlin 提交于
      A subsequent addition of an IP4 or IP6 rule after other rules would
      overwrite any existing TCAM entries of related L4 protocols(ex: tcp4 or
      udp6). This was due to the mask including too many TCAM entries. Add new
      packet type masks with bits properly excluded so rules are not overwritten.
      Signed-off-by: NDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: NHenry Tieman <henry.w.tieman@intel.com>
      Tested-by: NBrijesh Behera <brijeshx.behera@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      051d2b5c
    • B
      ice: Fix pointer cast warnings · ecfb751f
      Bixuan Cui 提交于
      pointers should be casted to unsigned long to avoid
      -Wpointer-to-int-cast warnings:
      
      drivers/net/ethernet/intel/ice/ice_flow.h:197:33: warning:
          cast from pointer to integer of different size
      drivers/net/ethernet/intel/ice/ice_flow.h:198:32: warning:
          cast to pointer from integer of different size
      Signed-off-by: NBixuan Cui <cuibixuan@huawei.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ecfb751f
    • J
      ice: add additional debug logging for firmware update · 1e8249cc
      Jacob Keller 提交于
      While debugging a recent failure to update the flash of an ice device,
      I found it helpful to add additional logging which helped determine the
      root cause of the problem being a timeout issue.
      
      Add some extra dev_dbg() logging messages which can be enabled using the
      dynamic debug facility, including one for ice_aq_wait_for_event that
      will use jiffies to capture a rough estimate of how long we waited for
      the completion of a firmware command.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NBrijesh Behera <brijeshx.behera@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      1e8249cc
    • J
      ice: refactor devlink_port to be per-VSI · 48d40025
      Jacob Keller 提交于
      Currently, the devlink_port structure is stored within the ice_pf. This
      made sense because we create a single devlink_port for each PF. This
      setup does not mesh with the abstractions in the driver very well, and
      led to a flow where we accidentally call devlink_port_unregister twice
      during error cleanup.
      
      In particular, if devlink_port_register or devlink_port_unregister are
      called twice, this leads to a kernel panic. This appears to occur during
      some possible flows while cleaning up from a failure during driver
      probe.
      
      If register_netdev fails, then we will call devlink_port_unregister in
      ice_cfg_netdev as it cleans up. Later, we again call
      devlink_port_unregister since we assume that we must cleanup the port
      that is associated with the PF structure.
      
      This occurs because we cleanup the devlink_port for the main PF even
      though it was not allocated. We allocated the port within a per-VSI
      function for managing the main netdev, but did not release the port when
      cleaning up that VSI, the allocation and destruction are not aligned.
      
      Instead of attempting to manage the devlink_port as part of the PF
      structure, manage it as part of the PF VSI. Doing this has advantages,
      as we can match the de-allocation of the devlink_port with the
      unregister_netdev associated with the main PF VSI.
      
      Moving the port to the VSI is preferable as it paves the way for
      handling devlink ports allocated for other purposes such as SR-IOV VFs.
      
      Since we're changing up how we allocate the devlink_port, also change
      the indexing. Originally, we indexed the port using the PF id number.
      This came from an old goal of sharing a devlink for each physical
      function. Managing devlink instances across multiple function drivers is
      not workable. Instead, lets set the port number to the logical port
      number returned by firmware and set the index using the VSI index
      (sometimes referred to as VSI handle).
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      48d40025
    • J
      ice: add the DDP Track ID to devlink info · 410d0687
      Jacob Keller 提交于
      Add "fw.app.bundle_id" to display the DDP Track ID of the active DDP
      package. This id is similar to "fw.bundle_id" and is a unique identifier
      for the DDP package that is loaded in the device. Each new DDP has
      a unique Track ID generated for it, and the ID can be used to identify
      and track the DDP package.
      
      Add documentation for the new devlink info version.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      410d0687
    • A
      ice: Change ice_info_get_dsn to be void · 045afac4
      Anirudh Venkataramanan 提交于
      ice_info_get_dsn always returns 0, so just make it void.
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      045afac4
    • B
      ice: remove repeated words · ac382a09
      Bruce Allan 提交于
      A new test in checkpatch detects repeated words; cleanup all pre-existing
      occurrences of those now.
      Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Co-developed-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ac382a09
    • A
      ice: devlink: use %*phD to print small buffer · 4d7ebed6
      Andy Shevchenko 提交于
      Use %*phD format to print small buffer as hex string.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4d7ebed6
    • C
      net: dsa: microchip: add ksz9563 to ksz9477 I2C driver · 5d3b8ec9
      Christian Eggers 提交于
      Add support for the KSZ9563 3-Port Gigabit Ethernet Switch to the
      ksz9477 driver. The KSZ9563 supports both SPI (already in) and I2C. The
      ksz9563 is already in the device tree binding documentation.
      Signed-off-by: NChristian Eggers <ceggers@arri.de>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      5d3b8ec9
    • M
      net/rds: suppress page allocation failure error in recv buffer refill · 9f0bb95e
      Manjunath Patil 提交于
      RDS/IB tries to refill the recv buffer in softirq context using
      GFP_NOWAIT flag. However alloc failure is handled by queueing a work to
      refill the recv buffer with GFP_KERNEL flag. This means failure to
      allocate with GFP_NOWAIT isn't fatal. Do not print the PAF warnings if
      softirq context fails to refill the recv buffer. We will see the PAF
      warnings when worker also fails to allocate.
      Signed-off-by: NManjunath Patil <manjunath.b.patil@oracle.com>
      Reviewed-by: NAruna Ramakrishna <aruna.ramakrishna@oracle.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      9f0bb95e
    • J
      Merge branch 'devlink-add-reload-action-and-limit-options' · 91bca7f7
      Jakub Kicinski 提交于
      Moshe Shemesh says:
      
      ====================
      Add devlink reload action and limit options
      
      Introduce new options on devlink reload API to enable the user to select
      the reload action required and constrains limits on these actions that he
      may want to ensure. Complete support for reload actions in mlx5.
      The following reload actions are supported:
        driver_reinit: driver entities re-initialization, applying devlink-param
                       and devlink-resource values.
        fw_activate: firmware activate.
      
      The uAPI is backward compatible, if the reload action option is omitted
      from the reload command, the driver reinit action will be used.
      Note that when required to do firmware activation some drivers may need
      to reload the driver. On the other hand some drivers may need to reset
      the firmware to reinitialize the driver entities. Therefore, the devlink
      reload command returns the actions which were actually performed.
      
      By default reload actions are not limited and driver implementation may
      include reset or downtime as needed to perform the actions.
      However, if reload limit is selected, the driver should perform only if
      it can do it while keeping the limit constraints.
      Reload limit added:
        no_reset: No reset allowed, no down time allowed, no link flap and no
                  configuration is lost.
      
      Each driver which supports devlink reload command should expose the
      reload actions and limits supported.
      
      Add reload stats to hold the history per reload action per limit.
      For example, the number of times fw_activate has been done on this
      device since the driver module was added or if the firmware activation
      was done with or without reset.
      
      Patch 1 changes devlink_reload_supported() param type to enable using
              it before allocating devlink.
      Patch 2-3 add the new API reload action and reload limit options to
                devlink reload.
      Patch 4-5 add reload stats and remote reload stats. These stats are
                exposed through devlink dev get.
      Patches 6-11 add support on mlx5 for devlink reload action fw_activate
                  and handle the firmware reset events.
      Patches 12-13 add devlink enable remote dev reset parameter and use it
                   in mlx5.
      Patches 14-15 mlx5 add devlink reload limit no_reset support for
                    fw_activate reload action.
      Patch 16 adds documentation file devlink-reload.rst
      ====================
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      91bca7f7
    • M
      devlink: Add Documentation/networking/devlink/devlink-reload.rst · eb79d754
      Moshe Shemesh 提交于
      Add devlink reload rst documentation file.
      Update index file to include it.
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      eb79d754