1. 28 3月, 2020 23 次提交
    • V
      net: dsa: implement auto-normalization of MTU for bridge hardware datapath · bff33f7e
      Vladimir Oltean 提交于
      Many switches don't have an explicit knob for configuring the MTU
      (maximum transmission unit per interface).  Instead, they do the
      length-based packet admission checks on the ingress interface, for
      reasons that are easy to understand (why would you accept a packet in
      the queuing subsystem if you know you're going to drop it anyway).
      
      So it is actually the MRU that these switches permit configuring.
      
      In Linux there only exists the IFLA_MTU netlink attribute and the
      associated dev_set_mtu function. The comments like to play blind and say
      that it's changing the "maximum transfer unit", which is to say that
      there isn't any directionality in the meaning of the MTU word. So that
      is the interpretation that this patch is giving to things: MTU == MRU.
      
      When 2 interfaces having different MTUs are bridged, the bridge driver
      MTU auto-adjustment logic kicks in: what br_mtu_auto_adjust() does is it
      adjusts the MTU of the bridge net device itself (and not that of the
      slave net devices) to the minimum value of all slave interfaces, in
      order for forwarded packets to not exceed the MTU regardless of the
      interface they are received and send on.
      
      The idea behind this behavior, and why the slave MTUs are not adjusted,
      is that normal termination from Linux over the L2 forwarding domain
      should happen over the bridge net device, which _is_ properly limited by
      the minimum MTU. And termination over individual slave devices is
      possible even if those are bridged. But that is not "forwarding", so
      there's no reason to do normalization there, since only a single
      interface sees that packet.
      
      The problem with those switches that can only control the MRU is with
      the offloaded data path, where a packet received on an interface with
      MRU 9000 would still be forwarded to an interface with MRU 1500. And the
      br_mtu_auto_adjust() function does not really help, since the MTU
      configured on the bridge net device is ignored.
      
      In order to enforce the de-facto MTU == MRU rule for these switches, we
      need to do MTU normalization, which means: in order for no packet larger
      than the MTU configured on this port to be sent, then we need to limit
      the MRU on all ports that this packet could possibly come from. AKA
      since we are configuring the MRU via MTU, it means that all ports within
      a bridge forwarding domain should have the same MTU.
      
      And that is exactly what this patch is trying to do.
      
      >From an implementation perspective, we try to follow the intent of the
      user, otherwise there is a risk that we might livelock them (they try to
      change the MTU on an already-bridged interface, but we just keep
      changing it back in an attempt to keep the MTU normalized). So the MTU
      that the bridge is normalized to is either:
      
       - The most recently changed one:
      
         ip link set dev swp0 master br0
         ip link set dev swp1 master br0
         ip link set dev swp0 mtu 1400
      
         This sequence will make swp1 inherit MTU 1400 from swp0.
      
       - The one of the most recently added interface to the bridge:
      
         ip link set dev swp0 master br0
         ip link set dev swp1 mtu 1400
         ip link set dev swp1 master br0
      
         The above sequence will make swp0 inherit MTU 1400 as well.
      Suggested-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bff33f7e
    • V
      net: dsa: configure the MTU for switch ports · bfcb8132
      Vladimir Oltean 提交于
      It is useful be able to configure port policers on a switch to accept
      frames of various sizes:
      
      - Increase the MTU for better throughput from the default of 1500 if it
        is known that there is no 10/100 Mbps device in the network.
      - Decrease the MTU to limit the latency of high-priority frames under
        congestion, or work around various network segments that add extra
        headers to packets which can't be fragmented.
      
      For DSA slave ports, this is mostly a pass-through callback, called
      through the regular ndo ops and at probe time (to ensure consistency
      across all supported switches).
      
      The CPU port is called with an MTU equal to the largest configured MTU
      of the slave ports. The assumption is that the user might want to
      sustain a bidirectional conversation with a partner over any switch
      port.
      
      The DSA master is configured the same as the CPU port, plus the tagger
      overhead. Since the MTU is by definition L2 payload (sans Ethernet
      header), it is up to each individual driver to figure out if it needs to
      do anything special for its frame tags on the CPU port (it shouldn't
      except in special cases). So the MTU does not contain the tagger
      overhead on the CPU port.
      However the MTU of the DSA master, minus the tagger overhead, is used as
      a proxy for the MTU of the CPU port, which does not have a net device.
      This is to avoid uselessly calling the .change_mtu function on the CPU
      port when nothing should change.
      
      So it is safe to assume that the DSA master and the CPU port MTUs are
      apart by exactly the tagger's overhead in bytes.
      
      Some changes were made around dsa_master_set_mtu(), function which was
      now removed, for 2 reasons:
        - dev_set_mtu() already calls dev_validate_mtu(), so it's redundant to
          do the same thing in DSA
        - __dev_set_mtu() returns 0 if ops->ndo_change_mtu is an absent method
      That is to say, there's no need for this function in DSA, we can safely
      call dev_set_mtu() directly, take the rtnl lock when necessary, and just
      propagate whatever errors get reported (since the user probably wants to
      be informed).
      
      Some inspiration (mainly in the MTU DSA notifier) was taken from a
      vaguely similar patch from Murali and Florian, who are credited as
      co-developers down below.
      Co-developed-by: NMurali Krishna Policharla <murali.policharla@broadcom.com>
      Signed-off-by: NMurali Krishna Policharla <murali.policharla@broadcom.com>
      Co-developed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bfcb8132
    • M
      bgmac: configure MTU and add support for frames beyond 8192 byte size · 8c7da639
      Murali Krishna Policharla 提交于
      Change DMA descriptor length to handle jumbo frames beyond 8192 bytes.
      Also update jumbo frame max size to include FCS, the DMA packet length
      received includes FCS.
      Signed-off-by: NMurali Krishna Policharla <murali.policharla@broadcom.com>
      Reviewed-by: NArun Parameswaran <arun.parameswaran@broadcom.com>
      Reviewed-by: NRay Jui <ray.jui@broadcom.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c7da639
    • M
      net: phy: bcm7xx: add jumbo frame configuration to PHY · ab41ca34
      Murali Krishna Policharla 提交于
      The BCM7XX PHY family requires special configuration to pass jumbo
      frames. Do that during initial PHY setup.
      Signed-off-by: NMurali Krishna Policharla <murali.policharla@broadcom.com>
      Reviewed-by: NScott Branden <scott.branden@broadcom.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ab41ca34
    • D
      Merge tag 'wireless-drivers-next-2020-03-27' of... · 22f33971
      David S. Miller 提交于
      Merge tag 'wireless-drivers-next-2020-03-27' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      Kalle Valo says:
      
      ====================
      wireless-drivers-next patches for v5.7
      
      Third set of patches for v5.7. Nothing really special this time,
      business as usual.
      
      When pulling this to net-next there's again a conflict in:
      
      drivers/net/wireless/intel/iwlwifi/pcie/drv.c
      
      To solve this drop these three lines from the conflict (the first hunk
      from "HEAD") as the whole AX200 block was moved above in the same
      file:
      
      	IWL_DEV_INFO(0x2723, 0x1653, iwl_ax200_cfg_cc, iwl_ax200_killer_1650w_name),
      	IWL_DEV_INFO(0x2723, 0x1654, iwl_ax200_cfg_cc, iwl_ax200_killer_1650x_name),
      	IWL_DEV_INFO(0x2723, IWL_CFG_ANY, iwl_ax200_cfg_cc, iwl_ax200_name),
      
      And keep all the __IWL_DEV_INFO() entries (the second hunk). In other
      words, take everything from wireless-drivers-next. When running 'git
      diff' after the resolution the output should be empty.
      
      Major changes:
      
      brcmfmac
      
      * add USB autosuspend support
      
      ath11k
      
      * handle RX fragments
      
      * enable PN offload
      
      * add support for HE BSS color
      
      iwlwifi
      
      * support new FW API version
      
      * support for EDCA measurements
      
      * new scan API features
      
      * enable new firmware debugging code
      ====================
      
      Kalle gave me directions on how to resolve the iwlwifi conflict
      as follows:
      
      ====================
      When pulling this to net-next there's again a conflict in:
      
      drivers/net/wireless/intel/iwlwifi/pcie/drv.c
      
      To solve this drop these three lines from the conflict (the first hunk
      from "HEAD") as the whole AX200 block was moved above in the same
      file:
      
      	IWL_DEV_INFO(0x2723, 0x1653, iwl_ax200_cfg_cc, iwl_ax200_killer_1650w_name),
      	IWL_DEV_INFO(0x2723, 0x1654, iwl_ax200_cfg_cc, iwl_ax200_killer_1650x_name),
      	IWL_DEV_INFO(0x2723, IWL_CFG_ANY, iwl_ax200_cfg_cc, iwl_ax200_name),
      
      And keep all the __IWL_DEV_INFO() entries (the second hunk). In other
      words, take everything from wireless-drivers-next. When running 'git
      diff' after the resolution the output should be empty.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22f33971
    • D
      Merge branch 's390-qeth-next' · 0b992b89
      David S. Miller 提交于
      Julian Wiedmann says:
      
      ====================
      s390/qeth: updates 2020-03-27
      
      please apply the following patch series for qeth to netdev's net-next
      tree.
      
      Spring clean edition:
      - remove one sysfs attribute that was never put in use,
      - make support for OSN and OSX devices optional, and
      - probe for removal of the obsolete OSN support.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0b992b89
    • J
      s390/qeth: phase out OSN support · fb64de1b
      Julian Wiedmann 提交于
      OSN devices currently spend an awful long time in qeth_l2_set_online()
      until various unsupported HW cmds time out. This has been broken for
      over two years, ever since
      commit d22ffb5a ("s390/qeth: fix IPA command submission race")
      triggered a FW bug in cmd processing.
      Prior to commit 782e4a79 ("s390/qeth: don't poll for cmd IO completion"),
      this wait for timeout would have even been spent busy-polling.
      
      The offending patch was picked up by stable and all relevant distros,
      and yet noone noticed.
      OSN setups only ever worked in combination with an out-of-tree blob, and
      the last machine that even offered HW with OSN support was released back
      in 2015.
      
      Rather than attempting to work-around this FW issue for no actual gain,
      add a deprecation warning so anyone who still wants to maintain this
      part of the code can speak up. Else rip it all out in 2021.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fb64de1b
    • J
      s390/qeth: make OSN / OSX support configurable · 4e2b5aa5
      Julian Wiedmann 提交于
      The last machine generation that supports OSN is z13, and OSX is only
      supported up to z14. Allow users and distros to decide whether they
      still need support for these device types.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4e2b5aa5
    • J
      s390/qeth: remove fake_broadcast attribute · 5f4019a8
      Julian Wiedmann 提交于
      Ever since commit 4a71df50 ("qeth: new qeth device driver") introduced
      this attribute, it can be read & written but has no actual effect.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5f4019a8
    • D
      Merge branch 'bnxt_en-Updates-to-devlink-info_get-cb' · 4bd27ee6
      David S. Miller 提交于
      Vasundhara Volam says:
      
      ====================
      bnxt_en: Updates to devlink info_get cb
      
      This series adds support for a generic macro to devlink info_get cb.
      Adds support for fw.mgmt.api and board.id info to bnxt_en driver info_get
      cb. Also, updates the devlink-info.rst and bnxt.rst documentation
      accordingly.
      
      This series adds a patch to fix few macro names that maps to bnxt_en
      firmware versions.
      
      v1->v2: Remove ECN dev param, base_mh_addr and serial number info support
      in this series.
      Rename drv.spec macro to fw.api.
      ---
      v2->v3: Remove hw.addr info as it is per netdev but not per device info.
      ---
      v3->v4: Rename "fw.api" to "fw.mgmt.api".
      Also, add a patch that modifies few macro names in info_get command,
      to match the devlink documentation.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4bd27ee6
    • V
      bnxt_en: Fix "fw.mgmt" and "fw.nsci" info via devlink info_get cb · 2013d038
      Vasundhara Volam 提交于
      Fix macro names to report fw.mgmt and fw.ncsi versions to match the
      devlink documentation.
      
      Example display after fixes:
      
      $ devlink dev info pci/0000:af:00.0
      pci/0000:af:00.0:
        driver bnxt_en
        serial_number B0-26-28-FF-FE-25-84-20
        versions:
            fixed:
              board.id BCM957454A4540
              asic.id C454
              asic.rev 1
            running:
              fw 216.1.154.0
              fw.psid 0.0.0
              fw.mgmt 216.1.146.0
              fw.mgmt.api 1.10.1
              fw.ncsi 864.0.44.0
              fw.roce 216.1.16.0
      
      Fixes: 9599e036 ("bnxt_en: Add support for devlink info command")
      Signed-off-by: NVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2013d038
    • V
      bnxt_en: Add partno to devlink info_get cb · 56d69c78
      Vasundhara Volam 提交于
      Add part number info from the vital product data to info_get command
      via devlink tool. Update bnxt.rst documentation as well.
      
      Cc: Jakub Kicinski <kuba@kernel.org>
      Signed-off-by: NVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      56d69c78
    • V
      bnxt_en: Read partno and serialno of the board from VPD · a0d0fd70
      Vasundhara Volam 提交于
      Store the part number and serial number information from VPD in
      the bnxt structure. Follow up patch will add the support to display
      the information via devlink command.
      Signed-off-by: NVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a0d0fd70
    • V
      PCI: Add new PCI_VPD_RO_KEYWORD_SERIALNO macro · 16efafa3
      Vasundhara Volam 提交于
      This patch adds a new macro for serial number keyword.
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16efafa3
    • V
      bnxt_en: Add fw.mgmt.api version to devlink info_get cb. · b7a444f0
      Vasundhara Volam 提交于
      Display the minimum version of firmware interface spec supported
      between driver and firmware. Also update bnxt.rst documentation file.
      Signed-off-by: NVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7a444f0
    • V
      devlink: Add macro for "fw.mgmt.api" to info_get cb. · 2d9eade8
      Vasundhara Volam 提交于
      Add definition and documentation for the new generic info
      "fw.mgmt.api". This macro specifies the version of the software
      interfaces between driver and firmware.
      
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiri Pirko <jiri@mellanox.com>
      Signed-off-by: NVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d9eade8
    • D
      Merge branch 'mlxsw-Various-static-checkers-fixes' · a1c7a536
      David S. Miller 提交于
      Ido Schimmel says:
      
      ====================
      mlxsw: Various static checkers fixes
      
      Jakub told me he gets some warnings with W=1, so I decided to check with
      sparse, smatch and coccinelle as well. This patch set fixes all the
      issues found. None are actual bugs / regressions and therefore not
      targeted at net.
      
      Patches #1-#2 add missing kernel-doc comments.
      
      Patch #3 removes dead code.
      
      Patch #4 reworks the ACL code to avoid defining a static variable in a
      header file.
      
      Patch #5 removes unnecessary conversion to bool that coccinelle warns
      about.
      
      Patch #6 avoids false-positive uninitialized symbol errors emitted by
      smatch.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a1c7a536
    • I
      mlxsw: spectrum_router: Avoid uninitialized symbol errors · a84acf78
      Ido Schimmel 提交于
      Suppress the following smatch errors. None of these are actually
      possible with current code paths.
      
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1220
      mlxsw_sp_ipip_entry_find_decap() error: uninitialized symbol 'saddrp'.
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1220
      mlxsw_sp_ipip_entry_find_decap() error: uninitialized symbol
      'saddr_len'.
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1221
      mlxsw_sp_ipip_entry_find_decap() error: uninitialized symbol
      'saddr_prefix_len'.
      
      drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:1390
      mlxsw_sp_netdevice_ipip_ol_reg_event() error: uninitialized symbol
      'ipipt'.
      
      drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3255
      mlxsw_sp_nexthop_group_update() error: uninitialized symbol 'err'.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a84acf78
    • I
      mlxsw: switchx2: Remove unnecessary conversion to bool · cfe9701a
      Ido Schimmel 提交于
      Suppress following warning from coccinelle:
      
      drivers/net/ethernet/mellanox/mlxsw//switchx2.c:183:63-68: WARNING:
      conversion to bool not needed here
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cfe9701a
    • I
      mlxsw: core_acl: Avoid defining static variable in header file · e1da9618
      Ido Schimmel 提交于
      The static array 'mlxsw_afk_element_infos' in 'core_acl_flex_keys.h' is
      copied to each file that includes the header, but not all use it. This
      results in the following warnings when compiling with W=1:
      
      drivers/net/ethernet/mellanox/mlxsw//core_acl_flex_keys.h:76:44:
      warning: ‘mlxsw_afk_element_infos’ defined but not used
      [-Wunused-const-variable=]
      
      One way to suppress the warning is to mark the array with
      '__maybe_unused', but another option is to remove it from the header
      file entirely.
      
      Change 'struct mlxsw_afk_element_inst' to store the key to the array
      ('element') instead of the array value keyed by 'element'. Adjust the
      different users accordingly.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e1da9618
    • I
      mlxsw: spectrum: Remove unused RIF and FID families · bdb373cf
      Ido Schimmel 提交于
      In merge commit 50853808 ("Merge branch
      'mlxsw-Prepare-for-VLAN-aware-bridge-w-VxLAN'") I flipped mlxsw to use
      emulated 802.1Q FIDs and correspondingly emulated VLAN RIFs. This means
      that the non-emulated variants are no longer used. Remove them and
      suppress the following warnings when compiling with W=1:
      
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:7572:38: warning:
      ‘mlxsw_sp_rif_vlan_ops’ defined but not used [-Wunused-const-variable=]
      
      drivers/net/ethernet/mellanox/mlxsw//spectrum_fid.c:584:41: warning:
      ‘mlxsw_sp_fid_8021q_family’ defined but not used
      [-Wunused-const-variable=]
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bdb373cf
    • I
      mlxsw: spectrum_router: Add proper function documentation · f0a66984
      Ido Schimmel 提交于
      Suppress following warnings when compiling with W=1:
      
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1552: warning:
      Function parameter or member 'mlxsw_sp' not described in
      '__mlxsw_sp_ipip_entry_update_tunnel'
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1552: warning:
      Function parameter or member 'ipip_entry' not described in
      '__mlxsw_sp_ipip_entry_update_tunnel'
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1552: warning:
      Function parameter or member 'extack' not described in
      '__mlxsw_sp_ipip_entry_update_tunnel'
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f0a66984
    • I
      mlxsw: i2c: Add missing field documentation · 5769e39c
      Ido Schimmel 提交于
      Suppress following warning when compiling with W=1:
      
      drivers/net/ethernet/mellanox/mlxsw//i2c.c:78: warning: Function
      parameter or member 'cmd' not described in 'mlxsw_i2c'
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5769e39c
  2. 27 3月, 2020 17 次提交