2 // Copyright (c) 2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #include <cmdline_parse.h>
18 #include <cmdline_parse_num.h>
19 #include <cmdline_parse_string.h>
20 #include <cmdline_parse_ipaddr.h>
21 #include <cmdline_parse_etheraddr.h>
24 #include "pipeline_common_fe.h"
25 #include "pipeline_txrx.h"
26 #include "vnf_common.h"
27 //#include "lib_arp.h"
28 #include "pipeline_arpicmp_be.h"
31 app_pipeline_txrx_entry_dbg(struct app_params *app,
32 uint32_t pipeline_id, uint8_t *msg)
34 struct pipeline_txrx_entry_dbg_msg_req *req;
35 struct pipeline_txrx_entry_dbg_msg_rsp *rsp;
37 /* Check input arguments */
41 /* Allocate and write request */
42 req = app_msg_alloc(app);
46 req->type = PIPELINE_MSG_REQ_CUSTOM;
47 req->subtype = PIPELINE_TXRX_MSG_REQ_ENTRY_DBG;
48 req->data[0] = msg[0];
49 req->data[1] = msg[1];
51 rsp = app_msg_send_recv(app, pipeline_id, req, MSG_TIMEOUT_DEFAULT);
57 app_msg_free(app, rsp);
58 printf("Error rsp->status %d\n", rsp->status);
63 app_msg_free(app, rsp);
73 struct cmd_entry_dbg_result {
74 cmdline_fixed_string_t p_string;
76 cmdline_fixed_string_t entry_string;
77 cmdline_fixed_string_t dbg_string;
83 cmd_entry_dbg_parsed(void *parsed_result,
84 __rte_unused struct cmdline *cl, void *data)
86 struct cmd_entry_dbg_result *params = parsed_result;
87 struct app_params *app = data;
93 status = app_pipeline_txrx_entry_dbg(app, params->p, msg);
96 printf("Dbg Command failed\n");
101 static cmdline_parse_token_string_t lb_cmd_entry_dbg_p_string =
102 TOKEN_STRING_INITIALIZER(struct cmd_entry_dbg_result, p_string, "p");
104 static cmdline_parse_token_num_t lb_cmd_entry_dbg_p =
105 TOKEN_NUM_INITIALIZER(struct cmd_entry_dbg_result, p, UINT32);
107 static cmdline_parse_token_string_t lb_cmd_entry_dbg_entry_string =
108 TOKEN_STRING_INITIALIZER(struct cmd_entry_dbg_result,
109 entry_string, "txrx");
111 static cmdline_parse_token_string_t lb_cmd_entry_dbg_dbg_string =
112 TOKEN_STRING_INITIALIZER(struct cmd_entry_dbg_result, dbg_string,
115 static cmdline_parse_token_num_t lb_cmd_entry_dbg_cmd =
116 TOKEN_NUM_INITIALIZER(struct cmd_entry_dbg_result, cmd, UINT8);
118 static cmdline_parse_token_num_t lb_cmd_entry_dbg_d1 =
119 TOKEN_NUM_INITIALIZER(struct cmd_entry_dbg_result, d1, UINT8);
121 static cmdline_parse_inst_t lb_cmd_entry_dbg = {
122 .f = cmd_entry_dbg_parsed,
124 .help_str = "TXRX dbg cmd",
126 (void *)&lb_cmd_entry_dbg_p_string,
127 (void *)&lb_cmd_entry_dbg_p,
128 (void *)&lb_cmd_entry_dbg_entry_string,
129 (void *)&lb_cmd_entry_dbg_dbg_string,
130 (void *)&lb_cmd_entry_dbg_cmd,
131 (void *)&lb_cmd_entry_dbg_d1,
136 static cmdline_parse_ctx_t pipeline_cmds[] = {
137 (cmdline_parse_inst_t *) &lb_cmd_entry_dbg,
141 static struct pipeline_fe_ops pipeline_txrx_fe_ops = {
144 .cmds = pipeline_cmds,
147 struct pipeline_type pipeline_txrx = {
149 .be_ops = &pipeline_txrx_be_ops,
150 .fe_ops = &pipeline_txrx_fe_ops,