DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: Robin Zhang <robinx.zhang@intel.com>, dev@dpdk.org
Cc: thomas@monjalon.net, kevinx.liu@intel.com
Subject: Re: [PATCH v8 4/5] ethdev: format module EEPROM for SFF-8472
Date: Wed, 25 May 2022 14:58:33 +0300	[thread overview]
Message-ID: <335badf5-1436-75ec-7495-2fde1a75d8c5@oktetlabs.ru> (raw)
In-Reply-To: <20220525031446.72578-5-robinx.zhang@intel.com>

On 5/25/22 06:14, Robin Zhang wrote:
> This patch implements format module EEPROM information for
> SFF-8472 Rev 12.0
> 
> Signed-off-by: Robin Zhang <robinx.zhang@intel.com>

[snip]

> diff --git a/lib/ethdev/sff_8472.c b/lib/ethdev/sff_8472.c
> new file mode 100644
> index 0000000000..98e31e9262
> --- /dev/null
> +++ b/lib/ethdev/sff_8472.c
> @@ -0,0 +1,286 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2022 Intel Corporation
> + *
> + * Implements SFF-8472 optics diagnostics.
> + *
> + */
> +
> +#include <stdio.h>
> +#include <math.h>
> +#include <rte_mbuf.h>
> +#include <rte_ethdev.h>
> +#include <rte_flow.h>
> +#include "sff_common.h"
> +#include "ethdev_sff_telemetry.h"

Please, fix includes in accordance with previous patches
review notes.

> +
> +/* Offsets in decimal, for direct comparison with the SFF specs */
> +
> +/* A0-based EEPROM offsets for DOM support checks */
> +#define SFF_A0_DOM                        92
> +#define SFF_A0_OPTIONS                    93
> +#define SFF_A0_COMP                       94
> +
> +/* EEPROM bit values for various registers */
> +#define SFF_A0_DOM_EXTCAL                 (1 << 4)
> +#define SFF_A0_DOM_INTCAL                 (1 << 5)
> +#define SFF_A0_DOM_IMPL                   (1 << 6)
> +#define SFF_A0_DOM_PWRT                   (1 << 3)
> +
> +#define SFF_A0_OPTIONS_AW                 (1 << 7)

RTE_BIT32 ?

