netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] mlxsw: Add support of latency TLV
@ 2023-01-19 10:32 Petr Machata
  2023-01-19 10:32 ` [PATCH net-next 1/6] mlxsw: reg: Add TLV related fields to MGIR register Petr Machata
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Petr Machata @ 2023-01-19 10:32 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev
  Cc: Ido Schimmel, Petr Machata, Amit Cohen, Danielle Ratson, mlxsw

Amit Cohen writes:

Ethernet Management Datagrams (EMADs) are Ethernet packets sent between
the driver and device's firmware. They are used to pass various
configurations to the device, but also to get events (e.g., port up)
from it. After the Ethernet header, these packets are built in a TLV
format.

This is the structure of EMADs:
* Ethernet header
* Operation TLV
* String TLV (optional)
* Latency TLV (optional)
* Reg TLV
* End TLV

The latency of each EMAD is measured by firmware. The driver can get the
measurement via latency TLV which can be added to each EMAD. This TLV is
optional, when EMAD is sent with this TLV, the EMAD's response will include
the TLV and will contain the firmware measurement.

Add support for Latency TLV and use it by default for all EMADs (see
more information in commit messages). The latency measurements can be
processed using BPF program for example, to create a histogram and average
of the latency per register. In addition, it is possible to measure the
end-to-end latency, so then the latency of the software overhead can be
calculated. This information can be useful to improve the driver
performance.

See an example of output of BPF tool which presents these measurements:

$ ./emadlatency -f -a
    Tracing EMADs... Hit Ctrl-C to end.
    Register write = RALUE (0x8013)
    E2E Measurements:
    average = 23 usecs, total = 32052693 usecs, count = 1337061
         usecs               : count    distribution
             0 -> 1          : 0        |                                 |
             2 -> 3          : 0        |                                 |
             4 -> 7          : 0        |                                 |
             8 -> 15         : 0        |                                 |
            16 -> 31         : 1290814  |*********************************|
            32 -> 63         : 45339    |*                                |
            64 -> 127        : 532      |                                 |
           128 -> 255        : 247      |                                 |
           256 -> 511        : 57       |                                 |
           512 -> 1023       : 26       |                                 |
          1024 -> 2047       : 33       |                                 |
          2048 -> 4095       : 0        |                                 |
          4096 -> 8191       : 10       |                                 |
          8192 -> 16383      : 1        |                                 |
         16384 -> 32767      : 1        |                                 |
         32768 -> 65535      : 1        |                                 |

    Firmware Measurements:
    average = 10 usecs, total = 13884128 usecs, count = 1337061
         usecs               : count    distribution
             0 -> 1          : 0        |                                 |
             2 -> 3          : 0        |                                 |
             4 -> 7          : 0        |                                 |
             8 -> 15         : 1337035  |*********************************|
            16 -> 31         : 17       |                                 |
            32 -> 63         : 7        |                                 |
            64 -> 127        : 0        |                                 |
           128 -> 255        : 2        |                                 |

    Diff between measurements: 13 usecs

Patch set overview:
Patches #1-#3 add support for querying MGIR, to know if string TLV and
latency TLV are supported
Patches #4-#5 add some relevant fields to support latency TLV
Patch #6 adds support of latency TLV

Amit Cohen (6):
  mlxsw: reg: Add TLV related fields to MGIR register
  mlxsw: Enable string TLV usage according to MGIR output
  mlxsw: core: Do not worry about changing 'enable_string_tlv' while
    sending EMADs
  mlxsw: emad: Add support for latency TLV
  mlxsw: core: Define latency TLV fields
  mlxsw: Add support of latency TLV

 drivers/net/ethernet/mellanox/mlxsw/core.c    | 108 ++++++++++++++----
 drivers/net/ethernet/mellanox/mlxsw/core.h    |   2 -
 drivers/net/ethernet/mellanox/mlxsw/emad.h    |   4 +
 drivers/net/ethernet/mellanox/mlxsw/reg.h     |  12 ++
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |   1 -
 5 files changed, 103 insertions(+), 24 deletions(-)

-- 
2.39.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-01-21  3:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-19 10:32 [PATCH net-next 0/6] mlxsw: Add support of latency TLV Petr Machata
2023-01-19 10:32 ` [PATCH net-next 1/6] mlxsw: reg: Add TLV related fields to MGIR register Petr Machata
2023-01-19 10:32 ` [PATCH net-next 2/6] mlxsw: Enable string TLV usage according to MGIR output Petr Machata
2023-01-19 10:32 ` [PATCH net-next 3/6] mlxsw: core: Do not worry about changing 'enable_string_tlv' while sending EMADs Petr Machata
2023-01-19 10:32 ` [PATCH net-next 4/6] mlxsw: emad: Add support for latency TLV Petr Machata
2023-01-19 10:32 ` [PATCH net-next 5/6] mlxsw: core: Define latency TLV fields Petr Machata
2023-01-19 10:32 ` [PATCH net-next 6/6] mlxsw: Add support of latency TLV Petr Machata
2023-01-20  1:18 ` [PATCH net-next 0/6] " Tony Nguyen
2023-01-21  3:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).