TSG-15510 修复No Intercept没有发送metrics
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "tfe_stream.h"
|
||||
#include "tfe_resource.h"
|
||||
|
||||
void tfe_set_intercept_metric(struct tfe_fieldstat_metric_t *fieldstat, struct tfe_cmsg *cmsg, int hit_count, int downstream_rx_pkts, int downstream_rx_bytes, int upstream_rx_pkts, int upstream_rx_bytes, int thread_id)
|
||||
void tfe_set_intercept_metric(struct tfe_fieldstat_metric_t *fieldstat, struct tfe_cmsg *cmsg, int hit_count, int downstream_rx_pkts, int downstream_rx_bytes, int upstream_rx_pkts, int upstream_rx_bytes, int thread_id, int dir_is_e2i)
|
||||
{
|
||||
int ret;
|
||||
uint16_t out_size;
|
||||
@@ -38,35 +38,6 @@ void tfe_set_intercept_metric(struct tfe_fieldstat_metric_t *fieldstat, struct t
|
||||
return;
|
||||
}
|
||||
|
||||
// according to KNI -> MESA_dir_link_to_human()
|
||||
// 'E' or 'e': 表示发包方向是从Internal to External.
|
||||
// 'I' or 'i': 表示发包方向是从External to Internal.
|
||||
unsigned int route_dir;
|
||||
ret = tfe_cmsg_get_value(cmsg, TFE_CMSG_COMMON_DIRECTION, (unsigned char *)&route_dir, sizeof(route_dir), &out_size);
|
||||
if (ret != 0)
|
||||
{
|
||||
TFE_LOG_ERROR(g_default_logger, "failed at fetch route_dir from cmsg: %s", strerror(-ret));
|
||||
return;
|
||||
}
|
||||
|
||||
int dir_is_e2i = 0;
|
||||
switch (route_dir)
|
||||
{
|
||||
case 'e':
|
||||
/* fall through */
|
||||
case 'E':
|
||||
dir_is_e2i = 0;
|
||||
break;
|
||||
case 'i':
|
||||
/* fall through */
|
||||
case 'I':
|
||||
dir_is_e2i = 1;
|
||||
break;
|
||||
default:
|
||||
TFE_LOG_ERROR(g_default_logger, "failed at fetch route dir from cmsg: invalid route dir %c", route_dir);
|
||||
return;
|
||||
}
|
||||
|
||||
int in_pkts = 0;
|
||||
int in_bytes = 0;
|
||||
int out_pkts = 0;
|
||||
|
||||
Reference in New Issue
Block a user