1. 22 Sep, 2018 14 commits
    • Andrew Lunn's avatar
      ravb: Disable Pause Advertisement · 65c5877f
      Andrew Lunn authored
      The previous commit to ravb had the side effect of making the PHY
      advertise Pause and Asym Pause, which previously did not happen.  By
      default, phydev->supported has both forms of pause enabled, but
      phydev->advertising does not. The new phy_remove_link_mode() copies
      phydev->supported to phydev->advertising after removing the requested
      link mode. These Pause configuration bits appears it stops the PHY
      from completing Auto-Neg and the link remains down.  Be explicit and
      remove the Pause and Asym Pause modes, so restoring the old behavior.
      
      Fixes: 41124fa6 ("net: ethernet: Add helper to remove a supported link mode")
      Reported-by: default avatarSimon Horman <horms@verge.net.au>
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65c5877f
    • David S. Miller's avatar
      Merge branch 'net-if_arp-use-define-instead-of-hard-coded-value' · b4d07824
      David S. Miller authored
      Håkon Bugge says:
      
      ====================
      net: if_arp: use define instead of hard-coded value
      
      Struct arpreq contains the name of the device. All other places in the
      kernel, the define IFNAMSIZ is used to designate its size. But in
      if_arp.h, a literal constant is used.
      
      As it could be good reasons to use constants instead of the defines in
      include files under uapi, it seems to be OK to use the define here,
      without opening a can of worms in user-land.
      
      This because if_arp.h includes netdevice.h, which also uses
      IFNAMSIZ. For the distros I have checked, this also holds true for the
      use-land side.
      
      The series also fixes some incorrect indents.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4d07824
    • Håkon Bugge's avatar
      net: if_arp: use define instead of hard-coded value · 6a12709d
      Håkon Bugge authored
      uapi/linux/if_arp.h includes linux/netdevice.h, which uses
      IFNAMSIZ. Hence, use it instead of hard-coded value.
      Signed-off-by: default avatarHåkon Bugge <haakon.bugge@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a12709d
    • Håkon Bugge's avatar
      net: if_arp: Fix incorrect indents · 30f8eb55
      Håkon Bugge authored
      Fixing incorrect indents and align comments.
      Signed-off-by: default avatarHåkon Bugge <haakon.bugge@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      30f8eb55
    • Vakul Garg's avatar
      net/tls: Add support for async encryption of records for performance · a42055e8
      Vakul Garg authored
      In current implementation, tls records are encrypted & transmitted
      serially. Till the time the previously submitted user data is encrypted,
      the implementation waits and on finish starts transmitting the record.
      This approach of encrypt-one record at a time is inefficient when
      asynchronous crypto accelerators are used. For each record, there are
      overheads of interrupts, driver softIRQ scheduling etc. Also the crypto
      accelerator sits idle most of time while an encrypted record's pages are
      handed over to tcp stack for transmission.
      
      This patch enables encryption of multiple records in parallel when an
      async capable crypto accelerator is present in system. This is achieved
      by allowing the user space application to send more data using sendmsg()
      even while previously issued data is being processed by crypto
      accelerator. This requires returning the control back to user space
      application after submitting encryption request to accelerator. This
      also means that zero-copy mode of encryption cannot be used with async
      accelerator as we must be done with user space application buffer before
      returning from sendmsg().
      
      There can be multiple records in flight to/from the accelerator. Each of
      the record is represented by 'struct tls_rec'. This is used to store the
      memory pages for the record.
      
      After the records are encrypted, they are added in a linked list called
      tx_ready_list which contains encrypted tls records sorted as per tls
      sequence number. The records from tx_ready_list are transmitted using a
      newly introduced function called tls_tx_records(). The tx_ready_list is
      polled for any record ready to be transmitted in sendmsg(), sendpage()
      after initiating encryption of new tls records. This achieves parallel
      encryption and transmission of records when async accelerator is
      present.
      
      There could be situation when crypto accelerator completes encryption
      later than polling of tx_ready_list by sendmsg()/sendpage(). Therefore
      we need a deferred work context to be able to transmit records from
      tx_ready_list. The deferred work context gets scheduled if applications
      are not sending much data through the socket. If the applications issue
      sendmsg()/sendpage() in quick succession, then the scheduling of
      tx_work_handler gets cancelled as the tx_ready_list would be polled from
      application's context itself. This saves scheduling overhead of deferred
      work.
      
      The patch also brings some side benefit. We are able to get rid of the
      concept of CLOSED record. This is because the records once closed are
      either encrypted and then placed into tx_ready_list or if encryption
      fails, the socket error is set. This simplifies the kernel tls
      sendpath. However since tls_device.c is still using macros, accessory
      functions for CLOSED records have been retained.
      Signed-off-by: default avatarVakul Garg <vakul.garg@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a42055e8
    • YueHaibing's avatar
      net: freescale: fix return type of ndo_start_xmit function · 06983aa5
      YueHaibing authored
      The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
      which is a typedef for an enum type, so make sure the implementation in
      this driver has returns 'netdev_tx_t' value, and change the function
      return type to netdev_tx_t.
      
      Found by coccinelle.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06983aa5
    • YueHaibing's avatar
      net: micrel: fix return type of ndo_start_xmit function · 2b49117a
      YueHaibing authored
      The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
      which is a typedef for an enum type, so make sure the implementation in
      this driver has returns 'netdev_tx_t' value, and change the function
      return type to netdev_tx_t.
      
      Found by coccinelle.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b49117a
    • Florian Fainelli's avatar
      net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider · b78ac6ec
      Florian Fainelli authored
      Allow the configuration of the MDIO clock divider when the Device Tree
      contains 'clock-frequency' property (similar to I2C and SPI buses).
      Because the hardware may have lost its state during suspend/resume,
      re-apply the MDIO clock divider upon resumption.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b78ac6ec
    • Nathan Chancellor's avatar
      net: lan78xx: Avoid unnecessary self assignment · 94e7c844
      Nathan Chancellor authored
      Clang warns when a variable is assigned to itself.
      
      drivers/net/usb/lan78xx.c:940:11: warning: explicitly assigning value of
      variable of type 'u32' (aka 'unsigned int') to itself [-Wself-assign]
                              offset = offset;
                              ~~~~~~ ^ ~~~~~~
      1 warning generated.
      
      Reorder the if statement to acheive the same result and avoid a self
      assignment warning.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/129Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94e7c844
    • Nathan Chancellor's avatar
      net: fddi: skfp: Remove unused function · 6b8e327c
      Nathan Chancellor authored
      Clang warns when a variable is assigned to itself.
      
      drivers/net/fddi/skfp/pcmplc.c:1257:6: warning: explicitly assigning
      value of variable of type 'int' to itself [-Wself-assign]
              phy = phy ; on_off = on_off ;
              ~~~ ^ ~~~
      drivers/net/fddi/skfp/pcmplc.c:1257:21: warning: explicitly assigning
      value of variable of type 'int' to itself [-Wself-assign]
              phy = phy ; on_off = on_off ;
                          ~~~~~~ ^ ~~~~~~
      2 warnings generated.
      
      Turns out this entire function doesn't actually do anything since
      SK_UNUSED is just casting the pointer to void. Remove it to silence
      this Clang warning.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/128Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b8e327c
    • Nathan Chancellor's avatar
      bna: Remove unnecessary self assignment · 83b4768e
      Nathan Chancellor authored
      Clang warns when a variable is assigned to itself.
      
      drivers/net/ethernet/brocade/bna/bna_enet.c:1800:9: warning: explicitly
      assigning value of variable of type 'int' to itself [-Wself-assign]
              for (i = i; i < (bna->ioceth.attr.num_ucmac * 2); i++)
                   ~ ^ ~
      drivers/net/ethernet/brocade/bna/bna_enet.c:1835:9: warning: explicitly
      assigning value of variable of type 'int' to itself [-Wself-assign]
              for (i = i; i < (bna->ioceth.attr.num_mcmac * 2); i++)
                   ~ ^ ~
      2 warnings generated.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/110Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83b4768e
    • Nathan Chancellor's avatar
      net: neterion: vxge: Remove unnecessary parentheses · b1e51eab
      Nathan Chancellor authored
      Clang warns when multiple pairs of parentheses are used for a single
      conditional statement.
      
      drivers/net/ethernet/neterion/vxge/vxge-traffic.c:2265:31: warning:
      equality comparison with extraneous parentheses [-Wparentheses-equality]
              if ((hldev->config.intr_mode ==
      VXGE_HW_INTR_MODE_MSIX_ONE_SHOT))
                   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/neterion/vxge/vxge-traffic.c:2265:31: note: remove
      extraneous parentheses around the comparison to silence this warning
              if ((hldev->config.intr_mode ==
      VXGE_HW_INTR_MODE_MSIX_ONE_SHOT))
                  ~                        ^                                 ~
      drivers/net/ethernet/neterion/vxge/vxge-traffic.c:2265:31: note: use '='
      to turn this equality comparison into an assignment
              if ((hldev->config.intr_mode ==
      VXGE_HW_INTR_MODE_MSIX_ONE_SHOT))
                                           ^~
                                           =
      1 warning generated.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/124Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b1e51eab
    • Heiner Kallweit's avatar
      net: phy: don't reschedule state machine when PHY is halted · 075ddebc
      Heiner Kallweit authored
      When being in state PHY_HALTED we don't have to reschedule the
      state machine, phy_start() will start it again.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      075ddebc
    • Romain Aviolat's avatar
      DRIVERS: net: macsec: Fix multiple coding style issues · 7979472b
      Romain Aviolat authored
      This patch fixes a couple of issues highlighted by checkpatch.pl:
      
          * Missing a blank line after declarations
          * Alignment should match open parenthesis
      Signed-off-by: default avatarRomain Aviolat <r.aviolat@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7979472b
  2. 21 Sep, 2018 20 commits
  3. 20 Sep, 2018 6 commits
    • Corentin Labbe's avatar
      net-next: mscc: remove unused ocelot_dev_gmii.h · 5678cb3c
      Corentin Labbe authored
      The header ocelot_dev_gmii.h is unused since the inclusion of the driver.
      It is unused, lets just remove it.
      Signed-off-by: default avatarCorentin Labbe <clabbe@baylibre.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5678cb3c
    • David S. Miller's avatar
      Merge branch 'mlxsw-Further-MC-awareness-configuration' · cab9572a
      David S. Miller authored
      Ido Schimmel says:
      
      ====================
      mlxsw: Further MC-awareness configuration
      
      Petr says:
      
      Due to an issue in Spectrum chips, when unicast traffic shares the same
      queue as BUM traffic, and there is congestion, the BUM traffic is
      admitted to the queue anyway, thus pushing out all UC traffic. In order
      to give unicast traffic precedence over BUM traffic, multicast-aware
      mode is now configured on all ports. Under MC-aware mode, egress TCs
      8..15 are used for BUM traffic, which has its own dedicated pool.
      
      This patch set improves the way that the MC pool and the higher-order
      TCs are integrated into the system.
      
      In patch #1, shaper at the higher TCs is configured to the same value
      that it has by default. It's better to have the corresponding artifact
      in the code explicitly.
      
      The 8 following patches gradually extend the devlink handling in mlxsw
      to support the extra TCs and the new MC pool.
      
      Patch #2 changes the way that pools are indexed in mlxsw. Instead of
      using (FW index, direction) tuple to identify the pool and the
      associated cache, mlxsw now uses devlink index. This change is necessary
      because the new pool 15 is not contiguously adjacent to the
      currently-used pools 0..3, and because it's only relevant on egress.
      Using devlink index relaxes the requirement for symmetry and adjacency
      imposed by using FW indexing.
      
      In patch #3, the assumption that number of ingress TCs matches that of
      egress TCs is relaxed to allow exposition of egress TCs 8..15.
      
      In patches #4, #5 and #6, support for infinite quotas is introduced.
      Infinite quotas are reported as taking all the memory in the system, but
      actually use a mechanism where the infinity is configured explicitly.
      
      In patches #7 and #8, support for configuring static pool sizes in
      introduced. Statically-sized pools have been supported for a while now,
      but during initialization, all pools have dynamic size. The patches
      allow there to be a mix of by-default static and dynamic pools.
      
      In patches #9 and #10, pool 15 resp. per-priority MC quotas are
      explicitly configured to be in sync with the current recommendation for
      handling BUM traffic in Spectrum chips.
      
      In the following 3 patches, an mlxsw-specific selftest is added to test
      the MC-awareness configuration.
      
      First in patches #11 and #12, lib.sh is extended with functions to
      collect ethtool stats, and to manage port MTU.
      
      Then in patch #13 the selftest itself is added.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cab9572a
    • Petr Machata's avatar
      selftests: mlxsw: Add a test for UC behavior under MC flood · b5638d46
      Petr Machata authored
      A so-called "MC-aware" mode has recently been enabled in mlxsw. In
      MC-aware mode, BUM traffic is handled in a special way so that when a
      switch is flooded with BUM, UC performance isn't unduly impacted.
      Without enablement of this mode, a stream of BUM traffic can cause
      sustained UC throughput drop in excess of 99 %.
      
      Add a test for this behavior. Compare how much UC throughput degrades as
      a stream of broadcast frames floods the switch. A minimal degradation is
      tolerated to cover for glitches in traffic injection performance.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5638d46
    • Petr Machata's avatar
      selftests: forwarding: lib: Add mtu_set(), mtu_restore() · a381ed12
      Petr Machata authored
      Some selftests need to tweak MTU of an interface, and naturally should
      at teardown restore the MTU back to the original value. Add two
      functions to facilitate this MTU handling: mtu_set() to change MTU
      value, and mtu_reset() to change it back to what it was before.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a381ed12
    • Petr Machata's avatar
      selftests: forwarding: lib: Add ethtool_stats_get() · 3136a369
      Petr Machata authored
      Add a new service function to obtain ethtool counters.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3136a369
    • Petr Machata's avatar
      mlxsw: spectrum_buffers: Tweak SBMM configuration · 6a23f9a4
      Petr Machata authored
      The SBMM register configures shared buffer allocation and settings for
      MC packets according to switch priority. The recommended values are no
      reserved buffer and alpha of 1/4, which corresponds to buf_max of 6.
      Update mlxsw_sp_sb_mms accordingly.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a23f9a4