1. 28 5月, 2020 29 次提交
  2. 27 5月, 2020 11 次提交
    • 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
    • D
      Merge branch 'Raw-PHY-TDR-data' · 943bbe1d
      David S. Miller 提交于
      Andrew Lunn says:
      
      ====================
      Raw PHY TDR data
      
      Some ethernet PHYs allow access to raw TDR data in addition to summary
      diagnostics information. Add support for retrieving this data via
      netlink ethtool. The basic structure in the core is the same as for
      normal phy diagnostics, the PHY driver simply uses different helpers
      to fill the netlink message with different data.
      
      There is a graphical tool under development, as well a ethtool(1)
      which can dump the data as text and JSON.
      
      A patched ethtool(1) can be found in
      https://github.com/lunn/ethtool.git feature/cable-test-v5
      
      Thanks for Chris Healy for lots of testing.
      
      v2:
      See the individual patches but:
      
      Pass distances in centimeters, not meters
      
      Allow the PHY to round distances to what it supports and report what
      it actually used along with the results.
      
      Make the Marvell PHY use steps a multiple of 0.805 meters, its native
      step size.
      
      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
      Unsquash the last two patches
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      943bbe1d
    • 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 helpers for cable test TDR data · 6b4a0fc1
      Andrew Lunn 提交于
      Add helpers for returning raw TDR helpers in netlink messages.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b4a0fc1
    • 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
      net: ethtool: Add attributes for cable test TDR data · a331172b
      Andrew Lunn 提交于
      Some Ethernet PHYs can return the raw time domain reflectromatry data.
      Add the attributes to allow this data to be requested and returned via
      netlink ethtool.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      
      v2:
      m -> cm
      Report what the PHY actually used for start/stop/step.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a331172b
    • 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