1. 18 Nov, 2018 11 commits
    • David S. Miller's avatar
      Merge branch 'ncsi-Allow-enabling-multiple-packages-and-channels' · 1115439f
      David S. Miller authored
      Samuel Mendoza-Jonas says:
      
      ====================
      net/ncsi: Allow enabling multiple packages & channels
      
      This series extends the NCSI driver to configure multiple packages
      and/or channels simultaneously. Since the RFC series this includes a few
      extra changes to fix areas in the driver that either made this harder or
      were roadblocks due to deviations from the NCSI specification.
      
      Patches 1 & 2 fix two issues where the driver made assumptions about the
      capabilities of the NCSI topology.
      Patches 3 & 4 change some internal semantics slightly to make multi-mode
      easier.
      Patch 5 introduces a cleaner way of reconfiguring the NCSI configuration
      and keeping track of channel states.
      Patch 6 implements the main multi-package/multi-channel configuration,
      configured via the Netlink interface.
      
      Readers who have an interesting NCSI setup - especially multi-package
      with HWA - please test! I think I've covered all permutations but I
      don't have infinite hardware to test on.
      
      Changes in v2:
      - Updated use of the channel lock in ncsi_reset_dev(), making the
      channel invisible and leaving the monitor check to
      ncsi_stop_channel_monitor().
      - Fixed ncsi_channel_is_tx() to consider the state of channels in other
      packages.
      Changes in v3:
      - Fixed bisectability bug in patch 1
      - Consider channels on all packages in a few places when multi-package
      is enabled.
      - Avoid doubling up reset operations, and check the current driver state
      before reset to let any running operations complete.
      - Reorganise the LSC handler slightly to avoid enabling Tx twice.
      Changes in v4:
      - Fix failover in the single-channel case
      - Better handle ncsi_reset_dev() entry during a current config/suspend
      operation.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1115439f
    • Samuel Mendoza-Jonas's avatar
      net/ncsi: Configure multi-package, multi-channel modes with failover · 8d951a75
      Samuel Mendoza-Jonas authored
      This patch extends the ncsi-netlink interface with two new commands and
      three new attributes to configure multiple packages and/or channels at
      once, and configure specific failover modes.
      
      NCSI_CMD_SET_PACKAGE mask and NCSI_CMD_SET_CHANNEL_MASK set a whitelist
      of packages or channels allowed to be configured with the
      NCSI_ATTR_PACKAGE_MASK and NCSI_ATTR_CHANNEL_MASK attributes
      respectively. If one of these whitelists is set only packages or
      channels matching the whitelist are considered for the channel queue in
      ncsi_choose_active_channel().
      
      These commands may also use the NCSI_ATTR_MULTI_FLAG to signal that
      multiple packages or channels may be configured simultaneously. NCSI
      hardware arbitration (HWA) must be available in order to enable
      multi-package mode. Multi-channel mode is always available.
      
      If the NCSI_ATTR_CHANNEL_ID attribute is present in the
      NCSI_CMD_SET_CHANNEL_MASK command the it sets the preferred channel as
      with the NCSI_CMD_SET_INTERFACE command. The combination of preferred
      channel and channel whitelist defines a primary channel and the allowed
      failover channels.
      If the NCSI_ATTR_MULTI_FLAG attribute is also present then the preferred
      channel is configured for Tx/Rx and the other channels are enabled only
      for Rx.
      Signed-off-by: default avatarSamuel Mendoza-Jonas <sam@mendozajonas.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d951a75
    • Samuel Mendoza-Jonas's avatar
      net/ncsi: Reset channel state in ncsi_start_dev() · 2878a2cf
      Samuel Mendoza-Jonas authored
      When the NCSI driver is stopped with ncsi_stop_dev() the channel
      monitors are stopped and the state set to "inactive". However the
      channels are still configured and active from the perspective of the
      network controller. We should suspend each active channel but in the
      context of ncsi_stop_dev() the transmit queue has been or is about to be
      stopped so we won't have time to do so.
      
      Instead when ncsi_start_dev() is called if the NCSI topology has already
      been probed then call ncsi_reset_dev() to suspend any channels that were
      previously active. This resets the network controller to a known state,
      provides an up to date view of channel link state, and makes sure that
      mode flags such as NCSI_MODE_TX_ENABLE are properly reset.
      
      In addition to ncsi_start_dev() use ncsi_reset_dev() in ncsi-netlink.c
      to update the channel configuration more cleanly.
      Signed-off-by: default avatarSamuel Mendoza-Jonas <sam@mendozajonas.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2878a2cf
    • Samuel Mendoza-Jonas's avatar
      net/ncsi: Don't mark configured channels inactive · 0b970e1b
      Samuel Mendoza-Jonas authored
      The concepts of a channel being 'active' and it having link are slightly
      muddled in the NCSI driver. Tweak this slightly so that
      NCSI_CHANNEL_ACTIVE represents a channel that has been configured and
      enabled, and NCSI_CHANNEL_INACTIVE represents a de-configured channel.
      This distinction is important because a channel can be 'active' but have
      its link down; in this case the channel may still need to be configured
      so that it may receive AEN link-state-change packets.
      Signed-off-by: default avatarSamuel Mendoza-Jonas <sam@mendozajonas.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0b970e1b
    • Samuel Mendoza-Jonas's avatar
      net/ncsi: Don't deselect package in suspend if active · cd09ab09
      Samuel Mendoza-Jonas authored
      When a package is deselected all channels of that package cease
      communication. If there are other channels active on the package of the
      suspended channel this will disable them as well, so only send a
      deselect-package command if no other channels are active.
      Signed-off-by: default avatarSamuel Mendoza-Jonas <sam@mendozajonas.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cd09ab09
    • Samuel Mendoza-Jonas's avatar
      net/ncsi: Probe single packages to avoid conflict · 8e13f70b
      Samuel Mendoza-Jonas authored
      Currently the NCSI driver sends a select-package command to all possible
      packages simultaneously to discover what packages are available. However
      at this stage in the probe process the driver does not know if
      hardware arbitration is available: if it isn't then this process could
      cause collisions on the RMII bus when packages try to respond.
      
      Update the probe loop to probe each package one by one, and once
      complete check if HWA is universally supported.
      Signed-off-by: default avatarSamuel Mendoza-Jonas <sam@mendozajonas.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8e13f70b
    • Samuel Mendoza-Jonas's avatar
      net/ncsi: Don't enable all channels when HWA available · 60ab49bf
      Samuel Mendoza-Jonas authored
      NCSI hardware arbitration allows multiple packages to be enabled at once
      and share the same wiring. If the NCSI driver recognises that HWA is
      available it unconditionally enables all packages and channels; but that
      is a configuration decision rather than something required by HWA.
      Additionally the current implementation will not failover on link events
      which can cause connectivity to be lost unless the interface is manually
      bounced.
      
      Retain basic HWA support but remove the separate configuration path to
      enable all channels, leaving this to be handled by a later
      implementation.
      Signed-off-by: default avatarSamuel Mendoza-Jonas <sam@mendozajonas.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60ab49bf
    • Arjun Vynipadath's avatar
      cxgb4: Remove SGE_HOST_PAGE_SIZE dependency on page size · 2391b003
      Arjun Vynipadath authored
      The SGE Host Page Size has nothing to do with the actual
      Host Page Size. It's the SGE's BAR2 Doorbell/GTS Page Size
      for interpreting the SGE Ingress/Egress Queue per Page values.
      Firmware reads all of these things and makes all the
      subsequent changes necessary. The Host Driver uses the SGE
      Host Page Size in order to properly calculate BAR2 Offsets.
      Signed-off-by: default avatarCasey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarArjun Vynipadath <arjun@chelsio.com>
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2391b003
    • Yousuk Seung's avatar
      tcp: add SRTT to SCM_TIMESTAMPING_OPT_STATS · e8bd8fca
      Yousuk Seung authored
      Add TCP_NLA_SRTT to SCM_TIMESTAMPING_OPT_STATS that reports the smoothed
      round trip time in microseconds (tcp_sock.srtt_us >> 3).
      Signed-off-by: default avatarYousuk Seung <ysseung@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Acked-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8bd8fca
    • Stephen Hemminger's avatar
      uapi/ethtool: fix spelling errors · 54e8cb78
      Stephen Hemminger authored
      Trivial spelling errors found by codespell.
      Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54e8cb78
    • David S. Miller's avatar
      tun: Adjust on-stack tun_page initialization. · 6f0271d9
      David S. Miller authored
      Instead of constantly playing with the struct initializer
      syntax trying to make gcc and CLang both happy, just clear
      it out using memset().
      
      >> drivers/net/tun.c:2503:42: warning: Using plain integer as NULL pointer
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f0271d9
  2. 17 Nov, 2018 29 commits