Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(C) 2021 Marvell. 3 : : */ 4 : : 5 : : #include <unistd.h> 6 : : 7 : : #include "cnxk_telemetry.h" 8 : : #include "roc_api.h" 9 : : #include "roc_priv.h" 10 : : 11 : : static int 12 : 3 : cnxk_tel_sso(struct plt_tel_data *d) 13 : : { 14 : : struct roc_sso *roc_sso; 15 : : struct sso *sso; 16 : : 17 : 3 : roc_sso = idev_sso_get(); 18 [ - + ]: 3 : if (roc_sso == NULL) 19 : : return SSO_ERR_DEVICE_NOT_BOUNDED; 20 : : 21 : : sso = roc_sso_to_sso_priv(roc_sso); 22 : 0 : plt_tel_data_add_dict_ptr(d, "roc_sso", roc_sso); 23 : 0 : plt_tel_data_add_dict_ptr(d, "sso", sso); 24 : 0 : plt_tel_data_add_dict_int(d, "max_hws", roc_sso->max_hws); 25 : 0 : plt_tel_data_add_dict_int(d, "max_hwgrp", roc_sso->max_hwgrp); 26 : 0 : plt_tel_data_add_dict_int(d, "nb_hws", roc_sso->nb_hws); 27 : 0 : plt_tel_data_add_dict_int(d, "nb_hwgrp", roc_sso->nb_hwgrp); 28 : 0 : plt_tel_data_add_dict_int(d, "pf_func", sso->dev.pf_func); 29 : 0 : plt_tel_data_add_dict_int(d, "pid", getpid()); 30 : : 31 : 0 : return 0; 32 : : } 33 : : 34 : : static int 35 : 3 : cnxk_sso_tel_handle_info(const char *cmd __plt_unused, 36 : : const char *params __plt_unused, 37 : : struct plt_tel_data *d) 38 : : { 39 : 3 : plt_tel_data_start_dict(d); 40 : 3 : cnxk_tel_sso(d); 41 : 3 : return 0; 42 : : } 43 : : 44 : 254 : PLT_INIT(cnxk_telemetry_sso_init) 45 : : { 46 : 254 : plt_telemetry_register_cmd( 47 : : "/cnxk/sso/info", cnxk_sso_tel_handle_info, 48 : : "Returns sso information. Takes no parameters"); 49 : 254 : }