raw/cnxk_bphy: support telemetry
Added /cnxk/bphy/info telemetry endpoint. Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
parent
94f746aa66
commit
7ce1032edb
52
drivers/common/cnxk/cnxk_telemetry_bphy.c
Normal file
52
drivers/common/cnxk/cnxk_telemetry_bphy.c
Normal file
@ -0,0 +1,52 @@
|
||||
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright(C) 2021 Marvell.
|
||||
*/
|
||||
|
||||
#include "cnxk_telemetry.h"
|
||||
#include "roc_api.h"
|
||||
#include "roc_priv.h"
|
||||
|
||||
static int
|
||||
cnxk_tel_bphy(struct plt_tel_data *d)
|
||||
{
|
||||
struct idev_cfg *idev;
|
||||
|
||||
idev = idev_get_cfg();
|
||||
if (!idev || !idev->bphy)
|
||||
return -ENODEV;
|
||||
|
||||
plt_tel_data_add_dict_int(d, "sso_pf_func", roc_bphy_sso_pf_func_get());
|
||||
plt_tel_data_add_dict_int(d, "npa_pf_func", roc_bphy_npa_pf_func_get());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
cnxk_bphy_tel_handle_info(const char *cmd __plt_unused,
|
||||
const char *params __plt_unused,
|
||||
struct plt_tel_data *d)
|
||||
{
|
||||
plt_tel_data_start_dict(d);
|
||||
|
||||
return cnxk_tel_bphy(d);
|
||||
}
|
||||
|
||||
static int
|
||||
cnxk_bphy_telemetry_register(void)
|
||||
{
|
||||
if (!(roc_model->flag & ROC_MODEL_CNF9K) &&
|
||||
!(roc_model->flag & ROC_MODEL_CNF10K))
|
||||
return 0;
|
||||
|
||||
plt_telemetry_register_cmd(
|
||||
"/cnxk/bphy/info", cnxk_bphy_tel_handle_info,
|
||||
"Returns bphy information. Takes no parameters");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PLT_INIT(cnxk_telemetry_bphy_init)
|
||||
{
|
||||
roc_plt_init_cb_register(cnxk_bphy_telemetry_register);
|
||||
}
|
@ -74,7 +74,8 @@ includes += include_directories('../../../lib/ethdev')
|
||||
includes += include_directories('../../../lib/meter')
|
||||
|
||||
# Telemetry common code
|
||||
sources += files('cnxk_telemetry_npa.c',
|
||||
sources += files('cnxk_telemetry_bphy.c',
|
||||
'cnxk_telemetry_npa.c',
|
||||
'cnxk_telemetry_nix.c')
|
||||
|
||||
deps += ['bus_pci', 'net', 'telemetry']
|
||||
|
@ -40,12 +40,17 @@ struct roc_model {
|
||||
ROC_MODEL_CNF95xx_B0 | ROC_MODEL_CNF95xxMM_A0 | \
|
||||
ROC_MODEL_CNF95xxO_A0 | ROC_MODEL_CNF95xxN_A0 | ROC_MODEL_CN98xx_A0 | \
|
||||
ROC_MODEL_CNF95xxN_A1)
|
||||
#define ROC_MODEL_CNF9K \
|
||||
(ROC_MODEL_CNF95xx_A0 | ROC_MODEL_CNF95xx_B0 | \
|
||||
ROC_MODEL_CNF95xxMM_A0 | ROC_MODEL_CNF95xxO_A0 | \
|
||||
ROC_MODEL_CNF95xxN_A0 | ROC_MODEL_CNF95xxN_A1)
|
||||
|
||||
#define ROC_MODEL_CN106xx (ROC_MODEL_CN106xx_A0)
|
||||
#define ROC_MODEL_CNF105xx (ROC_MODEL_CNF105xx_A0)
|
||||
#define ROC_MODEL_CNF105xxN (ROC_MODEL_CNF105xxN_A0)
|
||||
#define ROC_MODEL_CN10K \
|
||||
(ROC_MODEL_CN106xx | ROC_MODEL_CNF105xx | ROC_MODEL_CNF105xxN)
|
||||
#define ROC_MODEL_CNF10K (ROC_MODEL_CNF105xx | ROC_MODEL_CNF105xxN)
|
||||
|
||||
/* Runtime variants */
|
||||
static inline uint64_t
|
||||
|
@ -341,6 +341,13 @@ bphy_rawdev_probe(struct rte_pci_driver *pci_drv,
|
||||
bphy_dev = (struct bphy_device *)bphy_rawdev->dev_private;
|
||||
bphy_dev->mem.res0 = pci_dev->mem_resource[0];
|
||||
bphy_dev->mem.res2 = pci_dev->mem_resource[2];
|
||||
bphy_dev->bphy.pci_dev = pci_dev;
|
||||
|
||||
ret = roc_bphy_dev_init(&bphy_dev->bphy);
|
||||
if (ret) {
|
||||
rte_rawdev_pmd_release(bphy_rawdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -349,6 +356,7 @@ static int
|
||||
bphy_rawdev_remove(struct rte_pci_device *pci_dev)
|
||||
{
|
||||
char name[RTE_RAWDEV_NAME_MAX_LEN];
|
||||
struct bphy_device *bphy_dev;
|
||||
struct rte_rawdev *rawdev;
|
||||
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
@ -366,6 +374,9 @@ bphy_rawdev_remove(struct rte_pci_device *pci_dev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bphy_dev = (struct bphy_device *)rawdev->dev_private;
|
||||
roc_bphy_dev_fini(&bphy_dev->bphy);
|
||||
|
||||
return rte_rawdev_pmd_release(rawdev);
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ struct bphy_irq_queue {
|
||||
|
||||
struct bphy_device {
|
||||
#define BPHY_QUEUE_CNT 1
|
||||
struct roc_bphy bphy;
|
||||
struct roc_bphy_irq_chip *irq_chip;
|
||||
struct bphy_mem mem;
|
||||
/* bphy irq interface supports single queue only */
|
||||
|
Loading…
x
Reference in New Issue
Block a user