diff options
| author | Lu Qiuwen <[email protected]> | 2022-09-01 03:23:23 -0400 |
|---|---|---|
| committer | Lu Qiuwen <[email protected]> | 2022-09-01 03:23:23 -0400 |
| commit | 864c9e7952a065270c99dd41b0444f536c20849a (patch) | |
| tree | 06dda35fc0c8b6a54168453ac8c9e1872cbc69b1 /service/src/vdata.c | |
| parent | 2360ec50ffce8a32e1f330bb9cb4397059a79db3 (diff) | |
增加控制通道的统计功能。feature-gtp-offload
Diffstat (limited to 'service/src/vdata.c')
| -rw-r--r-- | service/src/vdata.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/service/src/vdata.c b/service/src/vdata.c index 0b15a66..756e3f8 100644 --- a/service/src/vdata.c +++ b/service/src/vdata.c @@ -105,8 +105,10 @@ static int vdev_data_idle_poll(struct _vdev * _vdev, queue_id_t qid) static int vdev_data_stats_get(struct _vdev * _vdev, struct vdev_stat_info * stat_info) { struct vnode_prod_stat * st_prod_rx = vnode_mirror_prod_stat_get(_vdev->vnode_rx_prod); + struct vnode_prod_stat * st_prod_ctrl_rx = vnode_mirror_prod_stat_get(_vdev->vnode_rx_ctrl_prod); + struct vnode_cons_stat * st_cons_tx = vnode_mirror_cons_stat_get(_vdev->vnode_tx_cons); - struct vnode_cons_stat * st_cons_ltx = vnode_mirror_cons_stat_get(_vdev->vnode_tx_ctrl_cons); + struct vnode_cons_stat * st_cons_ctrl_tx = vnode_mirror_cons_stat_get(_vdev->vnode_tx_ctrl_cons); //TODO: What about nr_rxstream, nr_txstream is different? for (int i = 0; i < _vdev->nr_rxstream; i++) @@ -117,17 +119,28 @@ static int vdev_data_stats_get(struct _vdev * _vdev, struct vdev_stat_info * sta stat_info->rx_total_len[i] = VNODE_STAT_READ(&st_prod_rx[i].on_line); } + for (int i = 0; i < _vdev->nr_ctrl_rxstream; i++) + { + stat_info->crx_on_line[i] = VNODE_STAT_READ(&st_prod_ctrl_rx[i].on_line); + stat_info->crx_deliver[i] = VNODE_STAT_READ(&st_prod_ctrl_rx[i].deliver); + stat_info->crx_missed[i] = VNODE_STAT_READ(&st_prod_ctrl_rx[i].missed); + stat_info->crx_total_len[i] = VNODE_STAT_READ(&st_prod_ctrl_rx[i].on_line); + } + for (int i = 0; i < _vdev->nr_txstream; i++) { stat_info->tx_on_line[i] = VNODE_STAT_READ(&st_cons_tx[i].on_line); stat_info->tx_deliver[i] = VNODE_STAT_READ(&st_cons_tx[i].deliver); stat_info->tx_missed[i] = VNODE_STAT_READ(&st_cons_tx[i].missed); stat_info->tx_total_len[i] = VNODE_STAT_READ(&st_cons_tx[i].total_len); + } - stat_info->ltx_on_line[i] = VNODE_STAT_READ(&st_cons_ltx[i].on_line); - stat_info->ltx_deliver[i] = VNODE_STAT_READ(&st_cons_ltx[i].deliver); - stat_info->ltx_missed[i] = VNODE_STAT_READ(&st_cons_ltx[i].missed); - stat_info->ltx_total_len[i] = VNODE_STAT_READ(&st_cons_ltx[i].total_len); + for(int i = 0; i < _vdev->nr_ctrl_txstream; i++) + { + stat_info->ctx_on_line[i] = VNODE_STAT_READ(&st_cons_ctrl_tx[i].on_line); + stat_info->ctx_deliver[i] = VNODE_STAT_READ(&st_cons_ctrl_tx[i].deliver); + stat_info->ctx_missed[i] = VNODE_STAT_READ(&st_cons_ctrl_tx[i].missed); + stat_info->ctx_total_len[i] = VNODE_STAT_READ(&st_cons_ctrl_tx[i].total_len); } return 0; |
