1. 24 Jun, 2015 18 commits
    • David S. Miller's avatar
      Merge branch 'ipv4-nexthop-link-status' · f389a40e
      David S. Miller authored
      Andy Gospodarek says:
      
      ====================
      changes to make ipv4 routing table aware of next-hop link status
      
      This series adds the ability to have the Linux kernel track whether or
      not a particular route should be used based on the link-status of the
      interface associated with the next-hop.
      
      Before this patch any link-failure on an interface that was serving as a
      gateway for some systems could result in those systems being isolated
      from the rest of the network as the stack would continue to attempt to
      send frames out of an interface that is actually linked-down.  When the
      kernel is responsible for all forwarding, it should also be responsible
      for taking action when the traffic can no longer be forwarded -- there
      is no real need to outsource link-monitoring to userspace anymore.
      
      This feature is only enabled with the new per-interface or ipv4 global
      sysctls called 'ignore_routes_with_linkdown'.
      
      net.ipv4.conf.all.ignore_routes_with_linkdown = 0
      net.ipv4.conf.default.ignore_routes_with_linkdown = 0
      net.ipv4.conf.lo.ignore_routes_with_linkdown = 0
      ...
      
      When the above sysctls are set, the kernel will not only report to
      userspace that the link is down, but it will also report to userspace
      that a route is dead.  This will signal to userspace that the route will
      not be selected.
      
      With the new sysctls set, the following behavior can be observed
      (interface p8p1 is link-down):
      
      default via 10.0.5.2 dev p9p1
      10.0.5.0/24 dev p9p1  proto kernel  scope link  src 10.0.5.15
      70.0.0.0/24 dev p7p1  proto kernel  scope link  src 70.0.0.1
      80.0.0.0/24 dev p8p1  proto kernel  scope link  src 80.0.0.1 dead linkdown
      90.0.0.0/24 via 80.0.0.2 dev p8p1  metric 1 dead linkdown
      90.0.0.0/24 via 70.0.0.2 dev p7p1  metric 2
      90.0.0.1 via 70.0.0.2 dev p7p1  src 70.0.0.1
          cache
      local 80.0.0.1 dev lo  src 80.0.0.1
          cache <local>
      80.0.0.2 via 10.0.5.2 dev p9p1  src 10.0.5.15
          cache
      
      While the route does remain in the table (so it can be modified if
      needed rather than being wiped away as it would be if IFF_UP was
      cleared), the proper next-hop is chosen automatically when the link is
      down.  Now interface p8p1 is linked-up:
      
      default via 10.0.5.2 dev p9p1
      10.0.5.0/24 dev p9p1  proto kernel  scope link  src 10.0.5.15
      70.0.0.0/24 dev p7p1  proto kernel  scope link  src 70.0.0.1
      80.0.0.0/24 dev p8p1  proto kernel  scope link  src 80.0.0.1
      90.0.0.0/24 via 80.0.0.2 dev p8p1  metric 1
      90.0.0.0/24 via 70.0.0.2 dev p7p1  metric 2
      192.168.56.0/24 dev p2p1  proto kernel  scope link  src 192.168.56.2
      90.0.0.1 via 80.0.0.2 dev p8p1  src 80.0.0.1
          cache
      local 80.0.0.1 dev lo  src 80.0.0.1
          cache <local>
      80.0.0.2 dev p8p1  src 80.0.0.1
          cache
      
      and the output changes to what one would expect.
      
      If the global or interface sysctl is not set, the following output would
      be expected when p8p1 is down:
      
      default via 10.0.5.2 dev p9p1
      10.0.5.0/24 dev p9p1  proto kernel  scope link  src 10.0.5.15
      70.0.0.0/24 dev p7p1  proto kernel  scope link  src 70.0.0.1
      80.0.0.0/24 dev p8p1  proto kernel  scope link  src 80.0.0.1 linkdown
      90.0.0.0/24 via 80.0.0.2 dev p8p1  metric 1 linkdown
      90.0.0.0/24 via 70.0.0.2 dev p7p1  metric 2
      
      If the dead flag does not appear there should be no expectation that the
      kernel would skip using this route due to link being down.
      
      v2: Split kernel changes into 2 patches: first to add linkdown flag and
      second to add new sysctl settings.  Also took suggestion from Alex to
      simplify code by only checking sysctl during fib lookup and suggestion
      from Scott to add a per-interface sysctl.  Added iproute2 patch to
      recognize and print linkdown flag.
      
      v3: Code cleanups along with reverse-path checks suggested by Alex and
      small fixes related to problems found when multipath was disabled.
      
      v4: Drop binary sysctls
      
      v5: Whitespace and variable declaration fixups suggested by Dave
      
      v6: Style changes noticed by Dave and checkpath suggestions.
      
      v7: Last checkpatch fixup.
      
      Though there were some that preferred not to have a configuration option
      and to make this behavior the default when it was discussed in Ottawa
      earlier this year since "it was time to do this."  I wanted to propose
      the config option to preserve the current behavior for those that desire
      it.  I'll happily remove it if Dave and Linus approve.
      
      An IPv6 implementation is also needed (DECnet too!), but I wanted to
      start with the IPv4 implementation to get people comfortable with the
      idea before moving forward.  If this is accepted the IPv6 implementation
      can be posted shortly.
      
      There was also a request for switchdev support for this, but that will
      be posted as a followup as switchdev does not currently handle dead
      next-hops in a multi-path case and I felt that infra needed to be added
      first.
      
      FWIW, we have been running the original version of this series with a
      global sysctl and our customers have been happily using a backported
      version for IPv4 and IPv6 for >6 months.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f389a40e
    • Andy Gospodarek's avatar
      net: ipv4 sysctl option to ignore routes when nexthop link is down · 0eeb075f
      Andy Gospodarek authored
      This feature is only enabled with the new per-interface or ipv4 global
      sysctls called 'ignore_routes_with_linkdown'.
      
      net.ipv4.conf.all.ignore_routes_with_linkdown = 0
      net.ipv4.conf.default.ignore_routes_with_linkdown = 0
      net.ipv4.conf.lo.ignore_routes_with_linkdown = 0
      ...
      
      When the above sysctls are set, will report to userspace that a route is
      dead and will no longer resolve to this nexthop when performing a fib
      lookup.  This will signal to userspace that the route will not be
      selected.  The signalling of a RTNH_F_DEAD is only passed to userspace
      if the sysctl is enabled and link is down.  This was done as without it
      the netlink listeners would have no idea whether or not a nexthop would
      be selected.   The kernel only sets RTNH_F_DEAD internally if the
      interface has IFF_UP cleared.
      
      With the new sysctl set, the following behavior can be observed
      (interface p8p1 is link-down):
      
      default via 10.0.5.2 dev p9p1
      10.0.5.0/24 dev p9p1  proto kernel  scope link  src 10.0.5.15
      70.0.0.0/24 dev p7p1  proto kernel  scope link  src 70.0.0.1
      80.0.0.0/24 dev p8p1  proto kernel  scope link  src 80.0.0.1 dead linkdown
      90.0.0.0/24 via 80.0.0.2 dev p8p1  metric 1 dead linkdown
      90.0.0.0/24 via 70.0.0.2 dev p7p1  metric 2
      90.0.0.1 via 70.0.0.2 dev p7p1  src 70.0.0.1
          cache
      local 80.0.0.1 dev lo  src 80.0.0.1
          cache <local>
      80.0.0.2 via 10.0.5.2 dev p9p1  src 10.0.5.15
          cache
      
      While the route does remain in the table (so it can be modified if
      needed rather than being wiped away as it would be if IFF_UP was
      cleared), the proper next-hop is chosen automatically when the link is
      down.  Now interface p8p1 is linked-up:
      
      default via 10.0.5.2 dev p9p1
      10.0.5.0/24 dev p9p1  proto kernel  scope link  src 10.0.5.15
      70.0.0.0/24 dev p7p1  proto kernel  scope link  src 70.0.0.1
      80.0.0.0/24 dev p8p1  proto kernel  scope link  src 80.0.0.1
      90.0.0.0/24 via 80.0.0.2 dev p8p1  metric 1
      90.0.0.0/24 via 70.0.0.2 dev p7p1  metric 2
      192.168.56.0/24 dev p2p1  proto kernel  scope link  src 192.168.56.2
      90.0.0.1 via 80.0.0.2 dev p8p1  src 80.0.0.1
          cache
      local 80.0.0.1 dev lo  src 80.0.0.1
          cache <local>
      80.0.0.2 dev p8p1  src 80.0.0.1
          cache
      
      and the output changes to what one would expect.
      
      If the sysctl is not set, the following output would be expected when
      p8p1 is down:
      
      default via 10.0.5.2 dev p9p1
      10.0.5.0/24 dev p9p1  proto kernel  scope link  src 10.0.5.15
      70.0.0.0/24 dev p7p1  proto kernel  scope link  src 70.0.0.1
      80.0.0.0/24 dev p8p1  proto kernel  scope link  src 80.0.0.1 linkdown
      90.0.0.0/24 via 80.0.0.2 dev p8p1  metric 1 linkdown
      90.0.0.0/24 via 70.0.0.2 dev p7p1  metric 2
      
      Since the dead flag does not appear, there should be no expectation that
      the kernel would skip using this route due to link being down.
      
      v2: Split kernel changes into 2 patches, this actually makes a
      behavioral change if the sysctl is set.  Also took suggestion from Alex
      to simplify code by only checking sysctl during fib lookup and
      suggestion from Scott to add a per-interface sysctl.
      
      v3: Code clean-ups to make it more readable and efficient as well as a
      reverse path check fix.
      
      v4: Drop binary sysctl
      
      v5: Whitespace fixups from Dave
      
      v6: Style changes from Dave and checkpatch suggestions
      
      v7: One more checkpatch fixup
      Signed-off-by: default avatarAndy Gospodarek <gospo@cumulusnetworks.com>
      Signed-off-by: default avatarDinesh Dutt <ddutt@cumulusnetworks.com>
      Acked-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0eeb075f
    • Andy Gospodarek's avatar
      net: track link-status of ipv4 nexthops · 8a3d0316
      Andy Gospodarek authored
      Add a fib flag called RTNH_F_LINKDOWN to any ipv4 nexthops that are
      reachable via an interface where carrier is off.  No action is taken,
      but additional flags are passed to userspace to indicate carrier status.
      
      This also includes a cleanup to fib_disable_ip to more clearly indicate
      what event made the function call to replace the more cryptic force
      option previously used.
      
      v2: Split out kernel functionality into 2 patches, this patch simply
      sets and clears new nexthop flag RTNH_F_LINKDOWN.
      
      v3: Cleanups suggested by Alex as well as a bug noticed in
      fib_sync_down_dev and fib_sync_up when multipath was not enabled.
      
      v5: Whitespace and variable declaration fixups suggested by Dave.
      
      v6: Style fixups noticed by Dave; ran checkpatch to be sure I got them
      all.
      Signed-off-by: default avatarAndy Gospodarek <gospo@cumulusnetworks.com>
      Signed-off-by: default avatarDinesh Dutt <ddutt@cumulusnetworks.com>
      Acked-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a3d0316
    • Vivien Didelot's avatar
      net: switchdev: ignore unsupported bridge flags · 5c8079d0
      Vivien Didelot authored
      switchdev_port_bridge_getlink() queries SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS
      attributes, but a driver doesn't need to implement this in order to get
      bridge link information.
      
      So error out only on errors different than -EOPNOTSUPP.
      
      (This is a follow-up patch for 7d4f8d87.)
      
      Fixes: 8793d0a6 ("switchdev: add new switchdev_port_bridge_getlink")
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Acked-by: default avatarJiri Pirko <jiri@resnulli.us>
      Acked-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c8079d0
    • Pavel Fedin's avatar
      net: Cavium: Fix MAC address setting in shutdown state · bd049a90
      Pavel Fedin authored
      This bug pops up with NetworkManager on Fedora 21. NetworkManager tends to
      stop the interface (nicvf_stop() is called) before changing settings. In
      stopped state MAC cannot be sent to a PF. However, when the interface is
      restarted (nicvf_open() is called), we ping the PF using NIC_MBOX_MSG_READY
      message, and the PF replies back with old MAC address, overriding what we
      had after MAC setting from userspace. As a result, we cannot set MAC
      address using NetworkManager.
      
      This patch introduces special tracking of MAC change in stopped state so
      that the correct new MAC address is sent to a PF when interface is reopen.
      Signed-off-by: default avatarPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd049a90
    • Stephen Rothwell's avatar
    • David S. Miller's avatar
      Merge branch 'mlx-next' · 12d4ae9d
      David S. Miller authored
      Or Gerlitz says:
      
      ====================
      Mellanox NIC drivers update, June 23 2015
      
      This series has two fixes from Eran to his recent SRIOV counters work in
      mlx4 and few more updates from Saeed and Achiad to the mlx5 Ethernet
      code. All fixes here relate to net-next code, so no need for -stable.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12d4ae9d
    • Saeed Mahameed's avatar
      net/mlx5e: Prefetch skb data on RX · 99611ba1
      Saeed Mahameed authored
      Prefetch the 1st cache line used by the buffer pointed by
      the skb linear data.
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      99611ba1
    • Achiad Shochat's avatar
      net/mlx5e: Pop cq outside mlx5e_get_cqe · a1f5a1a8
      Achiad Shochat authored
      Separate between mlx5e_get_cqe() and mlx5_cqwq_pop(), this helps for
      better code readability and better CQ buffer management.
      Signed-off-by: default avatarAchiad Shochat <achiad@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1f5a1a8
    • Achiad Shochat's avatar
      net/mlx5e: Remove mlx5e_cq.sqrq back-pointer · e3391054
      Achiad Shochat authored
      Use container_of() instead.
      Signed-off-by: default avatarAchiad Shochat <achiad@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e3391054
    • Achiad Shochat's avatar
      net/mlx5e: Remove extra spaces · 8ca56ce3
      Achiad Shochat authored
      Coding Style fix, remove extra spaces.
      Signed-off-by: default avatarAchiad Shochat <achiad@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ca56ce3
    • Achiad Shochat's avatar
      net/mlx5e: Avoid TX CQE generation if more xmit packets expected · 059ba072
      Achiad Shochat authored
      In order to save PCI BW consumed by TX CQEs and to reduce the amount of
      CPU cache misses caused by TX CQE reading, we request TX CQE generation
      only when skb->xmit_more=0.
      
      As a consequence of the above, a single TX CQE may now indicate the
      transmission completion of multiple TX SKBs.
      
      This also handles a problem introduced in commit b1b8105ebf41 "net/mlx5e:
      Support NETIF_F_SG" where we didn't ask for NOP completions while the
      driver didn't have the proper code to handle this case.
      
      Fixes: b1b8105ebf41 ('net/mlx5e: Support NETIF_F_SG')
      Signed-off-by: default avatarAchiad Shochat <achiad@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      059ba072
    • Achiad Shochat's avatar
      net/mlx5e: Avoid redundant dev_kfree_skb() upon NOP completion · 9fc59306
      Achiad Shochat authored
      NOP completion SKBs are always NULL.
      Signed-off-by: default avatarAchiad Shochat <achiad@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9fc59306
    • Achiad Shochat's avatar
      net/mlx5e: Remove re-assignment of wq type in mlx5e_enable_rq() · ef583d03
      Achiad Shochat authored
      It is already assigned at mlx5e_build_rq_param()
      Signed-off-by: default avatarAchiad Shochat <achiad@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef583d03
    • Saeed Mahameed's avatar
      net/mlx5e: Use skb_shinfo(skb)->gso_segs rather than counting them · fb6c6f25
      Saeed Mahameed authored
      Instead of counting number of gso fragments, we can use
      skb_shinfo(skb)->gso_segs.
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fb6c6f25
    • Saeed Mahameed's avatar
      net/mlx5e: Static mapping of netdev priv resources to/from netdev TX queues · 03289b88
      Saeed Mahameed authored
      To save per-packet calculations, we use the following static mappings:
      1) priv {channel, tc} to netdev txq (used @mlx5e_selec_queue())
      2) netdev txq to priv sq (used @mlx5e_xmit())
      
      Thanks to these static mappings, no more need for a separate implementation
      of ndo_start_xmit when multiple TCs are configured.
      We believe the performance improvement of such separation would be negligible, if any.
      The previous way of dynamically calculating the above mappings required
      allocating more TX queues than actually used (@alloc_etherdev_mqs()),
      which is now no longer needed.
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03289b88
    • Eran Ben Elisha's avatar
      net/mlx4_en: Use HW counters for rx/tx bytes/packets in PF device · f1a3badb
      Eran Ben Elisha authored
      Under SRIOV, the port rx/tx bytes/packets statistics should by read
      from the HW instead of using the PF netdevice SW accounting. This is
      needed in order to get the full port statistics and not just the PF
      own ones
      Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f1a3badb
    • Eran Ben Elisha's avatar
      net/mlx4_en: Fix off-by-four in ethtool · 9a2abf5a
      Eran Ben Elisha authored
      NUM_ALL_STATS was not updated with the new four entries, instead
      NUM_FLOW_STATS was updated, fix it. that caused off-by-four for all
      counters below pf_*_*.
      
      Fixes: b42de4d0 ('net/mlx4_en: Show PF own statistics via ethtool')
      Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9a2abf5a
  2. 23 Jun, 2015 22 commits
    • David S. Miller's avatar
      Merge branch 'xgene-next' · 0a51f76e
      David S. Miller authored
      Suman Tripathi says:
      
      ====================
      drivers: net: xgene: Fix the ACPI support for RGMII/SGMII0/XFI ethernet interfaces of APM X-Gene SoC.
      ====================
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarSuman Tripathi <stripathi@apm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0a51f76e
    • Suman Tripathi's avatar
      drivers: net: xgene: Check for IS_ERR rather than NULL for clock. · c2d33bdc
      Suman Tripathi authored
      This patches fixes the code to check for IS_ERR rather
      than NULL for clock interface.
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarSuman Tripathi <stripathi@apm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2d33bdc
    • Suman Tripathi's avatar
      drivers: net: xgene: Add ACPI support for SGMII0 and XFI1 interface of 2nd H/W... · 822e34a4
      Suman Tripathi authored
      drivers: net: xgene: Add ACPI support for SGMII0 and XFI1 interface of 2nd H/W version of APM X-Gene SoC ethernet controller.
      
      This patch adds the ACPI support for SGMII0 and XFI1 interface of
      2nd H/W version of APM X-Gene SoC ethernet controller.
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarSuman Tripathi <stripathi@apm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      822e34a4
    • Suman Tripathi's avatar
      drivers: net: xgene: Implement the backward compatibility with the old and new... · 2c7be0ac
      Suman Tripathi authored
      drivers: net: xgene: Implement the backward compatibility with the old and new firmware w.r.t Tx completion IRQ interrupt.
      
      This patch implements the backward compatibility with the old firmware where
      the Tx completion IRQ interrupt was absent whereas incase of new firmware
      the Tx completion IRQ interrupt is present.
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarSuman Tripathi <stripathi@apm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c7be0ac
    • Suman Tripathi's avatar
      drivers: net: xgene: Fix the ACPI support for RGMII/SGMII0/XFI interface of... · 0738c54d
      Suman Tripathi authored
      drivers: net: xgene: Fix the ACPI support for RGMII/SGMII0/XFI interface of APM X-Gene SoC ethernet controller.
      
      This patch implements couple of fixes to support ACPI for RGMII/SGMII0/XFI
      interface of APM X-Gene SoC ethernet controller driver. This patch uses
      the _SUN acpi object to fetch the port-id information whereas the FDT uses
      port-id binding for port-id information.
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarSuman Tripathi <stripathi@apm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0738c54d
    • Noam Camus's avatar
      NET: Add ezchip ethernet driver · 0dd07709
      Noam Camus authored
      Simple LAN device for debug or management purposes.
      Device supports interrupts for RX and TX(completion).
      Device does not have DMA ability.
      Signed-off-by: default avatarNoam Camus <noamc@ezchip.com>
      Signed-off-by: default avatarTal Zilcer <talz@ezchip.com>
      Acked-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0dd07709
    • Nimrod Andy's avatar
      net: fec: init MAC prior to mii bus probe · 55dd2753
      Nimrod Andy authored
      Below case causes mii bus probe failed:
      ifconfig eth0 down -> suspend/resume with Mega/fax mix off -> ifconfig eth0 up
      
      In i.MX6SX/i.MX7D chip, Mega/fast mix off feature is supported that means most of
      SOC power will be off including ENET MAC for power saving. Once ENET MAC power
      off, all initialized MAC registers reset to default, so in the case, it must
      init MAC prior to mii bus probe.
      Signed-off-by: default avatarFugang Duan <B38611@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      55dd2753
    • Anish Bhatt's avatar
      dcb : Fix incorrect documentation for struct dcb_app · 42bcce87
      Anish Bhatt authored
      While IEEE and CEE use the same structure to store apps, the selector
      and priority fields for both are different. Only the priority field is
      explained, add documentation explaining how the selector field differs
      for both.
      
      cgdcbxd code shows an example of how selector fields differ.
      Signed-off-by: default avatarAnish Bhatt <anish@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      42bcce87
    • Scott Feldman's avatar
      switchdev: change BUG_ON to WARN for attr set failure case · e9fdaec0
      Scott Feldman authored
      This particular BUG_ON condition was checking for attr set err in the
      COMMIT phase, which isn't expected (it's a driver bug if PREPARE phase is
      OK but COMMIT fails).  But BUG_ON() is too strong for this case, so change
      to WARN().  BUG_ON() would be warranted if the system was corrupted beyond
      repair, but this is not the case here.
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9fdaec0
    • David S. Miller's avatar
      Merge branch 'switchdev-vlan' · 06baa3d0
      David S. Miller authored
      Scott Feldman says:
      
      ====================
      switchdev; add VLAN support for port's bridge_getlink
      
      One more missing piece of the puzzle.  Add vlan dump support to switchdev
      port's bridge_getlink.  iproute2 "bridge vlan show" cmd already knows how
      to show the vlans installed on the bridge and the device , but (until now)
      no one implemented the port vlan part of the netlink PF_BRIDGE:RTM_GETLINK
      msg.  Before this patch, "bridge vlan show":
      
      	$ bridge -c vlan show
      	port    vlan ids
      	sw1p1    30-34			<< bridge side vlans
      		 57
      
      	sw1p1				<< device side vlans (missing)
      
      	sw1p2    57
      
      	sw1p2
      
      	sw1p3
      
      	sw1p4
      
      	br0     None
      
      (When the port is bridged, the output repeats the vlan list for the vlans
      on the bridge side of the port and the vlans on the device side of the
      port.  The listing above show no vlans for the device side even though they
      are installed).
      
      After this patch:
      
      	$ bridge -c vlan show
      	port    vlan ids
      	sw1p1    30-34			<< bridge side vlan
      		 57
      
      	sw1p1    30-34			<< device side vlans
      		 57
      		 3840 PVID
      
      	sw1p2    57
      
      	sw1p2    57
      		 3840 PVID
      
      	sw1p3    3842 PVID
      
      	sw1p4    3843 PVID
      
      	br0     None
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06baa3d0
    • Scott Feldman's avatar
      switchdev; add VLAN support for port's bridge_getlink · 7d4f8d87
      Scott Feldman authored
      One more missing piece of the puzzle.  Add vlan dump support to switchdev
      port's bridge_getlink.  iproute2 "bridge vlan show" cmd already knows how
      to show the vlans installed on the bridge and the device , but (until now)
      no one implemented the port vlan part of the netlink PF_BRIDGE:RTM_GETLINK
      msg.  Before this patch, "bridge vlan show":
      
      	$ bridge -c vlan show
      	port    vlan ids
      	sw1p1    30-34			<< bridge side vlans
      		 57
      
      	sw1p1				<< device side vlans (missing)
      
      	sw1p2    57
      
      	sw1p2
      
      	sw1p3
      
      	sw1p4
      
      	br0     None
      
      (When the port is bridged, the output repeats the vlan list for the vlans
      on the bridge side of the port and the vlans on the device side of the
      port.  The listing above show no vlans for the device side even though they
      are installed).
      
      After this patch:
      
      	$ bridge -c vlan show
      	port    vlan ids
      	sw1p1    30-34			<< bridge side vlan
      		 57
      
      	sw1p1    30-34			<< device side vlans
      		 57
      		 3840 PVID
      
      	sw1p2    57
      
      	sw1p2    57
      		 3840 PVID
      
      	sw1p3    3842 PVID
      
      	sw1p4    3843 PVID
      
      	br0     None
      
      I re-used ndo_dflt_bridge_getlink to add vlan fill call-back func.
      switchdev support adds an obj dump for VLAN objects, using the same
      call-back scheme as FDB dump.  Support included for both compressed and
      un-compressed vlan dumps.
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d4f8d87
    • Scott Feldman's avatar
      switchdev: rename vlan vid_start to vid_begin · 3e3a78b4
      Scott Feldman authored
      Use vid_begin/end to be consistent with BRIDGE_VLAN_INFO_RANGE_BEGIN/END.
      Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e3a78b4
    • Maninder Singh's avatar
      packet: remove handling of tx_ring · e8e85cc5
      Maninder Singh authored
      Remove handling of tx_ring in prb_setup_retire_blk_timer
      for TPACKET_V3 because init_prb_bdqc is called only for zero tx_ring
      and thus prb_setup_retire_blk_timer for zero tx_ring only.
      
      And also in functon init_prb_bdqc there is no usage of tx_ring.
      Thus removing tx_ring from init_prb_bdqc.
      Signed-off-by: default avatarManinder Singh <maninder1.s@samsung.com>
      Suggested-by: default avatarFrans Klaver <fransklaver@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8e85cc5
    • Paul Gortmaker's avatar
      drivers/net: remove all references to obsolete Ethernet-HOWTO · 138b15ed
      Paul Gortmaker authored
      This howto made sense in the 1990s when users had to manually configure
      ISA cards with jumpers or vendor utilities, but with the implementation
      of PCI it became increasingly less and less relevant, to the point where
      it has been well over a decade since I last updated it.  And there is
      no value in anyone else taking over updating it either.
      
      However the references to it continue to spread as boiler plate text
      from one Kconfig file into the next.  We are not doing end users any
      favours by pointing them at this old document, so lets kill it with
      fire, once and for all, to hopefully stop any further spread.
      
      No code is changed in this commit, just Kconfig help text.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      138b15ed
    • David S. Miller's avatar
      Merge branch 'stmmac-rk3368' · 69ae2f7a
      David S. Miller authored
      Heiko Stuebner says:
      
      ====================
      net: stmmac: dwmac-rk: add support for rk3368
      
      Apart from small cleanups, this series provides support for the dwmac
      on the new rk3368 ARM64 soc.
      
      Tested on a R88 board using a RMII phy.
      
      Changes since v1:
      - Adapt to changes resulting from patch d42202dc ("net: stmmac:
      dwmac-rk: Don't add function name in info or err messages")
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69ae2f7a
    • Heiko Stübner's avatar
      net: stmmac: dwmac-rk: add rk3368-specific data · df558854
      Heiko Stübner authored
      Add constants and callback functions for the dwmac on rk3368 socs.
      As can be seen, the base structure is the same, only registers and
      the bits in them moved slightly.
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      df558854
    • Heiko Stübner's avatar
      net: stmmac: dwmac-rk: abstract access to mac settings in GRF · 0fb98db1
      Heiko Stübner authored
      The mac settings like RGMII/RMII, speeds etc are done in the so called
      "General Register Files", contain numerous other settings as well and
      always seem to change between Rockchip SoCs. Therefore abstract the
      register accesses into a per-soc ops struct to make this reusable on
      other Rockchip SoCs.
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0fb98db1
    • Heiko Stübner's avatar
      net: stmmac: dwmac-rk: Fix clk rate when provided by soc · c48fa33c
      Heiko Stübner authored
      The first iteration of the dwmac-rk support did access an intermediate
      clock directly below the pll selector. This was removed in a subsequent
      revision, but the clock and one invocation remained. This results in
      the driver trying to set the rate of a non-existent clock when the soc
      and not some external source provides the phy clock for RMII phys.
      
      So set the rate of the correct clock and remove the remaining now
      completely unused definition.
      
      Fixes: 436f5ae08f9d ("GMAC: add driver for Rockchip RK3288 SoCs integrated GMAC")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c48fa33c
    • Heiko Stübner's avatar
      net: stmmac: dwmac-rk: remove unused gpio register defines · 059dab08
      Heiko Stübner authored
      In a first version the driver did want to do some gpio wiggling, which
      of course never made it into the kernel, but somehow these register
      defines where forgotten. Remove them, as they shouldn't be here.
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      059dab08
    • Andrew Lunn's avatar
      dsa: mv88x6xxx: Zero statistics counters · db687a56
      Andrew Lunn authored
      Zero the statistics counters when setting up the global
      registers. Otherwise the counters will remain from the last boot if
      the power has not been removed.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db687a56
    • David S. Miller's avatar
      Merge branch 'dsa-mv88e6xxx-debugfs' · 824831fa
      David S. Miller authored
      Andrew Lunn says:
      
      ====================
      debugfs for mv88e6xxx
      
      This patchset adds some debugfs files for seeing into a mv88e6xxx
      family of switch chips.
      
      DB   T/P  Vec State Addr
      003  Port 008   7   00:22:02:00:18:44
      003  Port 008   6   80:ee:73:83:60:27
      005  Port 020   7   94:10:3e:80:bc:f3
      0f8  Port 001   6   8e:25:13:53:44:de
      
      This walks all possible entries, so is a bit slow, but is always
      correct.
      
      Target Port
         0   15
         1   15
         2   15
         3   15
         4   15
         5   15
         6   15
         7   15
         8   15
         9   15
      -->snip<--
        31   15
      
      A rather boring example, since i only have one switch here. But this shows
      the routing between multiple switches.
      
          GLOBAL GLOBAL2   0    1    2    3    4    5    6
       0:  c804       0  1e4f 100f 100f 1e4f 1e0f  e07  e07
       1:    fe       0     3    3    3    3    3 c03e c03f
       2:     0    ffff     0    0    0    0    0    0    0
       3:     0    ffff  1721 1721 1721 1721 1721 1721 1721
       4:  6000     258   433  431  431  433  433 373f  433
       5:     0      ff     0    0    0    0    0    0    0
       6:  c000    1f0f  2026 2025 2023 3020 4020 501f 6020
       7:     0    707f     0    0    0    0    0    0    0
       8:     0    7800  2080 2080 2080 2080 2080 2080 2080
       9:     0    1600     1    1    1    1    1    1    1
       a:   148       0     0    0    0    0    0    0    0
       b:  4000    1000     1    2    4    8   10   20   40
       c:     0      7f     0    0    0    0    0    0    0
       d:  ffff     5f3     0    0    0    0    0    0    0
       e:  ffff       6     0    0    0    0    0    0    0
       f:  ffff     f00  dada dada dada dada dada dada dada
      10:     0       0     0    0    0    0    0    0    0
      11:     0       0     0    0    0    0    0    0    0
      12:  5555       0     0    0    0    0    0    0    0
      13:  5555       0    1a    0    0 1df0    0 1e07    0
      14:  aaaa     400     0    0    0    0    0    0    0
      15:  aaaa       0     0    0    0    0    0    0    0
      16:  ffff       0  6011 6011 6011 6011   33   33    0
      17:  ffff       0     0    0    0    0    0    0    0
      18:  fa41    1844  3210 3210 3210 3210 3210 3210 3210
      19:     0     1e1  7654 7654 7654 7654 7654 7654 7654
      1a:  5550       0     0    0    0    0    0    0    0
      1b:   1fb    f869  8000 8000 8000 8000 8000 8000 8000
      1c:     0       0     0    0    0    0    0    0    0
      1d:   c00       0     0    0    0    0    0    0    0
      1e:     0       0     0    0    0    0    0    0    0
      1f:     0       0     0    0    0    0    0    0    0
      
      All the switch registers which are directly accessible.
      
            Statistic       Port  0  Port  1  Port  2  Port  3  Port  4  Port  5  Port 6
           in_good_octets:     2176        0        0  4263711        0   499540       0
            in_bad_octets:    46050        0        0    50196        0        0       0
               in_unicast:        0        0        0     7693        0     7691       0
            in_broadcasts:        0        0        0        0        0        3       0
            in_multicasts:       34        0        0        0        0       27       0
                 in_pause:        0        0        0        0        0        0       0
             in_undersize:        0        0        0        0        0        0       0
             in_fragments:       45        0        0        2        0        0       0
              in_oversize:        0        0        0        0        0        0       0
                in_jabber:        0        0        0        0        0        0       0
              in_rx_error:        0        0        0        0        0        0       0
             in_fcs_error:      159        0        0       37        0        0       0
               out_octets:      808        0        0   496608      336  4267159       0
              out_unicast:        0        0        0     7691        0     7693       0
           out_broadcasts:        1        0        0        3        0        0       0
           out_multicasts:        9        0        0        6        4       34       0
                out_pause:        0        0        0        0        0        0       0
                excessive:        0        0        0        0        0        0       0
               collisions:        0        0        0        0        0        0       0
                 deferred:        0        0        0        0        0        0       0
                   single:        0        0        0        0        0        0       0
                 multiple:        0        0        0        0        0        0       0
            out_fcs_error:        0        0        0        0        0        0       0
                     late:        0        0        0        0        0        0       0
             hist_64bytes:       36        0        0     7577        0     7574       0
         hist_65_127bytes:       53        0        0      241        4      298       0
        hist_128_255bytes:       50        0        0       12        0       10       0
        hist_256_511bytes:       43        0        0        8        0        2       0
       hist_512_1023bytes:       18        0        0     7573        0     7564       0
      hist_1024_max_bytes:        3        0        0       19        0        0       0
           sw_in_discards:        0        0        0        0        0        0       0
           sw_in_filtered:        0        0        0        0        0        0       0
          sw_out_filtered:       34        0        0     7693        0     7721       0
      
      Of particular interest here is that you get to see all ports,
      including the CPU port and any DSA ports. You cannot get statistics
      for these ports via ethtool.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      824831fa
    • Andrew Lunn's avatar
      dsa: mv88x6xxx: Add debugfs interface for scratch registers · 56d95e22
      Andrew Lunn authored
      Allow the contents of the scratch registers to be shown in debugfs.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      56d95e22