1. 27 8月, 2021 8 次提交
  2. 26 8月, 2021 7 次提交
  3. 24 8月, 2021 3 次提交
  4. 19 8月, 2021 1 次提交
  5. 17 8月, 2021 2 次提交
  6. 14 8月, 2021 2 次提交
    • L
      net: hns3: remove always exist devlink pointer check · a1fcb106
      Leon Romanovsky 提交于
      The devlink pointer always exists after hclge_devlink_init() succeed.
      Remove that check together with NULL setting after release and ensure
      that devlink_register is last command prior to call to devlink_reload_enable().
      
      Fixes: b741269b ("net: hns3: add support for registering devlink for PF")
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a1fcb106
    • A
      ethernet: fix PTP_1588_CLOCK dependencies · e5f31552
      Arnd Bergmann 提交于
      The 'imply' keyword does not do what most people think it does, it only
      politely asks Kconfig to turn on another symbol, but does not prevent
      it from being disabled manually or built as a loadable module when the
      user is built-in. In the ICE driver, the latter now causes a link failure:
      
      aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_eth_ioctl':
      ice_main.c:(.text+0x13b0): undefined reference to `ice_ptp_get_ts_config'
      ice_main.c:(.text+0x13b0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_get_ts_config'
      aarch64-linux-ld: ice_main.c:(.text+0x13bc): undefined reference to `ice_ptp_set_ts_config'
      ice_main.c:(.text+0x13bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_set_ts_config'
      aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_prepare_for_reset':
      ice_main.c:(.text+0x31fc): undefined reference to `ice_ptp_release'
      ice_main.c:(.text+0x31fc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_release'
      aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_rebuild':
      
      This is a recurring problem in many drivers, and we have discussed
      it several times befores, without reaching a consensus. I'm providing
      a link to the previous email thread for reference, which discusses
      some related problems.
      
      To solve the dependency issue better than the 'imply' keyword, introduce a
      separate Kconfig symbol "CONFIG_PTP_1588_CLOCK_OPTIONAL" that any driver
      can depend on if it is able to use PTP support when available, but works
      fine without it. Whenever CONFIG_PTP_1588_CLOCK=m, those drivers are
      then prevented from being built-in, the same way as with a 'depends on
      PTP_1588_CLOCK || !PTP_1588_CLOCK' dependency that does the same trick,
      but that can be rather confusing when you first see it.
      
      Since this should cover the dependencies correctly, the IS_REACHABLE()
      hack in the header is no longer needed now, and can be turned back
      into a normal IS_ENABLED() check. Any driver that gets the dependency
      wrong will now cause a link time failure rather than being unable to use
      PTP support when that is in a loadable module.
      
      However, the two recently added ptp_get_vclocks_index() and
      ptp_convert_timestamp() interfaces are only called from builtin code with
      ethtool and socket timestamps, so keep the current behavior by stubbing
      those out completely when PTP is in a loadable module. This should be
      addressed properly in a follow-up.
      
      As Richard suggested, we may want to actually turn PTP support into a
      'bool' option later on, preventing it from being a loadable module
      altogether, which would be one way to solve the problem with the ethtool
      interface.
      
      Fixes: 06c16d89 ("ice: register 1588 PTP clock device object for E810 devices")
      Link: https://lore.kernel.org/netdev/20210804121318.337276-1-arnd@kernel.org/
      Link: https://lore.kernel.org/netdev/CAK8P3a06enZOf=XyZ+zcAwBczv41UuCTz+=0FMf2gBz1_cOnZQ@mail.gmail.com/
      Link: https://lore.kernel.org/netdev/CAK8P3a3=eOxE-K25754+fB_-i_0BZzf9a9RfPTX3ppSwu9WZXw@mail.gmail.com/
      Link: https://lore.kernel.org/netdev/20210726084540.3282344-1-arnd@kernel.org/Acked-by: NShannon Nelson <snelson@pensando.io>
      Acked-by: NJacob Keller <jacob.e.keller@intel.com>
      Acked-by: NRichard Cochran <richardcochran@gmail.com>
      Reviewed-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20210812183509.1362782-1-arnd@kernel.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      e5f31552
  7. 12 8月, 2021 1 次提交
  8. 10 8月, 2021 1 次提交
  9. 09 8月, 2021 1 次提交
    • L
      devlink: Set device as early as possible · 919d13a7
      Leon Romanovsky 提交于
      All kernel devlink implementations call to devlink_alloc() during
      initialization routine for specific device which is used later as
      a parent device for devlink_register().
      
      Such late device assignment causes to the situation which requires us to
      call to device_register() before setting other parameters, but that call
      opens devlink to the world and makes accessible for the netlink users.
      
      Any attempt to move devlink_register() to be the last call generates the
      following error due to access to the devlink->dev pointer.
      
      [    8.758862]  devlink_nl_param_fill+0x2e8/0xe50
      [    8.760305]  devlink_param_notify+0x6d/0x180
      [    8.760435]  __devlink_params_register+0x2f1/0x670
      [    8.760558]  devlink_params_register+0x1e/0x20
      
      The simple change of API to set devlink device in the devlink_alloc()
      instead of devlink_register() fixes all this above and ensures that
      prior to call to devlink_register() everything already set.
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      919d13a7
  10. 28 7月, 2021 2 次提交
    • Y
      net: hns3: change the method of obtaining default ptp cycle · 8373cd38
      Yufeng Mo 提交于
      The ptp cycle is related to the hardware, so it may cause compatibility
      issues if a fixed value is used in driver. Therefore, the method of
      obtaining this value is changed to read from the register rather than
      use a fixed value in driver.
      
      Fixes: 0bf5eb78 ("net: hns3: add support for PTP")
      Signed-off-by: NYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8373cd38
    • A
      dev_ioctl: split out ndo_eth_ioctl · a7605370
      Arnd Bergmann 提交于
      Most users of ndo_do_ioctl are ethernet drivers that implement
      the MII commands SIOCGMIIPHY/SIOCGMIIREG/SIOCSMIIREG, or hardware
      timestamping with SIOCSHWTSTAMP/SIOCGHWTSTAMP.
      
      Separate these from the few drivers that use ndo_do_ioctl to
      implement SIOCBOND, SIOCBR and SIOCWANDEV commands.
      
      This is a purely cosmetic change intended to help readers find
      their way through the implementation.
      
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Vladimir Oltean <olteanv@gmail.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: linux-rdma@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a7605370
  11. 26 7月, 2021 6 次提交
  12. 20 7月, 2021 5 次提交
    • J
      net: hns3: fix rx VLAN offload state inconsistent issue · bbfd4506
      Jian Shen 提交于
      Currently, VF doesn't enable rx VLAN offload when initializating,
      and PF does it for VFs. If user disable the rx VLAN offload for
      VF with ethtool -K, and reload the VF driver, it may cause the
      rx VLAN offload state being inconsistent between hardware and
      software.
      
      Fixes it by enabling rx VLAN offload when VF initializing.
      
      Fixes: e2cb1dec ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      bbfd4506
    • J
      net: hns3: disable port VLAN filter when support function level VLAN filter control · 184cd221
      Jian Shen 提交于
      For hardware limitation, port VLAN filter is port level, and
      effective for all the functions of the port. So if not support
      port VLAN bypass, it's necessary to disable the port VLAN filter,
      in order to support function level VLAN filter control.
      
      Fixes: 2ba30662 ("net: hns3: add support for modify VLAN filter state")
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      184cd221
    • P
      net: hns3: add match_id to check mailbox response from PF to VF · 4671042f
      Peng Li 提交于
      When VF need response from PF, VF will wait (1us - 1s) to receive
      the response, or it will wait timeout and the VF action fails.
      If VF do not receive response in 1st action because timeout,
      the 2nd action may receive response for the 1st action, and get
      incorrect response data.VF must reciveve the right response from
      PF,or it will cause unexpected error.
      
      This patch adds match_id to check mailbox response from PF to VF,
      to make sure VF get the right response:
      1. The message sent from VF was labelled with match_id which was a
      unique 16-bit non-zero value.
      2. The response sent from PF will label with match_id which got from
      the request.
      3. The VF uses the match_id to match request and response message.
      
      This scheme depends on PF driver supports match_id, if PF driver doesn't
      support then VF will uses the original scheme.
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4671042f
    • C
      net: hns3: fix possible mismatches resp of mailbox · 1b713d14
      Chengwen Feng 提交于
      Currently, the mailbox synchronous communication between VF and PF use
      the following fields to maintain communication:
      1. Origin_mbx_msg which was combined by message code and subcode, used
      to match request and response.
      2. Received_resp which means whether received response.
      
      There may possible mismatches of the following situation:
      1. VF sends message A with code=1 subcode=1.
      2. PF was blocked about 500ms when processing the message A.
      3. VF will detect message A timeout because it can't get the response
      within 500ms.
      4. VF sends message B with code=1 subcode=1 which equal message A.
      5. PF processes the first message A and send the response message to
      VF.
      6. VF will identify the response matched the message B because the
      code/subcode is the same. This will lead to mismatch of request and
      response.
      
      To fix the above bug, we use the following scheme:
      1. The message sent from VF was labelled with match_id which was a
      unique 16-bit non-zero value.
      2. The response sent from PF will label with match_id which got from
      the request.
      3. The VF uses the match_id to match request and response message.
      
      As for PF driver, it only needs to copy the match_id from request to
      response.
      
      Fixes: dde1a86e ("net: hns3: Add mailbox support to PF driver")
      Signed-off-by: NChengwen Feng <fengchengwen@huawei.com>
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      1b713d14
    • R
      net: hisilicon: rename CACHE_LINE_MASK to avoid redefinition · b16f3299
      Randy Dunlap 提交于
      Building on ARCH=arc causes a "redefined" warning, so rename this
      driver's CACHE_LINE_MASK to avoid the warning.
      
      ../drivers/net/ethernet/hisilicon/hip04_eth.c:134: warning: "CACHE_LINE_MASK" redefined
        134 | #define CACHE_LINE_MASK   0x3F
      In file included from ../include/linux/cache.h:6,
                       from ../include/linux/printk.h:9,
                       from ../include/linux/kernel.h:19,
                       from ../include/linux/list.h:9,
                       from ../include/linux/module.h:12,
                       from ../drivers/net/ethernet/hisilicon/hip04_eth.c:7:
      ../arch/arc/include/asm/cache.h:17: note: this is the location of the previous definition
         17 | #define CACHE_LINE_MASK  (~(L1_CACHE_BYTES - 1))
      
      Fixes: d413779c ("net: hisilicon: Add an tx_desc to adapt HI13X1_GMAC")
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Jiangfeng Xiao <xiaojiangfeng@huawei.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b16f3299
  13. 29 6月, 2021 1 次提交