diff options
| author | Lu Qiuwen <[email protected]> | 2022-12-29 18:13:29 +0800 |
|---|---|---|
| committer | 陆秋文 <[email protected]> | 2022-12-30 09:35:21 +0000 |
| commit | bb21654d5b0bcc85c7c66e3a9941af1ad11a5a7c (patch) | |
| tree | 1352c9869be7c3916425ce2b8a0f49f62ac08866 /service/src/node_shmdev.c | |
| parent | e302d9dce5d8c074c6eb958ba3b923005311de38 (diff) | |
适配新的PacketParser接口,优化部分node流程的实现。
Diffstat (limited to 'service/src/node_shmdev.c')
| -rw-r--r-- | service/src/node_shmdev.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/service/src/node_shmdev.c b/service/src/node_shmdev.c index fd4103e..7ca427c 100644 --- a/service/src/node_shmdev.c +++ b/service/src/node_shmdev.c @@ -299,16 +299,18 @@ uint16_t shmdev_rx_node_process(struct rte_graph * graph, struct rte_node * node { /* Update new create pkt */ MR_SHMDEV_STAT_ADD(shmdev_graph_stat, graph->id, new_create_pkt, 1); - - /* Parse pkt */ - struct pkt_parser * pkt_parser_ptr = &private_ctrlzone->pkt_parser; memset(private_ctrlzone, 0, sizeof(struct private_data)); - pkt_parser_init(pkt_parser_ptr, LAYER_TYPE_ALL, MR_PKT_PARSE_RESULT_MAX); - complex_parser_ether(pkt_parser_ptr, rte_pktmbuf_mtod(mbuf0, const char *)); - struct default_si_table * _default_si_table_item = - &g_vlan_flipping_adapter->default_si_table_array[dev_desc->port_id]; + /* prepare to parse the ingress pkt */ + struct pkt_parser pkt_parser; + pkt_parser_init(&pkt_parser, LAYER_TYPE_ALL, MR_PKT_PARSER_LAYERS_MAX); + + /* parse the packet, and copy the result to the private zone */ + complex_parser_ether(&pkt_parser, rte_pktmbuf_mtod(mbuf0, const char *)); + private_ctrlzone->pkt_parser_result = pkt_parser.result; + /* decode the si from vlan id */ + struct default_si_table * _default_si_table_item = &g_vlan_flipping_adapter->default_si_table_array[dev_desc->port_id]; if (g_vlan_flipping_adapter->enable && _default_si_table_item->dev_enable) { uint16_t vlan_id = mbuf0->vlan_tci; |
