#include "pipeline_passthrough.h"
#include "pipeline_firewall.h"
#include "pipeline_flow_classification.h"
+#include "pipeline_flow_actions.h"
#include "pipeline_routing.h"
+#include "thread_fe.h"
#define APP_NAME_SIZE 32
}
}
+static inline int
+app_get_cpu_socket_id(uint32_t pmd_id)
+{
+ int status = rte_eth_dev_socket_id(pmd_id);
+
+ return (status != SOCKET_ID_ANY) ? status : 0;
+}
+
static void
app_init_link(struct app_params *app)
{
p_link->pmd_id,
rxq_queue_id,
p_rxq->size,
- rte_eth_dev_socket_id(p_link->pmd_id),
+ app_get_cpu_socket_id(p_link->pmd_id),
&p_rxq->conf,
app->mempool[p_rxq->mempool_id]);
if (status < 0)
p_link->pmd_id,
txq_queue_id,
p_txq->size,
- rte_eth_dev_socket_id(p_link->pmd_id),
+ app_get_cpu_socket_id(p_link->pmd_id),
&p_txq->conf);
if (status < 0)
rte_panic("%s (%" PRIu32 "): "
/* TM */
p_tm->sched_port_params.name = p_tm->name;
p_tm->sched_port_params.socket =
- rte_eth_dev_socket_id(p_link->pmd_id);
+ app_get_cpu_socket_id(p_link->pmd_id);
p_tm->sched_port_params.rate =
(uint64_t) link_eth_params.link_speed * 1000 * 1000 / 8;
uint32_t i;
uint32_t mempool_id;
- strcpy(p_out->name, p_in->name);
+ snprintf(p_out->name, PIPELINE_NAME_SIZE, "%s", p_in->name);
p_out->socket_id = (int) p_in->socket_id;
"init error\n", params->name);
}
+ data->ptype = ptype;
+
data->timer_period = (rte_get_tsc_hz() * params->timer_period)
/ 1000;
}
t = &app->thread_data[lcore_id];
+ t->timer_period = (rte_get_tsc_hz() * APP_THREAD_TIMER_PERIOD) / 1000;
+ t->thread_req_deadline = time + t->timer_period;
+
+ t->msgq_in = app_thread_msgq_in_get(app,
+ params->socket_id,
+ params->core_id,
+ params->hyper_th_id);
+ if (t->msgq_in == NULL)
+ rte_panic("Init error: Cannot find MSGQ_IN for thread %" PRId32,
+ lcore_id);
+
+ t->msgq_out = app_thread_msgq_out_get(app,
+ params->socket_id,
+ params->core_id,
+ params->hyper_th_id);
+ if (t->msgq_out == NULL)
+ rte_panic("Init error: Cannot find MSGQ_OUT for thread %" PRId32,
+ lcore_id);
+
ptype = app_pipeline_type_find(app, params->type);
if (ptype == NULL)
rte_panic("Init error: Unknown pipeline "
&t->regular[t->n_regular] :
&t->custom[t->n_custom];
+ p->pipeline_id = p_id;
p->be = data->be;
p->f_run = ptype->be_ops->f_run;
p->f_timer = ptype->be_ops->f_timer;
p->timer_period = data->timer_period;
p->deadline = time + data->timer_period;
+ data->enabled = 1;
+
if (ptype->be_ops->f_run == NULL)
t->n_regular++;
else
app_init_msgq(app);
app_pipeline_common_cmd_push(app);
+ app_pipeline_thread_cmd_push(app);
app_pipeline_type_register(app, &pipeline_master);
app_pipeline_type_register(app, &pipeline_passthrough);
app_pipeline_type_register(app, &pipeline_flow_classification);
+ app_pipeline_type_register(app, &pipeline_flow_actions);
app_pipeline_type_register(app, &pipeline_firewall);
app_pipeline_type_register(app, &pipeline_routing);
/* Push pipeline commands into the application */
memcpy(&app->cmds[app->n_cmds],
cmds,
- n_cmds * sizeof(cmdline_parse_ctx_t *));
+ n_cmds * sizeof(cmdline_parse_ctx_t));
for (i = 0; i < n_cmds; i++)
app->cmds[app->n_cmds + i]->data = app;