--- /dev/null
+
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2021 Marvell.
+ */
+
+#include <unistd.h>
+
+#include "cnxk_telemetry.h"
+#include "roc_api.h"
+#include "roc_priv.h"
+
+static int
+cnxk_tel_sso(struct plt_tel_data *d)
+{
+ struct roc_sso *roc_sso;
+ struct sso *sso;
+
+ roc_sso = idev_sso_get();
+ if (roc_sso == NULL)
+ return SSO_ERR_DEVICE_NOT_BOUNDED;
+
+ sso = roc_sso_to_sso_priv(roc_sso);
+ plt_tel_data_add_dict_ptr(d, "roc_sso", roc_sso);
+ plt_tel_data_add_dict_ptr(d, "sso", sso);
+ plt_tel_data_add_dict_int(d, "max_hws", roc_sso->max_hws);
+ plt_tel_data_add_dict_int(d, "max_hwgrp", roc_sso->max_hwgrp);
+ plt_tel_data_add_dict_int(d, "nb_hws", roc_sso->nb_hws);
+ plt_tel_data_add_dict_int(d, "nb_hwgrp", roc_sso->nb_hwgrp);
+ plt_tel_data_add_dict_int(d, "pf_func", sso->dev.pf_func);
+ plt_tel_data_add_dict_int(d, "pid", getpid());
+
+ return 0;
+}
+
+static int
+cnxk_sso_tel_handle_info(const char *cmd __plt_unused,
+ const char *params __plt_unused,
+ struct plt_tel_data *d)
+{
+ plt_tel_data_start_dict(d);
+ cnxk_tel_sso(d);
+ return 0;
+}
+
+PLT_INIT(cnxk_telemetry_sso_init)
+{
+ plt_telemetry_register_cmd(
+ "/cnxk/sso/info", cnxk_sso_tel_handle_info,
+ "Returns sso information. Takes no parameters");
+}
# Telemetry common code
sources += files('cnxk_telemetry_bphy.c',
'cnxk_telemetry_npa.c',
- 'cnxk_telemetry_nix.c')
+ 'cnxk_telemetry_nix.c',
+ 'cnxk_telemetry_sso.c',
+)
deps += ['bus_pci', 'net', 'telemetry']
dev = container_of(npa_lf, struct dev, npa);
return dev->roc_nix;
}
+
+struct roc_sso *
+idev_sso_get(void)
+{
+ struct idev_cfg *idev = idev_get_cfg();
+
+ if (idev != NULL)
+ return __atomic_load_n(&idev->sso, __ATOMIC_ACQUIRE);
+
+ return NULL;
+}
+
+void
+idev_sso_set(struct roc_sso *sso)
+{
+ struct idev_cfg *idev = idev_get_cfg();
+
+ if (idev != NULL)
+ __atomic_store_n(&idev->sso, sso, __ATOMIC_RELEASE);
+}
uint64_t lmt_base_addr;
struct roc_bphy *bphy;
struct roc_cpt *cpt;
+ struct roc_sso *sso;
struct nix_inl_dev *nix_inl_dev;
plt_spinlock_t nix_inl_dev_lock;
};
/* idev sso */
void idev_sso_pffunc_set(uint16_t sso_pf_func);
uint16_t idev_sso_pffunc_get(void);
+struct roc_sso *idev_sso_get(void);
+void idev_sso_set(struct roc_sso *sso);
/* idev lmt */
uint16_t idev_lmt_pffunc_get(void);