osi: core: Update ethernet stats to VF osi core

Issue:
When the ethernet server got enabled,
OSI core stats are not getting
updated to VF's.

Fix:
Add IOCTL to copy OSI core stats
into VF's OSI core structure.

Bug 3763499

Change-Id: Ib0a957ff90805b7e716d8f5994e0a65d63660c1e
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2808680
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Mohan Thadikamalla
2022-11-14 15:10:14 +05:30
committed by mobile promotions
parent 9597f795e4
commit 2ac6b6f645
8 changed files with 115 additions and 142 deletions

View File

@@ -35,14 +35,6 @@
*/
#define MAX_ARGS 10
/*
*@brief All Stats
*/
struct osi_stats {
struct osi_mmc_counters mmc_s;
struct osi_tsn_stats tsn_s;
};
/**
* @brief IVC commands between OSD & OSI.
*/
@@ -151,13 +143,13 @@ typedef struct ivc_msg_common {
/** OSI HW features */
struct osi_hw_features hw_feat;
/** MMC counters */
struct osi_mmc_counters mmc;
struct osi_mmc_counters mmc_s;
/** OSI stats counters */
struct osi_stats stats_s;
/** core argument structure */
ivc_core_args init_args;
/** ioctl command structure */
struct osi_ioctl ioctl_data;
/** All stats */
struct osi_stats eth_stats;
#ifdef MACSEC_SUPPORT
/** lut config */
struct osi_macsec_lut_config lut_config;

View File

@@ -26,42 +26,6 @@
#include <nvethernet_type.h>
#include "osi_common.h"
#ifndef OSI_STRIPPED_LIB
/**
* @brief osi_xtra_stat_counters - OSI core extra stat counters
*/
struct osi_xtra_stat_counters {
/** RX buffer unavailable irq count */
nveu64_t rx_buf_unavail_irq_n[OSI_MGBE_MAX_NUM_QUEUES];
/** Transmit Process Stopped irq count */
nveu64_t tx_proc_stopped_irq_n[OSI_MGBE_MAX_NUM_QUEUES];
/** Transmit Buffer Unavailable irq count */
nveu64_t tx_buf_unavail_irq_n[OSI_MGBE_MAX_NUM_QUEUES];
/** Receive Process Stopped irq count */
nveu64_t rx_proc_stopped_irq_n[OSI_MGBE_MAX_NUM_QUEUES];
/** Receive Watchdog Timeout irq count */
nveu64_t rx_watchdog_irq_n;
/** Fatal Bus Error irq count */
nveu64_t fatal_bus_error_irq_n;
/** rx skb allocation failure count */
nveu64_t re_alloc_rxbuf_failed[OSI_MGBE_MAX_NUM_QUEUES];
/** TX per channel interrupt count */
nveu64_t tx_normal_irq_n[OSI_MGBE_MAX_NUM_QUEUES];
/** TX per channel SW timer callback count */
nveu64_t tx_usecs_swtimer_n[OSI_MGBE_MAX_NUM_QUEUES];
/** RX per channel interrupt count */
nveu64_t rx_normal_irq_n[OSI_MGBE_MAX_NUM_QUEUES];
/** link connect count */
nveu64_t link_connect_count;
/** link disconnect count */
nveu64_t link_disconnect_count;
/** lock fail count node addition */
nveu64_t ts_lock_add_fail;
/** lock fail count node removal */
nveu64_t ts_lock_del_fail;
};
#endif /* !OSI_STRIPPED_LIB */
#ifdef MACSEC_SUPPORT
/**
* @brief The structure hold macsec statistics counters

View File

@@ -56,6 +56,9 @@
#define OSI_MTL_QUEUE_AVB 0x1U
#define OSI_MTL_QUEUE_ENABLE 0x2U
#define OSI_MTL_QUEUE_MODEMAX 0x3U
#ifndef OSI_STRIPPED_LIB
#define OSI_MTL_MAX_NUM_QUEUES 10U
#endif
/** @} */
/**
@@ -181,9 +184,9 @@ struct osi_fpe_config {
};
/**
* @brief OSI Core TSN error stats structure
* @brief OSI Core error stats structure
*/
struct osi_tsn_stats {
struct osi_stats {
/** Constant Gate Control Error */
nveu64_t const_gate_ctr_err;
/** Head-Of-Line Blocking due to Scheduling */
@@ -198,6 +201,32 @@ struct osi_tsn_stats {
nveu64_t base_time_reg_err;
/** Switch to Software Owned List Complete */
nveu64_t sw_own_list_complete;
#ifndef OSI_STRIPPED_LIB
/** IP Header Error */
nveu64_t mgbe_ip_header_err;
/** Jabber time out Error */
nveu64_t mgbe_jabber_timeout_err;
/** Payload Checksum Error */
nveu64_t mgbe_payload_cs_err;
/** Under Flow Error */
nveu64_t mgbe_tx_underflow_err;
/** RX buffer unavailable irq count */
nveu64_t rx_buf_unavail_irq_n[OSI_MTL_MAX_NUM_QUEUES];
/** Transmit Process Stopped irq count */
nveu64_t tx_proc_stopped_irq_n[OSI_MTL_MAX_NUM_QUEUES];
/** Transmit Buffer Unavailable irq count */
nveu64_t tx_buf_unavail_irq_n[OSI_MTL_MAX_NUM_QUEUES];
/** Receive Process Stopped irq count */
nveu64_t rx_proc_stopped_irq_n[OSI_MTL_MAX_NUM_QUEUES];
/** Receive Watchdog Timeout irq count */
nveu64_t rx_watchdog_irq_n;
/** Fatal Bus Error irq count */
nveu64_t fatal_bus_error_irq_n;
/** lock fail count node addition */
nveu64_t ts_lock_add_fail;
/** lock fail count node removal */
nveu64_t ts_lock_del_fail;
#endif
};
/**

View File

@@ -276,6 +276,7 @@ typedef my_lint_64 nvel64_t;
#ifdef HSI_SUPPORT
#define OSI_CMD_HSI_INJECT_ERR 55U
#endif
#define OSI_CMD_READ_STATS 56U
/** @} */
/**
@@ -1216,22 +1217,6 @@ struct core_padctrl {
nveu32_t pad_calibration_enable;
};
#ifndef OSI_STRIPPED_LIB
/**
* @brief OSI CORE packet error stats
*/
struct osi_core_pkt_err_stats {
/** IP Header Error */
nveu64_t mgbe_ip_header_err;
/** Jabber time out Error */
nveu64_t mgbe_jabber_timeout_err;
/** Payload Checksum Error */
nveu64_t mgbe_payload_cs_err;
/** Under Flow Error */
nveu64_t mgbe_tx_underflow_err;
};
#endif
#ifdef HSI_SUPPORT
/**
* @brief The OSI Core HSI private data structure.
@@ -1352,8 +1337,6 @@ struct osi_core_priv_data {
/** TQ:TC mapping */
nveu32_t tc[OSI_MGBE_MAX_NUM_CHANS];
#ifndef OSI_STRIPPED_LIB
/** xtra sw error counters */
struct osi_xtra_stat_counters xstats;
/** Memory mapped base address of HV window */
void *hv_base;
/** csr clock is to program LPI 1 us tick timer register.
@@ -1382,8 +1365,8 @@ struct osi_core_priv_data {
* 1- Successful and can be used between P2P device
*/
nveu32_t fpe_ready;
/** TSN stats counters */
struct osi_tsn_stats tsn_stats;
/** MAC stats counters */
struct osi_stats stats;
/** eqos pad control structure */
struct core_padctrl padctrl;
/** MDC clock rate */
@@ -1409,10 +1392,6 @@ struct osi_core_priv_data {
nveu32_t phy_iface_mode;
/** MGBE MAC instance ID's */
nveu32_t instance_id;
#ifndef OSI_STRIPPED_LIB
/** Packet error stats */
struct osi_core_pkt_err_stats pkt_err_stats;
#endif
/** Ethernet controller MAC to MAC Time sync role
* 1 - Primary interface, 2 - secondary interface, 0 - inactive interface
*/