1. 16 Apr, 2021 11 commits
    • Ederson de Souza's avatar
      igc: Enable internal i225 PPS · 64433e5b
      Ederson de Souza authored
      The i225 device can produce one interrupt on the full second, much
      like i210 - from where this patch is inspired.
      
      This patch sets up the full second interruption on the i225 and when
      receiving it, it sends a PPS event to PTP (Precision Time Protocol)
      kernel subsystem.
      
      The PTP subsystem exposes the PPS events via ioctl and sysfs, and one
      can use the `testptp` tool (tools/testing/selftests/ptp) to check that
      the events are being generated.
      Signed-off-by: default avatarEderson de Souza <ederson.desouza@intel.com>
      Tested-by: default avatarDvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      64433e5b
    • Grzegorz Siwik's avatar
      igb: Add double-check MTA_REGISTER for i210 and i211 · 1d3cb90c
      Grzegorz Siwik authored
      Add new function which checks MTA_REGISTER if its filled correctly.
      If not then writes again to same register.
      There is possibility that i210 and i211 could not accept
      MTA_REGISTER settings, specially when you add and remove
      many of multicast addresses in short time.
      Without this patch there is possibility that multicast settings will be
      not always set correctly in hardware.
      Signed-off-by: default avatarGrzegorz Siwik <grzegorz.siwik@intel.com>
      Tested-by: default avatarDave Switzer <david.switzer@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      1d3cb90c
    • Ederson de Souza's avatar
      igb: Redistribute memory for transmit packet buffers when in Qav mode · 26b67f5a
      Ederson de Souza authored
      i210 has a total of 24KB of transmit packet buffer. When in Qav mode,
      this buffer is divided into four pieces, one for each Tx queue.
      Currently, 8KB are given to each of the two SR queues and 4KB are given
      to each of the two SP queues.
      
      However, it was noticed that such distribution can make best effort
      traffic (which would usually go to the SP queues when Qav is enabled, as
      the SR queues would be used by ETF or CBS qdiscs for TSN-aware traffic)
      perform poorly. Using iperf3 to measure, one could see the performance
      of best effort traffic drop by nearly a third (from 935Mbps to 578Mbps),
      with no TSN traffic competing.
      
      This patch redistributes the 24KB to each queue equally: 6KB each. On
      tests, there was no notable performance reduction of best effort traffic
      performance when there was no TSN traffic competing.
      
      Below, more details about the data collected:
      
      All experiments were run using the following qdisc setup:
      
      qdisc taprio 100: root refcnt 9 tc 4 map 3 3 3 2 3 0 0 3 3 3 3 3 3 3 3 3
          queues offset 0 count 1 offset 1 count 1 offset 2 count 1 offset 3 count 1
          clockid TAI base-time 0 cycle-time 10000000 cycle-time-extension 0
          index 0 cmd S gatemask 0xf interval 10000000
      
      qdisc etf 8045: parent 100:1 clockid TAI delta 1000000 offload on
          deadline_mode off skip_sock_check off
      
      TSN traffic, when enabled, had this characteristics:
       Packet size: 1500 bytes
       Transmission interval: 125us
      
      ----------------------------------
      Without this patch:
      ----------------------------------
      - TCP data:
          - No TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  1.35 GBytes   578 Mbits/sec    0
      
          - With TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  1.07 GBytes   460 Mbits/sec    1
      
      - TCP data limiting iperf3 buffer size to 4K:
          - No TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  1.35 GBytes   579 Mbits/sec    0
      
          - With TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  1.08 GBytes   462 Mbits/sec    0
      
      - TCP data limiting iperf3 buffer size to 192 bytes (smallest size without
       serious performance degradation):
          - No TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  1.34 GBytes   577 Mbits/sec    0
      
          - With TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  1.07 GBytes   461 Mbits/sec    1
      
      - UDP data at 1000Mbit/sec:
          - No TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
              [  5]   0.00-20.00  sec  1.36 GBytes   586 Mbits/sec  0.000 ms  0/1011407 (0%)
      
          - With TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
              [  5]   0.00-20.00  sec  1.05 GBytes   451 Mbits/sec  0.000 ms  0/778672 (0%)
      
      ----------------------------------
      With this patch:
      ----------------------------------
      
      - TCP data:
          - No TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  2.17 GBytes   932 Mbits/sec    0
      
          - With TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  1.50 GBytes   646 Mbits/sec    1
      
      - TCP data limiting iperf3 buffer size to 4K:
          - No TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  2.17 GBytes   931 Mbits/sec    0
      
          - With TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  1.50 GBytes   645 Mbits/sec    0
      
      - TCP data limiting iperf3 buffer size to 192 bytes (smallest size without
       serious performance degradation):
          - No TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  2.17 GBytes   932 Mbits/sec    1
      
          - With TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Retr
              [  5]   0.00-20.00  sec  1.50 GBytes   645 Mbits/sec    0
      
      - UDP data at 1000Mbit/sec:
          - No TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
              [  5]   0.00-20.00  sec  2.23 GBytes   956 Mbits/sec  0.000 ms  0/1650226 (0%)
      
          - With TSN traffic:
              [ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
              [  5]   0.00-20.00  sec  1.51 GBytes   649 Mbits/sec  0.000 ms  0/1120264 (0%)
      Signed-off-by: default avatarEderson de Souza <ederson.desouza@intel.com>
      Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      26b67f5a
    • David S. Miller's avatar
      Merge branch 'ehtool-fec-stats' · 392c36e5
      David S. Miller authored
      Jakub Kicinski says:
      
      ====================
      ethtool: add standard FEC statistics
      
      This set adds uAPI for reporting standard FEC statistics, and
      implements it in a handful of drivers.
      
      The statistics are taken from the IEEE standard, with one
      extra seemingly popular but not standard statistics added.
      
      The implementation is similar to that of the pause frame
      statistics, user requests the stats by setting a bit
      (ETHTOOL_FLAG_STATS) in the common ethtool header of
      ETHTOOL_MSG_FEC_GET.
      
      Since standard defines the statistics per lane what's
      reported is both total and per-lane counters:
      
       # ethtool -I --show-fec eth0
       FEC parameters for eth0:
       Configured FEC encodings: None
       Active FEC encoding: None
       Statistics:
        corrected_blocks: 256
          Lane 0: 255
          Lane 1: 1
        uncorrectable_blocks: 145
          Lane 0: 128
          Lane 1: 17
      
      v2: check for errors in mlx5 register access
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      392c36e5
    • Jakub Kicinski's avatar
      mlx5: implement ethtool::get_fec_stats · 1703bb50
      Jakub Kicinski authored
      Report corrected bits.
      
      v2: catch reg access errors (Saeed)
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Acked-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1703bb50
    • Jakub Kicinski's avatar
      sfc: ef10: implement ethtool::get_fec_stats · cab351be
      Jakub Kicinski authored
      Report what appears to be the standard block counts:
       - 30.5.1.1.17 aFECCorrectedBlocks
       - 30.5.1.1.18 aFECUncorrectableBlocks
      
      Don't report the per-lane symbol counts, if those really
      count symbols they are not what the standard calls for
      (even if symbols seem like the most useful thing to count.)
      
      Fingers crossed that fec_corrected_errors is not in symbols.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cab351be
    • Jakub Kicinski's avatar
      bnxt: implement ethtool::get_fec_stats · c9ca5c3a
      Jakub Kicinski authored
      Report corrected bits.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c9ca5c3a
    • Jakub Kicinski's avatar
      ethtool: add FEC statistics · be85dbfe
      Jakub Kicinski authored
      Similarly to pause statistics add stats for FEC.
      
      The IEEE standard mandates two sets of counters:
       - 30.5.1.1.17 aFECCorrectedBlocks
       - 30.5.1.1.18 aFECUncorrectableBlocks
      where block is a block of bits FEC operates on.
      Each of these counters is defined per lane (PCS instance).
      
      Multiple vendors provide number of corrected _bits_ rather
      than/as well as blocks.
      
      This set adds the 2 standard-based block counters and a extra
      one for corrected bits.
      
      Counters are exposed to user space via netlink in new attributes.
      Each attribute carries an array of u64s, first element is
      the total count, and the following ones are a per-lane break down.
      
      Much like with pause stats the operation will not fail when driver
      does not implement the get_fec_stats callback (nor can the driver
      fail the operation by returning an error). If stats can't be
      reported the relevant attributes will be empty.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be85dbfe
    • Jakub Kicinski's avatar
      ethtool: fec_prepare_data() - jump to error handling · 3d7cc109
      Jakub Kicinski authored
      Refactor fec_prepare_data() a little bit to skip the body
      of the function and exit on error. Currently the code
      depends on the fact that we only have one call which
      may fail between ethnl_ops_begin() and ethnl_ops_complete()
      and simply saves the error code. This will get hairy with
      the stats also being queried.
      
      No functional changes.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d7cc109
    • Jakub Kicinski's avatar
      ethtool: move ethtool_stats_init · c5797f8a
      Jakub Kicinski authored
      We'll need it for FEC stats as well.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c5797f8a
    • Eric Dumazet's avatar
      scm: optimize put_cmsg() · 38ebcf50
      Eric Dumazet authored
      Calling two copy_to_user() for very small regions has very high overhead.
      
      Switch to inlined unsafe_put_user() to save one stac/clac sequence,
      and avoid copy_to_user().
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Soheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38ebcf50
  2. 15 Apr, 2021 21 commits
  3. 14 Apr, 2021 8 commits