1. 12 5月, 2018 10 次提交
    • D
      Merge branch 'dsa-Plug-in-PHYLINK-support' · 4cbd7a7d
      David S. Miller 提交于
      Florian Fainelli says:
      
      ====================
      net: dsa: Plug in PHYLINK support
      
      This patch series adds PHYLINK support to DSA which is necessary to support more
      complex PHY and pluggable modules setups.
      
      Patch series can be found here:
      
      https://github.com/ffainelli/linux/commits/dsa-phylink-v2
      
      This was tested on:
      
      - dsa-loop
      - bcm_sf2
      - mv88e6xxx
      - b53
      
      With a variety of test cases:
      - internal & external MDIO PHYs
      - MoCA with link notification through interrupt/MMIO register
      - built-in PHYs
      - ifconfig up/down for several cycles works
      - bind/unbind of the drivers
      
      Changes in v2:
      
      - fixed link configuration for mv88e6xxx (Andrew) after introducing polling
      
      This is technically v2 of what was posted back in March 2018, changes from last
      time:
      
      - fixed probe/remove of drivers
      - fixed missing gpiod_put() for link GPIOs
      - fixed polling of link GPIOs (Russell I would need your SoB on the patch you
        provided offline initially, added some modifications to it)
      - tested across a wider set of platforms
      
      And everything should still work as expected. Please be aware of the following:
      
      - switch drivers (like bcm_sf2) which may have user-facing network ports using
        fixed links would need to implement phylink_mac_ops to remain functional.
        PHYLINK does not create a phy_device for fixed links, therefore our
        call to adjust_link() from phylink_mac_link_{up,down} would not be calling
        into the driver. This *should not* affect CPU/DSA ports which are configured
        through adjust_link() but have no network devices
      
      - support for SFP/SFF is now possible, but switch drivers will still need some
        modifications to properly support those, including, but not limited to using
        the correct binding information. This will be submitted on top of this series
      
      Please do test on your respective platforms/switches and let me know if you
      find any issues, hopefully everything still works like before.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cbd7a7d
    • F
      net: dsa: bcm_sf2: Get rid of PHYLIB functions · 58d56fcc
      Florian Fainelli 提交于
      Now that we have converted the bcm_sf2 driver to implement PHYLINK MAC
      operations, we can remove the PHYLIB callbacks: adjust_link() and
      fixed_link_update() which are no longer called by DSA.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      58d56fcc
    • F
      net: dsa: Plug in PHYLINK support · aab9c406
      Florian Fainelli 提交于
      Add support for PHYLINK within the DSA subsystem in order to support more
      complex devices such as pluggable (SFP) and non-pluggable (SFF) modules, 10G
      PHYs, and traditional PHYs. Using PHYLINK allows us to drop some amount of
      complexity we had while probing fixed and non-fixed PHYs using Device Tree.
      
      Because PHYLINK separates the Ethernet MAC/port configuration into different
      stages, we let switch drivers implement those, and for now, we maintain
      functionality by calling dsa_slave_adjust_link() during
      phylink_mac_link_{up,down} which provides semantically equivalent steps.
      
      Drivers willing to take advantage of PHYLINK should implement the phylink_mac_*
      operations that DSA wraps.
      
      We cannot quite remove the adjust_link() callback just yet, because a number of
      drivers rely on that for configuring their "CPU" and "DSA" ports, this is done
      dsa_port_setup_phy_of() and dsa_port_fixed_link_register_of() still.
      
      Drivers that utilize fixed links for user-facing ports (e.g: bcm_sf2) will need
      to implement phylink_mac_ops from now on to preserve functionality, since PHYLINK
      *does not* create a phy_device instance for fixed links.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aab9c406
    • R
      net: dsa: mv88e6xxx: add PHYLINK support · c9a2356f
      Russell King 提交于
      Add rudimentary phylink support to mv88e6xxx. This allows the driver
      using user ports with fixed links to keep operating normally. User ports
      with normal PHYs are not affected since the switch automatically manages
      their link parameters. User facing ports which use a SFP/SFF with a
      non-fixed link mode might require a call to phylink_mac_change() to
      operate properly.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      [Andrew: fixed link setting after adding link polling]
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      [florian: expand commit message]
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9a2356f
    • F
      net: dsa: Eliminate dsa_slave_get_link() · c4aef9fc
      Florian Fainelli 提交于
      Since we use PHYLIB to manage the per-port link indication, this will
      also be reflected correctly in the network device's carrier state, so we
      can use ethtool_op_get_link() instead.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c4aef9fc
    • F
      net: dsa: bcm_sf2: Implement phylink_mac_ops · bc0cb653
      Florian Fainelli 提交于
      Make the bcm_sf2 driver implement phylink_mac_ops since it needs to
      support a wide variety of network interfaces: internal & external MDIO
      PHYs, fixed PHYs, MoCA with MMIO link status.
      
      A large amount of what needs to be done already exists under
      bcm_sf2_sw_adjust_link() so we are essentially breaking this down into
      the necessary operation for PHYLINK to work: mac_config, mac_link_up,
      mac_link_down and validate. We can now entirely get rid of most of what
      fixed_link_update() provided because only the link information is actually
      necessary. We still have to force DUPLEX_FULL for legacy Device Tree bindings
      that did not specify that before.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc0cb653
    • F
      net: dsa: Add PHYLINK switch operations · 11d8f3dd
      Florian Fainelli 提交于
      In preparation for adding support for PHYLINK within DSA, define a number of
      operations that we will need and that switch drivers can start implementing.
      Proper integration with PHYLINK will follow in subsequent patches.
      
      We start selecting PHYLINK (which implies PHYLIB) in net/dsa/Kconfig
      such that drivers can be guaranteed that this dependency is properly
      taken care of and can start referencing PHYLINK helper functions without
      requiring stubs or anything.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      11d8f3dd
    • R
      net: phy: phylink: Poll link GPIOs · 9cd00a8a
      Russell King 提交于
      When using a fixed link with a link GPIO, we need to poll that GPIO to
      determine link state changes. This is consistent with what fixed_phy.c does.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9cd00a8a
    • F
      net: phy: phylink: Release link GPIO · daab3349
      Florian Fainelli 提交于
      We are not releasing the link GPIO descriptor with gpiod_put() which results in
      subsequent probing to get -EBUSY when calling fwnode_get_named_gpiod(). Fix this
      by doing the release in phylink_destroy().
      
      Fixes: 9525ae83 ("phylink: add phylink infrastructure")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      daab3349
    • F
      net: phy: phylink: Use gpiod_get_value_cansleep() · bb322a90
      Florian Fainelli 提交于
      The GPIO provider for the link GPIO line might require the use of the
      _cansleep() API, utilize that. This is safe to do since we run in workqueue
      context.
      
      Fixes: 9525ae83 ("phylink: add phylink infrastructure")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bb322a90
  2. 11 5月, 2018 30 次提交
    • P
      rocker: Postpone filtering of !added_by_user FDB · ec9efb52
      Petr Machata 提交于
      Breaking out of the switch in rocker_switchdev_event() still ends up
      scheduling work, except an ill-defined one. This leads to an OOPS cited
      below. Fix by postponing the check until rocker_switchdev_event_work().
      
      [   23.148476] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
      [   23.148810] PGD 0 P4D 0
      [   23.148982] Oops: 0000 [#1] PREEMPT SMP PTI
      [   23.149190] Modules linked in: bridge stp llc iptable_nat nf_nat_ipv4 nf_nat e1000 rocker
      [   23.149768] CPU: 0 PID: 239 Comm: kworker/u2:4 Not tainted 4.17.0-rc3-net_next_queue-custom #6
      [   23.150298] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014
      [   23.150868] Workqueue: rocker rocker_switchdev_event_work [rocker]
      [   23.151258] RIP: 0010:ofdpa_port_fdb+0x7b/0x230 [rocker]
      [   23.151597] RSP: 0018:ffffc900004b3e18 EFLAGS: 00010246
      [   23.151952] RAX: 00000000fffbc68c RBX: 0000000000000000 RCX: 0000000000000000
      [   23.152363] RDX: 0000000000000010 RSI: ffff88003b4471e0 RDI: 00000000ffffffff
      [   23.152768] RBP: ffff88003b4471c0 R08: ffff88003b4471e0 R09: ffff88003b4471c0
      [   23.153141] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880036caf000
      [   23.153515] R13: 0000000000000000 R14: 0000000000000000 R15: ffff88003bc00000
      [   23.153919] FS:  0000000000000000(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
      [   23.154444] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   23.154806] CR2: 0000000000000000 CR3: 0000000036eb6000 CR4: 00000000000006f0
      [   23.155194] Call Trace:
      [   23.155472]  rocker_switchdev_event_work+0x9b/0xd0 [rocker]
      [   23.155850]  ? __schedule+0x231/0x700
      [   23.156175]  process_one_work+0x1cf/0x3e0
      [   23.156490]  worker_thread+0x26/0x3d0
      [   23.156795]  ? trace_event_raw_event_workqueue_execute_start+0x80/0x80
      [   23.157181]  kthread+0x10e/0x130
      [   23.157485]  ? kthread_create_worker_on_cpu+0x40/0x40
      [   23.157824]  ret_from_fork+0x35/0x40
      [   23.158174] Code: 00 00 c1 e8 02 4c 8d 45 20 bf ff ff ff ff 83 e0 01 4c 89 65 20 88 45 14 48 8b 05 21 da 1f e2 4c 89 c6 4c 89 44 24 10 48 89 45 18 <41> 8b 45 00 89 45 28 41 0f b7 45 04 66 89 45 2c 0f b7 44 24 04
      [   23.159346] RIP: ofdpa_port_fdb+0x7b/0x230 [rocker] RSP: ffffc900004b3e18
      [   23.159742] CR2: 0000000000000000
      [   23.160088] ---[ end trace f9b16d4cb6df0629 ]---
      
      Fixes: 816a3bed ("switchdev: Add fdb.added_by_user to switchdev notifications")
      Suggested-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec9efb52
    • B
      tls: Fix tls_device initialization · 895262d8
      Boris Pismenny 提交于
      Add sg table initialization to fix a BUG_ON encountered when enabling
      CONFIG_DEBUG_SG.
      Signed-off-by: NBoris Pismenny <borisp@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      895262d8
    • G
      cxgb4: fix the wrong conversion of Mbps to Kbps · b3c594ab
      Ganesh Goudar 提交于
      fix the wrong conversion where 1 Mbps was converted to
      1024 Kbps.
      Signed-off-by: NGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b3c594ab
    • D
      Merge branch 'mlxsw-Support-VLAN-devices-in-mirroring-offloads' · ccb02638
      David S. Miller 提交于
      Ido Schimmel says:
      
      ====================
      mlxsw: Support VLAN devices in mirroring offloads
      
      Petr says:
      
      When offloading "tc action mirred mirror", there are several scenarios
      where VLAN devices can show up, that mlxsw can offload on Spectrum
      machines.
      
      I) A direct mirror to a VLAN device on top of a front-panel port device
         (commonly referred to as "RSPAN")
      
      II) VLAN device in egress path of a packet when resolving a mirror to
          gretap or ip6gretap netdevice.
      
      Specifically in the latter case, the following are the cases that can be
      offloaded:
      
      IIa) VLAN device directly above a physical device.
      IIb) A VLAN-unaware bridge where the egress device is as in IIa.
      IIc) VLAN device on top of a VLAN-aware bridge where the egress device
           is a physical device.
      
      This patch set implements all the above cases.
      
      First, in patch #1, br_vlan_get_info() is extended to allow bridge
      master argument.
      
      Case I is then implemented in patches #2 and #3, case II in patch #4.
      
      Note that handling of VLAN protocol is not included. In case I, mirrored
      packets may end up being double-tagged, and it might be reasonable for
      the outer tag to be an 802.1ad. However, the protocol type configuration
      would have to be put on the same VLAN netdevice that represents normal
      VLAN traffic, and mlxsw currently ignores this setting in that case. Thus
      this support was left out and the encapsulation always uses 802.1q
      protocol.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccb02638
    • P
      mlxsw: spectrum_span: Support VLAN under mirror-to-gretap · 03c44132
      Petr Machata 提交于
      When mirroring to a gretap or ip6gretap device, allow the underlay
      packet path to include VLAN devices. The following configurations are
      supported in underlay:
      
      - vlan over phys
      - vlan-unaware bridge where the egress device is vlan over phys
      - vlan over vlan-aware bridge where the egress device is phys
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      03c44132
    • P
      mlxsw: spectrum_span: Support mirror-to-VLAN · e00698d1
      Petr Machata 提交于
      Offload "tc action mirred mirror" to a device that is a vlan device on
      top of a front-panel port device. The hardware encapsulates the mirrored
      packets in a VLAN tag. That includes the case that the mirrored traffic
      is already VLAN-tagged--in that case the monitor traffic will be
      double-tagged, just like in the software path.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e00698d1
    • P
      mlxsw: reg: Add MLXSW_REG_MPAT_SPAN_TYPE_REMOTE_ETH · 41947662
      Petr Machata 提交于
      Add MLXSW_REG_MPAT_SPAN_TYPE_REMOTE_ETH to support VLAN-encapsulated
      port mirroring.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41947662
    • P
      net: bridge: Allow bridge master in br_vlan_get_info() · 2b18d79e
      Petr Machata 提交于
      Mirroring offload in mlxsw needs to check that a given VLAN is allowed
      to ingress the bridge device. br_vlan_get_info() is the function that is
      used for this, however currently it only supports bridge port devices.
      Extend it to support bridge masters as well.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b18d79e
    • J
      tcp: Add mark for TIMEWAIT sockets · 00483690
      Jon Maxwell 提交于
      This version has some suggestions by Eric Dumazet:
      
      - Use a local variable for the mark in IPv6 instead of ctl_sk to avoid SMP
      races.
      - Use the more elegant "IP4_REPLY_MARK(net, skb->mark) ?: sk->sk_mark"
      statement.
      - Factorize code as sk_fullsock() check is not necessary.
      
      Aidan McGurn from Openwave Mobility systems reported the following bug:
      
      "Marked routing is broken on customer deployment. Its effects are large
      increase in Uplink retransmissions caused by the client never receiving
      the final ACK to their FINACK - this ACK misses the mark and routes out
      of the incorrect route."
      
      Currently marks are added to sk_buffs for replies when the "fwmark_reflect"
      sysctl is enabled. But not for TW sockets that had sk->sk_mark set via
      setsockopt(SO_MARK..).
      
      Fix this in IPv4/v6 by adding tw->tw_mark for TIME_WAIT sockets. Copy the the
      original sk->sk_mark in __inet_twsk_hashdance() to the new tw->tw_mark location.
      Then progate this so that the skb gets sent with the correct mark. Do the same
      for resets. Give the "fwmark_reflect" sysctl precedence over sk->sk_mark so that
      netfilter rules are still honored.
      Signed-off-by: NJon Maxwell <jmaxwell37@gmail.com>
      Reviewed-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      00483690
    • J
      net: ipv4: remove define INET_CSK_DEBUG and unnecessary EXPORT_SYMBOL · 03bdfc00
      Joe Perches 提交于
      INET_CSK_DEBUG is always set and only is used for 2 pr_debug calls.
      
      EXPORT_SYMBOL(inet_csk_timer_bug_msg) is only used by these 2
      pr_debug calls and is also unnecessary as the exported string can
      be used directly by these calls.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      03bdfc00
    • F
    • F
      liquidio: monitor all of Octeon's cores in watchdog thread · f6047576
      Felix Manlunas 提交于
      The liquidio_watchdog kernel thread is watching over only 12 cores of the
      Octeon CN23XX; it's neglecting the other 4 cores that are present in the
      CN2360.  Fix it by defining LIO_MAX_CORES as 16.
      Signed-off-by: NFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f6047576
    • D
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · e72a7dd7
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      100GbE Intel Wired LAN Driver Updates 2018-05-09
      
      This series contains updates to fm10k only.
      
      Jake provides all the changes in the series, starting with adding
      support for accelerated MACVLAN devices.  Reduced code duplication by
      implementing a macro to be used when setting up the type specific
      macros.  Avoided potential bugs with stats by using a macro to calculate
      the array size when passing to ensure that the size is correct.
      
      v2: changed macro reference '#' with __stringify() as suggested by
          Joe Perches to patch 2 of the series.  Also made sure the updated
          series of patches is actually pushed to my kernel.org tree
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e72a7dd7
    • E
      net/ipv6: fix lock imbalance in ip6_route_del() · 9e575010
      Eric Dumazet 提交于
      WARNING: lock held when returning to user space!
      4.17.0-rc3+ #37 Not tainted
      
      syz-executor1/27662 is leaving the kernel with locks still held!
      1 lock held by syz-executor1/27662:
       #0: 00000000f661aee7 (rcu_read_lock){....}, at: ip6_route_del+0xea/0x13f0 net/ipv6/route.c:3206
      BUG: scheduling while atomic: syz-executor1/27662/0x00000002
      INFO: lockdep is turned off.
      Modules linked in:
      Kernel panic - not syncing: scheduling while atomic
      
      CPU: 1 PID: 27662 Comm: syz-executor1 Not tainted 4.17.0-rc3+ #37
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x1b9/0x294 lib/dump_stack.c:113
       panic+0x22f/0x4de kernel/panic.c:184
       __schedule_bug.cold.85+0xdf/0xdf kernel/sched/core.c:3290
       schedule_debug kernel/sched/core.c:3307 [inline]
       __schedule+0x139e/0x1e30 kernel/sched/core.c:3412
       schedule+0xef/0x430 kernel/sched/core.c:3549
       exit_to_usermode_loop+0x220/0x310 arch/x86/entry/common.c:152
       prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
       syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
       do_syscall_64+0x6ac/0x800 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x455979
      RSP: 002b:00007fbf4051dc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      RAX: 0000000000000000 RBX: 00007fbf4051e6d4 RCX: 0000000000455979
      RDX: 00000000200001c0 RSI: 000000000000890c RDI: 0000000000000013
      RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
      R13: 00000000000003c8 R14: 00000000006f9b60 R15: 0000000000000000
      Dumping ftrace buffer:
         (ftrace buffer empty)
      Kernel Offset: disabled
      Rebooting in 86400 seconds..
      
      Fixes: 23fb93a4 ("net/ipv6: Cleanup exception and cache route handling")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: David Ahern <dsahern@gmail.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9e575010
    • D
      Merge branch 'hns3-misc-fixes' · c320e49d
      David S. Miller 提交于
      Salil Mehta says:
      
      ====================
      Misc bug fixes for HNS3 Ethernet Driver
      
      Fixes to some of the bugs found during system test, internal review
      and clean-up
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c320e49d
    • Y
      net: hns3: refactor the loopback related function · e4d68dae
      Yunsheng Lin 提交于
      This patch refactors the loopback related function in order
      to support the serdes loopback.
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e4d68dae
    • Y
      net: hns3: fix for cleaning ring problem · beebca3a
      Yunsheng Lin 提交于
      The head or tail in hardware is not longer valid when resetting,
      current hns3_clear_all_ring use them to clean the ring, which
      will cause problem during resetting.
      
      This patch fixes it by using next_to_use and next_to_clean in
      the ring struct.
      
      Fixes: 76ad4f0e ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      beebca3a
    • Y
      net: hns3: remove add/del_tunnel_udp in hns3_enet module · 0a78a1df
      Yunsheng Lin 提交于
      The add/del_tunnel_udp is not implemented in hclge_main moulde,
      the NETIF_F_RX_UDP_TUNNEL_PORT feature bit is added automatically
      by stack when ndo_udp_tunnel_add is not null in dev->netdev_ops.
      
      This patch removes the add/del_tunnel_udp related function, for
      we do not support this feature now.
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0a78a1df
    • Y
      net: hns3: Fix for setting mac address when resetting · f09555ff
      Yunsheng Lin 提交于
      When hns3_init_mac_addr is called during reset process, it will
      get the mac address from NCL_CONFIG and set it to hardware. If
      user has changed the mac address, then the mac address set by
      user is lost during resetting.
      
      This patch fixes it by not getting the mac address from NCL_CONFIG
      when resetting.
      
      Fixes: 424eb834 ("net: hns3: Unified HNS3 {VF|PF} Ethernet Driver for hip08 SoC")
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f09555ff
    • S
      hv_netvsc: typo in NDIS RSS parameters structure · bfcbcb67
      Stephen Hemminger 提交于
      Fix simple misspelling kashkey_offset should be hashkey_offset.
      Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bfcbcb67
    • S
      drivers: net: davinci_mdio: prevent spurious timeout · 54472edf
      Sekhar Nori 提交于
      A well timed kernel preemption in the time_after() loop
      in wait_for_idle() can result in a spurious timeout
      error to be returned.
      
      Fix it by using readl_poll_timeout() which takes care of
      this issue.
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      54472edf
    • D
      Merge branch 'dsa-mv88e6xxx-cleanup-Global-Control-2-register' · bfe1e616
      David S. Miller 提交于
      Vivien Didelot says:
      
      ====================
      net: dsa: mv88e6xxx: cleanup Global Control 2 register
      
      The mv88e6xxx driver still writes arbitrary values in the Global 1
      Control 2 register at setup, which layout differs a lot between chips.
      This results in an inconsistent configuration, for example with the
      Remote Management Unit (RMU).
      
      The first patch adds an operation for the Cascade Port bits, the second
      patch sets the device number in the device mapping function and the
      third patch adds an operation to correctly disable the RMU.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bfe1e616
    • V
      net: dsa: mv88e6xxx: add RMU disable op · 9e5baf9b
      Vivien Didelot 提交于
      The RMU mode bits moved a lot within the Global Control 2 register of
      the Marvell switch families. Add an .rmu_disable op to support at least
      3 known alternatives.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9e5baf9b
    • V
      net: dsa: mv88e6xxx: set device number · 23c98919
      Vivien Didelot 提交于
      All Marvell switches supported by mv88e6xxx have to set their device
      number in the Global Control 2 register. Extract this in a read then
      write function, called from the device mapping setup code.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      23c98919
    • V
      net: dsa: mv88e6xxx: add a cascade port op · 02317e68
      Vivien Didelot 提交于
      Only the 88E6185 family has bits 15:12 Cascade Port bits in the Global
      Control 2 register. Hence inconsistent values are actually written in
      this register for other families.
      
      Add a .set_cascade_port operation to isolate the 88E6185 case, and call
      it from the device mapping setup function.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      02317e68
    • D
      Merge branch 'mlx4-misc-next' · 79a6fd23
      David S. Miller 提交于
      Tariq Toukan says:
      
      ====================
      mlx4_core misc for 4.18
      
      This patchset contains misc enhancements from the team
      to the mlx4 Core driver.
      
      Patch 1 by Eran adds driver version report in FW.
      Patch 2 by Yishai implements suspend/resume PCI callbacks.
      Patch 3 extends the range of an existing module param from boolean to numerical.
      
      Series generated against net-next commit:
      53a7bdfb dt-bindings: dsa: Remove unnecessary #address/#size-cells
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79a6fd23
    • T
      net/mlx4_core: Use msi_x module param to limit num of MSI-X irqs · e5732838
      Tariq Toukan 提交于
      Extend the boolean interpretation of msi_x module parameter
      to numerical, as follows:
      
      0   - Don't use MSI-X.
      1   - Use MSI-X, driver decides the num of MSI-X irqs.
      >=2 - Use MSI-X, limit number of MSI-X irqs to msi_x.
            In SRIOV, this limits the number of MSI-X irqs per VF.
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Cc: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
      Reviewed-by: NAjaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5732838
    • Y
      net/mlx4_core: Add PCI calls for suspend/resume · 86a3e5d0
      Yishai Hadas 提交于
      Implement suspend/resume callbacks in struct pci_driver.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      86a3e5d0
    • E
      net/mlx4_core: Report driver version to FW · e5c9a705
      Eran Ben Elisha 提交于
      If supported, write a driver version string to FW as part of the
      INIT_HCA command.
      
      Example of driver version: "Linux,mlx4_core,4.0-0"
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5c9a705
    • V
      net: dsa: fix added_by_user switchdev notification · a37fb855
      Vivien Didelot 提交于
      Commit 161d82de ("net: bridge: Notify about !added_by_user FDB
      entries") causes the below oops when bringing up a slave interface,
      because dsa_port_fdb_add is still scheduled, but with a NULL address.
      
      To fix this, keep the dsa_slave_switchdev_event function agnostic of the
      notified info structure and handle the added_by_user flag in the
      specific dsa_slave_switchdev_event_work function.
      
          [   75.512263] Unable to handle kernel NULL pointer dereference at virtual address 00000000
          [   75.519063] pgd = (ptrval)
          [   75.520545] [00000000] *pgd=00000000
          [   75.522839] Internal error: Oops: 17 [#1] ARM
          [   75.525898] Modules linked in:
          [   75.527673] CPU: 0 PID: 9 Comm: kworker/u2:1 Not tainted 4.17.0-rc2 #78
          [   75.532988] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
          [   75.538153] Workqueue: dsa_ordered dsa_slave_switchdev_event_work
          [   75.542970] PC is at mv88e6xxx_port_db_load_purge+0x60/0x1b0
          [   75.547341] LR is at mdiobus_read_nested+0x6c/0x78
          [   75.550833] pc : [<804cd5c0>]    lr : [<804bba84>]    psr: 60070013
          [   75.555796] sp : 9f54bd78  ip : 9f54bd87  fp : 9f54bddc
          [   75.559719] r10: 00000000  r9 : 0000000e  r8 : 9f6a6010
          [   75.563643] r7 : 00000000  r6 : 81203048  r5 : 9f6a6010  r4 : 9f6a601c
          [   75.568867] r3 : 00000000  r2 : 00000000  r1 : 0000000d  r0 : 00000000
          [   75.574094] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
          [   75.579933] Control: 10c53c7d  Table: 9de20059  DAC: 00000051
          [   75.584384] Process kworker/u2:1 (pid: 9, stack limit = 0x(ptrval))
          [   75.589349] Stack: (0x9f54bd78 to 0x9f54c000)
          [   75.592406] bd60:                                                       00000000 00000000
          [   75.599295] bd80: 00000391 9f299d10 9f299d68 8014317c 9f7f0000 8120af00 00006dc2 00000000
          [   75.606186] bda0: 8120af00 00000000 9f54bdec 1c9f5d92 8014317c 9f6a601c 9f6a6010 00000000
          [   75.613076] bdc0: 00000000 00000000 9dd1141c 8125a0b4 9f54be0c 9f54bde0 804cd8a8 804cd56c
          [   75.619966] bde0: 0000000e 80143680 00000001 9dce9c1c 81203048 9dce9c10 00000003 00000000
          [   75.626858] be00: 9f54be5c 9f54be10 806abcac 804cd864 9f54be54 80143664 8014317c 80143054
          [   75.633748] be20: ffcaa81d 00000000 812030b0 1c9f5d92 00000000 81203048 9f54beb4 00000003
          [   75.640639] be40: ffffffff 00000000 9dd1141c 8125a0b4 9f54be84 9f54be60 80138e98 806abb18
          [   75.647529] be60: 81203048 9ddc4000 9dce9c54 9f72a300 00000000 00000000 9f54be9c 9f54be88
          [   75.654420] be80: 801390bc 80138e50 00000000 9dce9c54 9f54beac 9f54bea0 806a9524 801390a0
          [   75.661310] bea0: 9f54bedc 9f54beb0 806a9c7c 806a950c 9f54becc 00000000 00000000 00000000
          [   75.668201] bec0: 9f540000 1c9f5d92 805fe604 9ddffc00 9f54befc 9f54bee0 806ab228 806a9c38
          [   75.675092] bee0: 806ab178 9ddffc00 9f4c1900 9f40d200 9f54bf34 9f54bf00 80131e30 806ab184
          [   75.681983] bf00: 9f40d214 9f54a038 9f40d200 9f40d200 9f4c1918 812119a0 9f40d214 9f54a038
          [   75.688873] bf20: 9f40d200 9f4c1900 9f54bf7c 9f54bf38 80132124 80131d1c 9f5f2dd8 00000000
          [   75.695764] bf40: 812119a0 9f54a038 812119a0 81259c5b 9f5f2dd8 9f5f2dc0 9f53dbc0 00000000
          [   75.702655] bf60: 9f4c1900 801320b4 9f5f2dd8 9f4f7e88 9f54bfac 9f54bf80 80137ad0 801320c0
          [   75.709544] bf80: 9f54a000 9f53dbc0 801379a0 00000000 00000000 00000000 00000000 00000000
          [   75.716434] bfa0: 00000000 9f54bfb0 801010e8 801379ac 00000000 00000000 00000000 00000000
          [   75.723324] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          [   75.730206] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
          [   75.737083] Backtrace:
          [   75.738252] [<804cd560>] (mv88e6xxx_port_db_load_purge) from [<804cd8a8>] (mv88e6xxx_port_fdb_add+0x50/0x68)
          [   75.746795]  r10:8125a0b4 r9:9dd1141c r8:00000000 r7:00000000 r6:00000000 r5:9f6a6010
          [   75.753323]  r4:9f6a601c
          [   75.754570] [<804cd858>] (mv88e6xxx_port_fdb_add) from [<806abcac>] (dsa_switch_event+0x1a0/0x660)
          [   75.762238]  r8:00000000 r7:00000003 r6:9dce9c10 r5:81203048 r4:9dce9c1c
          [   75.767655] [<806abb0c>] (dsa_switch_event) from [<80138e98>] (notifier_call_chain+0x54/0x94)
          [   75.774893]  r10:8125a0b4 r9:9dd1141c r8:00000000 r7:ffffffff r6:00000003 r5:9f54beb4
          [   75.781423]  r4:81203048
          [   75.782672] [<80138e44>] (notifier_call_chain) from [<801390bc>] (raw_notifier_call_chain+0x28/0x30)
          [   75.790514]  r9:00000000 r8:00000000 r7:9f72a300 r6:9dce9c54 r5:9ddc4000 r4:81203048
          [   75.796982] [<80139094>] (raw_notifier_call_chain) from [<806a9524>] (dsa_port_notify+0x24/0x38)
          [   75.804483] [<806a9500>] (dsa_port_notify) from [<806a9c7c>] (dsa_port_fdb_add+0x50/0x6c)
          [   75.811371] [<806a9c2c>] (dsa_port_fdb_add) from [<806ab228>] (dsa_slave_switchdev_event_work+0xb0/0x10c)
          [   75.819635]  r4:9ddffc00
          [   75.820885] [<806ab178>] (dsa_slave_switchdev_event_work) from [<80131e30>] (process_one_work+0x120/0x3a4)
          [   75.829241]  r6:9f40d200 r5:9f4c1900 r4:9ddffc00 r3:806ab178
          [   75.833612] [<80131d10>] (process_one_work) from [<80132124>] (worker_thread+0x70/0x574)
          [   75.840415]  r10:9f4c1900 r9:9f40d200 r8:9f54a038 r7:9f40d214 r6:812119a0 r5:9f4c1918
          [   75.846945]  r4:9f40d200
          [   75.848191] [<801320b4>] (worker_thread) from [<80137ad0>] (kthread+0x130/0x160)
          [   75.854300]  r10:9f4f7e88 r9:9f5f2dd8 r8:801320b4 r7:9f4c1900 r6:00000000 r5:9f53dbc0
          [   75.860830]  r4:9f5f2dc0
          [   75.862076] [<801379a0>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c)
          [   75.867999] Exception stack(0x9f54bfb0 to 0x9f54bff8)
          [   75.871753] bfa0:                                     00000000 00000000 00000000 00000000
          [   75.878640] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          [   75.885519] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
          [   75.890844]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:801379a0
          [   75.897377]  r4:9f53dbc0 r3:9f54a000
          [   75.899663] Code: e3a02000 e3a03000 e14b26f4 e24bc055 (e5973000)
          [   75.904575] ---[ end trace fbca818a124dbf0d ]---
      
      Fixes: 816a3bed ("switchdev: Add fdb.added_by_user to switchdev notifications")
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a37fb855