perf: 优化session_ctx减少内存占用; 优化global metrics的结构

This commit is contained in:
luwenpeng
2023-11-24 15:17:18 +08:00
parent bda50d79af
commit eedd18183e
12 changed files with 331 additions and 439 deletions

View File

@@ -12,6 +12,35 @@ extern "C"
* Packet IO API for gtest
******************************************************************************/
struct sids
{
sid_t elems[MR_SID_LIST_MAXLEN];
int num;
};
struct route_ctx
{
char data[64];
int len;
};
struct metadata
{
uint64_t session_id;
uint32_t rehash_index;
char *raw_data; // refer to current packet data
int raw_len;
uint16_t l7offset;
int direction; // 1: E2I; 0: I2E
int is_ctrl_pkt;
int is_decrypted;
struct sids sids;
struct route_ctx route_ctx;
};
int mbuff_get_metadata(marsio_buff_t *rx_buff, struct metadata *meta);
int mbuff_set_metadata(marsio_buff_t *tx_buff, struct metadata *meta);
void vlan_encapsulate(marsio_buff_t *mbuff, int vlan_id, int replace_orig_vlan_header);