1. 03 Aug, 2017 11 commits
  2. 02 Aug, 2017 29 commits
    • Ido Schimmel's avatar
      mlxsw: core: Use correct EMAD transaction ID in debug message · 9820355f
      Ido Schimmel authored
      'trans->tid' is only assigned later in the function, resulting in a zero
      transaction ID. Use 'tid' instead.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9820355f
    • David S. Miller's avatar
      Merge branch 'netvsc-transparent-VF-support' · f6775a28
      David S. Miller authored
      Stephen Hemminger says:
      
      ====================
      netvsc: transparent VF support
      
      This patch set changes how SR-IOV Virtual Function devices are managed
      in the Hyper-V network driver. This version is rebased onto current net-next.
      
      Background
      
      In Hyper-V SR-IOV can be enabled (and disabled) by changing guest settings
      on host. When SR-IOV is enabled a matching PCI device is hot plugged and
      visible on guest. The VF device is an add-on to an existing netvsc
      device, and has the same MAC address.
      
      How is this different?
      
      The original support of VF relied on using bonding driver in active
      standby mode to handle the VF device.
      
      With the new netvsc VF logic, the Linux hyper-V network
      virtual driver will directly manage the link to SR-IOV VF device.
      When VF device is detected (hot plug) it is automatically made a
      slave device of the netvsc device. The VF device state reflects
      the state of the netvsc device; i.e. if netvsc is set down, then
      VF is set down. If netvsc is set up, then VF is brought up.
      
      Packet flow is independent of VF status; all packets are sent and
      received as if they were associated with the netvsc device. If VF is
      removed or link is down then the synthetic VMBUS path is used.
      
      What was wrong with using bonding script?
      
      A lot of work went into getting the bonding script to work on all
      distributions, but it was a major struggle. Linux network devices
      can be configured many, many ways and there is no one solution from
      userspace to make it all work. What is really hard is when
      configuration is attached to synthetic device during boot (eth0) and
      then the same addresses and firewall rules needs to also work later if
      doing bonding. The new code gets around all of this.
      
      How does VF work during initialization?
      
      Since all packets are sent and received through the logical netvsc
      device, initialization is much easier. Just configure the regular
      netvsc Ethernet device; when/if SR-IOV is enabled it just
      works. Provisioning and cloud init only need to worry about setting up
      netvsc device (eth0). If SR-IOV is enabled (even as a later step), the
      address and rules stay the same.
      
      What devices show up?
      
      Both netvsc and PCI devices are visible in the system. The netvsc
      device is active and named in usual manner (eth0). The PCI device is
      visible to Linux and gets renamed by udev to a persistent name
      (enP2p3s0). The PCI device name is now irrelevant now.
      
      The logic also sets the PCI VF device SLAVE flag on the network
      device so network tools can see the relationship if they are smart
      enough to understand how layered devices work.
      
      This is a lot like how I see Windows working.
      The VF device is visible in Device Manager, but is not configured.
      
      Is there any performance impact?
      There is no visible change in performance. The bonding
      and netvsc driver both have equivalent steps.
      
      Is it compatible with old bonding script?
      
      It turns out that if you use the old bonding script, then everything
      still works but in a sub-optimum manner. What happens is that bonding
      is unable to steal the VF from the netvsc device so it creates a one
      legged bond.  Packet flow then is:
      	bond0 <--> eth0 <- -> VF (enP2p3s0).
      In other words, if you get it wrong it still works, just
      awkward and slower.
      
      What if I add address or firewall rule onto the VF?
      
      Same problems occur with now as already occur with bonding, bridging,
      teaming on Linux if user incorrectly does configuration onto
      an underlying slave device. It will sort of work, packets will come in
      and out but the Linux kernel gets confused and things like ARP don’t
      work right.  There is no way to block manipulation of the slave
      device, and I am sure someone will find some special use case where
      they want it.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f6775a28
    • stephen hemminger's avatar
      netvsc: remove bonding setup script · 12aa7469
      stephen hemminger authored
      No longer needed, now all managed by transparent VF logic.
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12aa7469
    • stephen hemminger's avatar
      netvsc: add documentation · a5050c61
      stephen hemminger authored
      Add some background documentation on netvsc device options
      and limitations.
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a5050c61
    • stephen hemminger's avatar
      netvsc: transparent VF management · 0c195567
      stephen hemminger authored
      This patch implements transparent fail over from synthetic NIC to
      SR-IOV virtual function NIC in Hyper-V environment. It is a better
      alternative to using bonding as is done now. Instead, the receive and
      transmit fail over is done internally inside the driver.
      
      Using bonding driver has lots of issues because it depends on the
      script being run early enough in the boot process and with sufficient
      information to make the association. This patch moves all that
      functionality into the kernel.
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c195567
    • Amitoj Kaur Chawla's avatar
      atm: solos-pci: constify attribute_group structures · 638ce0fc
      Amitoj Kaur Chawla authored
      Functions working with attribute_groups provided by <linux/sysfs.h>
      work with const attribute_group. These attribute_group structures do not
      change at runtime so mark them as const.
      
      File size before:
       text      data     bss     dec     hex filename
       35740    28424     832   64996    fde4 drivers/atm/solos-pci.o
      
      File size after:
       text      data     bss     dec     hex filename
       35932    28232     832   64996    fde4 drivers/atm/solos-pci.o
      
      This change was made with the help of Coccinelle.
      Signed-off-by: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      638ce0fc
    • Amitoj Kaur Chawla's avatar
      atm: adummy: constify attribute_group structure · 444826a9
      Amitoj Kaur Chawla authored
      Functions working with attribute_groups provided by <linux/sysfs.h>
      work with const attribute_group. These attribute_group structures do not
      change at runtime so mark them as const.
      
      File size before:
       text      data     bss     dec     hex filename
       2033      1448       0    3481     d99 drivers/atm/adummy.o
      
      File size after:
       text      data     bss     dec     hex filename
       2129      1352       0    3481     d99 drivers/atm/adummy.o
      
      This change was made with the help of Coccinelle.
      Signed-off-by: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      444826a9
    • Derek Chickles's avatar
      liquidio: set sriov_totalvfs correctly · cf19a8c3
      Derek Chickles authored
      The file /sys/devices/pci000.../sriov_totalvfs is showing a wrong value.
      Fix it by calling pci_sriov_set_totalvfs() to set the total number of VFs
      available after calculations for the number of PF and VF queues are made.
      Signed-off-by: default avatarDerek Chickles <derek.chickles@cavium.com>
      Signed-off-by: default avatarRaghu Vatsavayi <raghu.vatsavayi@cavium.com>
      Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cf19a8c3
    • Florian Fainelli's avatar
      net: dsa: Add support for 64-bit statistics · f613ed66
      Florian Fainelli authored
      DSA slave network devices maintain a pair of bytes and packets counters
      for each directions, but these are not 64-bit capable. Re-use
      pcpu_sw_netstats which contains exactly what we need for that purpose
      and update the code path to report 64-bit capable statistics.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f613ed66
    • WANG Cong's avatar
      flow_dissector: remove unused functions · b2f9d432
      WANG Cong authored
      They are introduced by commit f70ea018
      ("net: Add functions to get skb->hash based on flow structures")
      but never gets used in tree.
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b2f9d432
    • Eric Dumazet's avatar
      tcp: tcp_data_queue() cleanup · 5357f0bd
      Eric Dumazet authored
      Commit c13ee2a4 ("tcp: reindent two spots after prequeue removal")
      removed code in tcp_data_queue().
      
      We can go a little farther, removing an always true test,
      and removing initializers for fragstolen and eaten variables.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Florian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5357f0bd
    • Arnd Bergmann's avatar
      net: bcmgenet: drop COMPILE_TEST dependency · aa6c16c4
      Arnd Bergmann authored
      The last patch added the dependency on 'OF && HAS_IOMEM' but left
      COMPILE_TEST as an alternative, which kind of defeats the purpose
      of adding the dependency, we still get randconfig build warnings:
      
      warning: (NET_DSA_BCM_SF2 && BCMGENET) selects MDIO_BCM_UNIMAC which has unmet direct dependencies (NETDEVICES && MDIO_BUS && HAS_IOMEM && OF_MDIO)
      
      For compile-testing purposes, we don't really need this anyway,
      as CONFIG_OF can be enabled on all architectures, and HAS_IOMEM
      is present on all architectures we do meaningful compile-testing on
      (the exception being arch/um).
      
      This makes both OF and HAS_IOMEM hard dependencies.
      
      Fixes: 5af74bb4 ("net: bcmgenet: Add dependency on HAS_IOMEM && OF")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa6c16c4
    • Joe Perches's avatar
      hyperv: netvsc: Neaten netvsc_send_pkt by using a temporary · 956a25c9
      Joe Perches authored
      Repeated dereference of nvmsg.msg.v1_msg.send_rndis_pkt can be
      shortened by using a temporary.  Do so.
      
      No change in object code.
      
      Miscellanea:
      
      o Use * const for rpkt and nvchan
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      956a25c9
    • David S. Miller's avatar
      Merge branch 'dsa-rework-EEE-support' · cb5b136c
      David S. Miller authored
      Vivien Didelot says:
      
      ====================
      net: dsa: rework EEE support
      
      EEE implies configuring the port's PHY and MAC of both ends of the wire.
      
      The current EEE support in DSA mixes PHY and MAC configuration, which is
      bad because PHYs must be configured through a proper PHY driver. The DSA
      switch operations for EEE are only meant for configuring the port's MAC,
      which are integrated in the Ethernet switch device.
      
      This patchset fixes the EEE support in qca8k driver, makes the DSA layer
      call phy_init_eee for all drivers, and remove the EEE support from the
      mv88e6xxx driver since the Marvell PHY driver should be enough for it.
      
      Changes in v2:
       - make PHY device and DSA EEE ops mandatory for slave EEE operations.
       - simply return 0 in drivers which don't need to do anything to
         configure the port' MAC. Subsequent PHY calls will be enough.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb5b136c
    • Vivien Didelot's avatar
      net: dsa: rename switch EEE ops · 08f50061
      Vivien Didelot authored
      To avoid confusion with the PHY EEE settings, rename the .set_eee and
      .get_eee ops to respectively .set_mac_eee and .get_mac_eee.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      08f50061
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: remove EEE support · 5480db69
      Vivien Didelot authored
      The PHY's EEE settings are already accessed by the DSA layer through the
      Marvell PHY driver and there is nothing to be done for switch's MACs.
      
      Remove all EEE support from the mv88e6xxx driver and simply return 0
      from the EEE ops.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5480db69
    • Vivien Didelot's avatar
      net: dsa: remove PHY device argument from .set_eee · 46587e4a
      Vivien Didelot authored
      The DSA switch operations for EEE are only meant to configure a port's
      MAC EEE settings. The port's PHY EEE settings are accessed by the DSA
      layer and must be made available via a proper PHY driver.
      
      In order to reduce this confusion, remove the phy_device argument from
      the .set_eee operation.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46587e4a
    • Vivien Didelot's avatar
      net: dsa: call phy_init_eee in DSA layer · c48f7eb3
      Vivien Didelot authored
      All DSA drivers are calling phy_init_eee if eee_enabled is true.
      
      Move up this statement in the DSA layer to simplify the DSA drivers.
      qca8k does not require to cache the ethtool_eee structures from now on.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c48f7eb3
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: call phy_init_eee · 7f5c6d7c
      Vivien Didelot authored
      It is safer to init the EEE before the DSA layer call
      phy_ethtool_set_eee, as sf2 and qca8k are doing.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f5c6d7c
    • Vivien Didelot's avatar
      net: dsa: bcm_sf2: remove unneeded supported flags · b11af0ce
      Vivien Didelot authored
      The SF2 driver is masking the supported bitfield of its private copy of
      the ports' ethtool_eee structures. It is used nowhere, thus remove it.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b11af0ce
    • Vivien Didelot's avatar
      net: dsa: qca8k: empty qca8k_get_eee · 193da90e
      Vivien Didelot authored
      phy_ethtool_get_eee is already called by the DSA layer, thus remove the
      duplicated call in the qca8k driver.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      193da90e
    • Vivien Didelot's avatar
      net: dsa: qca8k: do not cache unneeded EEE fields · a2444ab8
      Vivien Didelot authored
      The qca8k driver is currently caching a bitfield of the supported member
      of a ethtool_eee private structure, which is unused.
      
      Only the eee_enabled field of the private ethtool_eee copy is updated,
      thus using p->advertised and p->lp_advertised is also erroneous.
      
      Remove the usage of these private ethtool_eee members and only rely on
      phy_ethtool_get_eee to assign the eee_active member.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a2444ab8
    • Vivien Didelot's avatar
      net: dsa: qca8k: enable EEE once · dca20989
      Vivien Didelot authored
      If EEE is queried enabled, qca8k_set_eee calls qca8k_eee_enable_set
      twice (because it is already called in qca8k_eee_init). Fix that.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dca20989
    • Vivien Didelot's avatar
      net: dsa: qca8k: fix EEE init · 06d7b5c3
      Vivien Didelot authored
      The qca8k obviously copied code from the sf2 driver as how to set EEE:
      
          if (e->eee_enabled) {
              p->eee_enabled = qca8k_eee_init(ds, port, phydev);
              if (!p->eee_enabled)
                  ret = -EOPNOTSUPP;
          }
      
      But it did not use the same logic for the EEE init routine, which is
      "Returns 0 if EEE was not enabled, or 1 otherwise". This results in
      returning -EOPNOTSUPP on success and caching EEE enabled on failure.
      
      This patch fixes the returned value of qca8k_eee_init.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06d7b5c3
    • Vivien Didelot's avatar
      net: dsa: PHY device is mandatory for EEE · 7b9cc738
      Vivien Didelot authored
      The port's PHY and MAC are both implied in EEE. The current code does
      not call the PHY operations if the related device is NULL. Change that
      by returning -ENODEV if there's no PHY device attached to the interface.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b9cc738
    • David S. Miller's avatar
      Merge branch 'ravb-wol-magic-packet' · 13e6be2d
      David S. Miller authored
      Niklas Söderlund says:
      
      ====================
      ravb: add wake-on-lan support via magic packet
      
      WoL is enabled in the suspend callback by setting MagicPacket detection
      and disabling all interrupts expect MagicPacket. In the resume path the
      driver needs to reset the hardware to rearm the WoL logic, this prevents
      the driver from simply restoring the registers and to take advantage of
      that ravb was not suspended to reduce resume time. To reset the
      hardware the driver closes the device, sets it in reset mode and reopens
      the device just like it would do in a normal suspend/resume scenario
      without WoL enabled, but it both closes and opens the device in the
      resume callback since the device needs to be reset for WoL to work.
      
      One quirk needed for WoL is that the module clock needs to be prevented
      from being switched off by Runtime PM. To keep the clock alive the
      suspend callback need to call clk_enable() directly to increase the
      usage count of the clock. Then when Runtime PM decreases the clock usage
      count it won't reach 0 and be switched off.
      
      Changes since v2
      - Only do the clock dance to workaround PSCI sleep when resuming if WoL
        is enabled. This was a bug in v2 which resulted in a WARN if resuming
        from PSCI sleep with WoL disabled, thanks Sergei for pointing this
        out!
      - Break out clock dance workaround in separate patch to make it easier
        to revert once a fix is upstream for the clock driver as suggested by
        Sergei.
      
      Changes since v1
      - Fix issue where device would fail to resume from PSCI suspend if WoL
        was enabled, reported by Geert. The fault was that the clock driver
        thinks the clock is on, but PSCI have disabled it, added workaround
        for this in ravb driver which can be removed once the clock driver is
        aware of the PSCI behavior.
      - Only try to restore from wol wake up if netif is running, since this
        is a condition to enable wol in the first place this was a bug in v1.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13e6be2d
    • Niklas Söderlund's avatar
      ravb: add workaround for clock when resuming with WoL enabled · fbf3d034
      Niklas Söderlund authored
      The renesas-cpg-mssr clock driver are not yet aware of PSCI sleep where
      power is cut to the SoC. When resuming from this state with WoL enabled
      the enable count of the ravb clock is 1 and the clock driver thinks the
      clock is already on when PM core enables the clock and increments the
      enable count to 2. This will result in the ravb driver failing to talk
      to the hardware since the module clock is off. Work around this by
      forcing the enable count to 0 and then back to 2 when resuming with WoL
      enabled.
      
      This workaround should be reverted once the renesas-cpg-mssr clock
      driver becomes aware of this PSCI sleep behavior.
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fbf3d034
    • Niklas Söderlund's avatar
      ravb: add wake-on-lan support via magic packet · 3e3d6477
      Niklas Söderlund authored
      WoL is enabled in the suspend callback by setting MagicPacket detection
      and disabling all interrupts expect MagicPacket. In the resume path the
      driver needs to reset the hardware to rearm the WoL logic, this prevents
      the driver from simply restoring the registers and to take advantage of
      that ravb was not suspended to reduce resume time. To reset the
      hardware the driver closes the device, sets it in reset mode and reopens
      the device just like it would do in a normal suspend/resume scenario
      without WoL enabled, but it both closes and opens the device in the
      resume callback since the device needs to be reset for WoL to work.
      
      One quirk needed for WoL is that the module clock needs to be prevented
      from being switched off by Runtime PM. To keep the clock alive the
      suspend callback need to call clk_enable() directly to increase the
      usage count of the clock. Then when Runtime PM decreases the clock usage
      count it won't reach 0 and be switched off.
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e3d6477
    • David S. Miller's avatar
      Merge branch 'for-upstream' of... · 906a039d
      David S. Miller authored
      Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
      
      Johan Hedberg says:
      
      ====================
      pull request: bluetooth-next 2017-08-01
      
      Here's our first batch of Bluetooth patches for the 4.14 kernel:
      
       - Several new USB IDs for the btusb driver
       - Memory leak fix in btusb driver
       - Cleanups & fixes to hci_nokia, hci_serdev and hci_bcm drivers
       - Fixed cleanup path in mrf24j40 (802.15.4) driver probe function
       - A few other smaller cleanups & fixes to drivers
      
      Please let me know if there are any issues pulling. Thanks.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      906a039d