> +
> +/*
> + * This is the offset at which the A2 page is in the EEPROM
> + * blob returned by the kernel.
> + */
> +#define SFF_A2_BASE                       0x100
> +
> +/* A2-based offsets for DOM */
> +#define SFF_A2_TEMP                       96
> +#define SFF_A2_TEMP_HALRM                 0
> +#define SFF_A2_TEMP_LALRM                 2
> +#define SFF_A2_TEMP_HWARN                 4
> +#define SFF_A2_TEMP_LWARN                 6
> +
> +#define SFF_A2_VCC                        98
> +#define SFF_A2_VCC_HALRM                  8
> +#define SFF_A2_VCC_LALRM                  10
> +#define SFF_A2_VCC_HWARN                  12
> +#define SFF_A2_VCC_LWARN                  14
> +
> +#define SFF_A2_BIAS                       100
> +#define SFF_A2_BIAS_HALRM                 16
> +#define SFF_A2_BIAS_LALRM                 18
> +#define SFF_A2_BIAS_HWARN                 20
> +#define SFF_A2_BIAS_LWARN                 22
> +
> +#define SFF_A2_TX_PWR                     102
> +#define SFF_A2_TX_PWR_HALRM               24
> +#define SFF_A2_TX_PWR_LALRM               26
> +#define SFF_A2_TX_PWR_HWARN               28
> +#define SFF_A2_TX_PWR_LWARN               30
> +
> +#define SFF_A2_RX_PWR                     104
> +#define SFF_A2_RX_PWR_HALRM               32
> +#define SFF_A2_RX_PWR_LALRM               34
> +#define SFF_A2_RX_PWR_HWARN               36
> +#define SFF_A2_RX_PWR_LWARN               38
> +
> +#define SFF_A2_ALRM_FLG                   112
> +#define SFF_A2_WARN_FLG                   116
> +
> +/* 32-bit little-endian calibration constants */
> +#define SFF_A2_CAL_RXPWR4                 56
> +#define SFF_A2_CAL_RXPWR3                 60
> +#define SFF_A2_CAL_RXPWR2                 64
> +#define SFF_A2_CAL_RXPWR1                 68
> +#define SFF_A2_CAL_RXPWR0                 72
> +
> +/* 16-bit little endian calibration constants */
> +#define SFF_A2_CAL_TXI_SLP                76
> +#define SFF_A2_CAL_TXI_OFF                78
> +#define SFF_A2_CAL_TXPWR_SLP              80
> +#define SFF_A2_CAL_TXPWR_OFF              82
> +#define SFF_A2_CAL_T_SLP                  84
> +#define SFF_A2_CAL_T_OFF                  86
> +#define SFF_A2_CAL_V_SLP                  88
> +#define SFF_A2_CAL_V_OFF                  90
> +
> +static struct sff_8472_aw_flags {
> +	const char *str;        /* Human-readable string, null at the end */
> +	int offset;             /* A2-relative address offset */
> +	uint8_t value;          /* Alarm is on if (offset & value) != 0. */
> +} sff_8472_aw_flags[] = {
> +	{ "Laser bias current high alarm",   SFF_A2_ALRM_FLG, (1 << 3) },

RTE_BIT32 here and below?

> +	{ "Laser bias current low alarm",    SFF_A2_ALRM_FLG, (1 << 2) },
> +	{ "Laser bias current high warning", SFF_A2_WARN_FLG, (1 << 3) },
> +	{ "Laser bias current low warning",  SFF_A2_WARN_FLG, (1 << 2) },
> +
> +	{ "Laser output power high alarm",   SFF_A2_ALRM_FLG, (1 << 1) },
> +	{ "Laser output power low alarm",    SFF_A2_ALRM_FLG, (1 << 0) },
> +	{ "Laser output power high warning", SFF_A2_WARN_FLG, (1 << 1) },
> +	{ "Laser output power low warning",  SFF_A2_WARN_FLG, (1 << 0) },
> +
> +	{ "Module temperature high alarm",   SFF_A2_ALRM_FLG, (1 << 7) },
> +	{ "Module temperature low alarm",    SFF_A2_ALRM_FLG, (1 << 6) },
> +	{ "Module temperature high warning", SFF_A2_WARN_FLG, (1 << 7) },
> +	{ "Module temperature low warning",  SFF_A2_WARN_FLG, (1 << 6) },
> +
> +	{ "Module voltage high alarm",   SFF_A2_ALRM_FLG, (1 << 5) },
> +	{ "Module voltage low alarm",    SFF_A2_ALRM_FLG, (1 << 4) },
> +	{ "Module voltage high warning", SFF_A2_WARN_FLG, (1 << 5) },
> +	{ "Module voltage low warning",  SFF_A2_WARN_FLG, (1 << 4) },
> +
> +	{ "Laser rx power high alarm",   SFF_A2_ALRM_FLG + 1, (1 << 7) },
> +	{ "Laser rx power low alarm",    SFF_A2_ALRM_FLG + 1, (1 << 6) },
> +	{ "Laser rx power high warning", SFF_A2_WARN_FLG + 1, (1 << 7) },
> +	{ "Laser rx power low warning",  SFF_A2_WARN_FLG + 1, (1 << 6) },
> +
> +	{ NULL, 0, 0 },
> +};



  reply	other threads:[~2022-05-25 11:58 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 10:18 [PATCH] app/testpmd: format dump information of module EEPROM Robin Zhang
2022-02-15 13:28 ` Ferruh Yigit
2022-02-15 15:07   ` Thomas Monjalon
2022-02-16  2:26     ` Zhang, RobinX
2022-02-16  8:03       ` David Marchand
2022-02-16  8:45         ` Thomas Monjalon
2022-02-16  9:30           ` Bruce Richardson
2022-02-16  9:41             ` David Marchand
2022-02-16 10:02               ` Bruce Richardson
2022-02-16 10:15                 ` David Marchand
2022-04-08 10:23 ` [PATCH v2] common/sff_module: add telemetry command to dump " Robin Zhang
2022-04-08 10:33   ` Bruce Richardson
2022-04-08 10:55     ` Zhang, RobinX
2022-04-08 11:00       ` Bruce Richardson
2022-04-08 11:20         ` Zhang, RobinX
2022-04-08 11:26           ` Bruce Richardson
2022-04-11  8:13             ` Zhang, RobinX
2022-04-11  9:13               ` Bruce Richardson
2022-04-13 12:13                 ` Thomas Monjalon
2022-04-14  7:41                   ` David Marchand
2022-04-20  7:00 ` [PATCH v3 0/5] add telemetry command for show " Robin Zhang
2022-04-20  7:00   ` [PATCH v3 1/5] ethdev: add telemetry command for " Robin Zhang
2022-04-20  9:16     ` Andrew Rybchenko
2022-04-20  7:00   ` [PATCH v3 2/5] ethdev: common utilities for different SFF specs Robin Zhang
2022-04-20  7:00   ` [PATCH v3 3/5] ethdev: format module EEPROM for SFF-8079 Robin Zhang
2022-04-20  7:00   ` [PATCH v3 4/5] ethdev: format module EEPROM for SFF-8472 Robin Zhang
2022-04-20  7:00   ` [PATCH v3 5/5] ethdev: format module EEPROM for SFF-8636 Robin Zhang
2022-04-20  8:49   ` [PATCH v3 0/5] add telemetry command for show module EEPROM Morten Brørup
2022-04-25  5:34 ` [PATCH v4 " Robin Zhang
2022-04-25  5:34   ` [PATCH v4 1/5] ethdev: add telemetry command for " Robin Zhang
2022-04-25  5:34   ` [PATCH v4 2/5] ethdev: common utilities for different SFF specs Robin Zhang
2022-04-25  5:34   ` [PATCH v4 3/5] ethdev: format module EEPROM for SFF-8079 Robin Zhang
2022-04-25  5:34   ` [PATCH v4 4/5] ethdev: format module EEPROM for SFF-8472 Robin Zhang
2022-04-25  5:34   ` [PATCH v4 5/5] ethdev: format module EEPROM for SFF-8636 Robin Zhang
2022-04-26  2:43 ` [PATCH v5 0/5] add telemetry command for show module EEPROM Robin Zhang
2022-04-26  2:43   ` [PATCH v5 1/5] ethdev: add telemetry command for " Robin Zhang
2022-05-04 10:16     ` Andrew Rybchenko
2022-04-26  2:43   ` [PATCH v5 2/5] ethdev: common utilities for different SFF specs Robin Zhang
2022-04-26  2:43   ` [PATCH v5 3/5] ethdev: format module EEPROM for SFF-8079 Robin Zhang
2022-04-26  2:43   ` [PATCH v5 4/5] ethdev: format module EEPROM for SFF-8472 Robin Zhang
2022-04-26  2:43   ` [PATCH v5 5/5] ethdev: format module EEPROM for SFF-8636 Robin Zhang
2022-05-04  8:13   ` [PATCH v5 0/5] add telemetry command for show module EEPROM Andrew Rybchenko
2022-05-11  2:14   ` [PATCH v6 " Robin Zhang
2022-05-11  2:14     ` [PATCH v6 1/5] ethdev: add telemetry command for " Robin Zhang
2022-05-11  2:14     ` [PATCH v6 2/5] ethdev: common utilities for different SFF specs Robin Zhang
2022-05-11  2:14     ` [PATCH v6 3/5] ethdev: format module EEPROM for SFF-8079 Robin Zhang
2022-05-11  2:14     ` [PATCH v6 4/5] ethdev: format module EEPROM for SFF-8472 Robin Zhang
2022-05-19  8:33       ` Andrew Rybchenko
2022-05-11  2:14     ` [PATCH v6 5/5] ethdev: format module EEPROM for SFF-8636 Robin Zhang
2022-05-24  6:24     ` [PATCH v7 0/5] add telemetry command for show module EEPROM Robin Zhang
2022-05-24  6:24       ` [PATCH v7 1/5] ethdev: add telemetry command for " Robin Zhang
2022-05-24  6:24       ` [PATCH v7 2/5] ethdev: common utilities for different SFF specs Robin Zhang
2022-05-24  6:24       ` [PATCH v7 3/5] ethdev: format module EEPROM for SFF-8079 Robin Zhang
2022-05-24  6:24       ` [PATCH v7 4/5] ethdev: format module EEPROM for SFF-8472 Robin Zhang
2022-05-24  6:24       ` [PATCH v7 5/5] ethdev: format module EEPROM for SFF-8636 Robin Zhang
2022-05-24  9:03         ` David Marchand
2022-05-25  2:43           ` Zhang, RobinX
2022-05-25  3:14       ` [PATCH v8 0/5] add telemetry command for show module EEPROM Robin Zhang
2022-05-25  3:14         ` [PATCH v8 1/5] ethdev: add telemetry command for " Robin Zhang
2022-05-25  9:24           ` Andrew Rybchenko
2022-05-25  3:14         ` [PATCH v8 2/5] ethdev: common utilities for different SFF specs Robin Zhang
2022-05-25  8:51           ` Andrew Rybchenko
2022-05-25  9:40           ` Andrew Rybchenko
2022-05-25  3:14         ` [PATCH v8 3/5] ethdev: format module EEPROM for SFF-8079 Robin Zhang
2022-05-25  9:55           ` Andrew Rybchenko
2022-05-25  3:14         ` [PATCH v8 4/5] ethdev: format module EEPROM for SFF-8472 Robin Zhang
2022-05-25 11:58           ` Andrew Rybchenko [this message]
2022-05-25  3:14         ` [PATCH v8 5/5] ethdev: format module EEPROM for SFF-8636 Robin Zhang
2022-05-25  9:01           ` Andrew Rybchenko
2022-05-25 12:01           ` Andrew Rybchenko
2022-05-26  7:32         ` [PATCH v9 0/5] add telemetry command for show module EEPROM Robin Zhang
2022-05-26  7:32           ` [PATCH v9 1/5] ethdev: add telemetry command for " Robin Zhang
2022-05-26  7:32           ` [PATCH v9 2/5] ethdev: add common code for different SFF specs Robin Zhang
2022-05-26  7:32           ` [PATCH v9 3/5] ethdev: support SFF-8079 module information telemetry Robin Zhang
2022-05-26  7:32           ` [PATCH v9 4/5] ethdev: support SFF-8472 " Robin Zhang
2022-05-26  7:32           ` [PATCH v9 5/5] ethdev: support SFF-8636 " Robin Zhang
2022-05-31 14:43           ` [PATCH v9 0/5] add telemetry command for show module EEPROM Andrew Rybchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=335badf5-1436-75ec-7495-2fde1a75d8c5@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=kevinx.liu@intel.com \
    --cc=robinx.zhang@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).