1. 28 5月, 2020 28 次提交
  2. 27 5月, 2020 12 次提交
    • O
      net: phy: at803x: add cable diagnostics support for ATH9331 and ATH8032 · dc0f3ed1
      Oleksij Rempel 提交于
      Add support for Atheros 100Base-T PHYs. The only difference seems to be
      the ability to test 2 pairs instead of 4 and the lack of 1000Base-T
      specific register.
      
      Only the ATH9331 was tested with this patch.
      Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc0f3ed1
    • A
      net: phy: marvell: Configure TDR pulse based on measurement length · db8668a1
      Andrew Lunn 提交于
      When performing a TDR measurement for a short distance, the pulse
      width should be low, to help differentiate between the outgoing pulse
      and any reflection. For longer distances, the pulse should be wider,
      to help with attenuation.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db8668a1
    • A
      net : phy: marvell: Speedup TDR data retrieval by only changing page once · a618e86d
      Andrew Lunn 提交于
      Getting the TDR data requires a large number of MDIO bus
      transactions. The number can however be reduced if the page is only
      changed once. Add the needed locking to allow this, and make use of
      unlocked read/write methods where needed.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a618e86d
    • A
      net: ethtool: Allow PHY cable test TDR data to configured · f2bc8ad3
      Andrew Lunn 提交于
      Allow the user to configure where on the cable the TDR data should be
      retrieved, in terms of first and last sample, and the step between
      samples. Also add the ability to ask for TDR data for just one pair.
      
      If this configuration is not provided, it defaults to 1-150m at 1m
      intervals for all pairs.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      
      v3:
      Move the TDR configuration into a structure
      Add a range check on step
      Use NL_SET_ERR_MSG_ATTR() when appropriate
      Move TDR configuration into a nest
      Document attributes in the request
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f2bc8ad3
    • A
      net: phy: marvell: Add support for amplitude graph · 0c9bcc1d
      Andrew Lunn 提交于
      The Marvell PHYs can measure the amplitude of the returned signal for
      a given distance. Implement this option of the cable test
      infrastructure. When reporting the step, convert the distance into cm.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      
      v2:
      Step based on the measurement resolution, and convert this to cm.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c9bcc1d
    • A
      net: ethtool: Add generic parts of cable test TDR · 1a644de2
      Andrew Lunn 提交于
      Add the generic parts of the code used to trigger a cable test and
      return raw TDR data. Any PHY driver which support this must implement
      the new driver op.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      
      v2
      Update nxp-tja11xx for API change.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a644de2
    • A
      ne2k-pci: Fix various coding-style issues and improve printk() usage · 53c0ec4f
      Armin Wolf 提交于
      Fixed a ton of minor checkpatch errors/warnings and remove version
      printing at module init/when device is found and use MODULE_VERSION
      instead. Also modifying the RTL8029 PCI string to include the compatible
      RTL8029AS nic.
      The only mayor issue remaining is the missing SPDX tag, but since the
      exact version of the GPL is not stated anywhere inside the file, its
      impossible to add such a tag at the moment.
      But maybe it is possible, since 8390.h states Donald Becker's 8390
      drivers are licensed under GPL 2.2 only (= GPL-2.0-only ?).
      The kernel module containing this patch compiles and runs without
      problems on a RTL8029AS-based NE2000 clone card with kernel 5.7.0-rc6.
      Signed-off-by: NArmin Wolf <W_Armin@gmx.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53c0ec4f
    • A
      macvlan: Skip loopback packets in RX handler · 81f3dc93
      Alexander Sverdlin 提交于
      Ignore loopback-originatig packets soon enough and don't try to process L2
      header where it doesn't exist. The very similar br_handle_frame() in bridge
      code performs exactly the same check.
      
      This is an example of such ICMPv6 packet:
      
      skb len=96 headroom=40 headlen=96 tailroom=56
      mac=(40,0) net=(40,40) trans=80
      shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0))
      csum(0xae2e9a2f ip_summed=1 complete_sw=0 valid=0 level=0)
      hash(0xc97ebd88 sw=1 l4=1) proto=0x86dd pkttype=5 iif=24
      dev name=etha01.212 feat=0x0x0000000040005000
      skb headroom: 00000000: 00 7c 86 52 84 88 ff ff 00 00 00 00 00 00 08 00
      skb headroom: 00000010: 45 00 00 9e 5d 5c 40 00 40 11 33 33 00 00 00 01
      skb headroom: 00000020: 02 40 43 80 00 00 86 dd
      skb linear:   00000000: 60 09 88 bd 00 38 3a ff fe 80 00 00 00 00 00 00
      skb linear:   00000010: 00 40 43 ff fe 80 00 00 ff 02 00 00 00 00 00 00
      skb linear:   00000020: 00 00 00 00 00 00 00 01 86 00 61 00 40 00 00 2d
      skb linear:   00000030: 00 00 00 00 00 00 00 00 03 04 40 e0 00 00 01 2c
      skb linear:   00000040: 00 00 00 78 00 00 00 00 fd 5f 42 68 23 87 a8 81
      skb linear:   00000050: 00 00 00 00 00 00 00 00 01 01 02 40 43 80 00 00
      skb tailroom: 00000000: ...
      skb tailroom: 00000010: ...
      skb tailroom: 00000020: ...
      skb tailroom: 00000030: ...
      
      Call Trace, how it happens exactly:
       ...
       macvlan_handle_frame+0x321/0x425 [macvlan]
       ? macvlan_forward_source+0x110/0x110 [macvlan]
       __netif_receive_skb_core+0x545/0xda0
       ? enqueue_task_fair+0xe5/0x8e0
       ? __netif_receive_skb_one_core+0x36/0x70
       __netif_receive_skb_one_core+0x36/0x70
       process_backlog+0x97/0x140
       net_rx_action+0x1eb/0x350
       ? __hrtimer_run_queues+0x136/0x2e0
       __do_softirq+0xe3/0x383
       do_softirq_own_stack+0x2a/0x40
       </IRQ>
       do_softirq.part.4+0x4e/0x50
       netif_rx_ni+0x60/0xd0
       dev_loopback_xmit+0x83/0xf0
       ip6_finish_output2+0x575/0x590 [ipv6]
       ? ip6_cork_release.isra.1+0x64/0x90 [ipv6]
       ? __ip6_make_skb+0x38d/0x680 [ipv6]
       ? ip6_output+0x6c/0x140 [ipv6]
       ip6_output+0x6c/0x140 [ipv6]
       ip6_send_skb+0x1e/0x60 [ipv6]
       rawv6_sendmsg+0xc4b/0xe10 [ipv6]
       ? proc_put_long+0xd0/0xd0
       ? rw_copy_check_uvector+0x4e/0x110
       ? sock_sendmsg+0x36/0x40
       sock_sendmsg+0x36/0x40
       ___sys_sendmsg+0x2b6/0x2d0
       ? proc_dointvec+0x23/0x30
       ? addrconf_sysctl_forward+0x8d/0x250 [ipv6]
       ? dev_forward_change+0x130/0x130 [ipv6]
       ? _raw_spin_unlock+0x12/0x30
       ? proc_sys_call_handler.isra.14+0x9f/0x110
       ? __call_rcu+0x213/0x510
       ? get_max_files+0x10/0x10
       ? trace_hardirqs_on+0x2c/0xe0
       ? __sys_sendmsg+0x63/0xa0
       __sys_sendmsg+0x63/0xa0
       do_syscall_64+0x6c/0x1e0
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      81f3dc93
    • I
      mlxsw: spectrum_router: Allow programming link-local prefix routes · 10d3757f
      Ido Schimmel 提交于
      The device has a trap for IPv6 packets that need be routed and have a
      unicast link-local destination IP (i.e., fe80::/10). This allows mlxsw
      to ignore link-local routes, as the packets will be trapped to the CPU
      in any case.
      
      However, since link-local routes are not programmed, it is possible for
      routed packets to hit the default route which might also be programmed
      to trap packets. This means that packets with a link-local destination
      IP might be trapped for the wrong reason.
      
      To overcome this, allow programming link-local prefix routes (usually
      one fe80::/64 per-table), so that the packets will be forwarded until
      reaching the link-local trap.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      10d3757f
    • I
      mlxsw: spectrum: Add packet traps for BFD packets · 9785b92b
      Ido Schimmel 提交于
      Bidirectional Forwarding Detection (BFD) provides "low-overhead,
      short-duration detection of failures in the path between adjacent
      forwarding engines" (RFC 5880).
      
      This is accomplished by exchanging BFD packets between the two
      forwarding engines. Up until now these packets were trapped via the
      general local delivery (i.e., IP2ME) trap which also traps a lot of
      other packets that are not as time-sensitive as BFD packets.
      
      Expose dedicated traps for BFD packets so that user space could
      configure a dedicated policer for them.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9785b92b
    • I
      mlxsw: spectrum: Treat IPv6 link-local SIP as an exception · dacc4e3a
      Ido Schimmel 提交于
      IPv6 packets that need to be forwarded and have a link-local source IP are
      dropped by the kernel and an ICMPv6 "Destination unreachable" is sent to
      the sending host.
      
      As such, change the trap group of such packets so that they do not
      interfere with IPv6 management packets. In the future this trap will be
      exposed as an exception via devlink-trap.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dacc4e3a
    • I
      mlxsw: spectrum: Share one group for all locally delivered packets · 1260e083
      Ido Schimmel 提交于
      Routed IP packets with the Router Alert option need to be trapped to
      the CPU as they might need to be locally delivered to raw sockets with
      the IP_ROUTER_ALERT / IPV6_ROUTER_ALERT socket option.
      
      Move them to the same group with other packets that might need to be
      trapped following route lookup.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1260e083