#endif
/**
- * Master thead: data plane thread context
+ * Main thread: data plane thread context
*/
struct thread {
struct rte_ring *msgq_req;
static struct thread_data thread_data[RTE_MAX_LCORE];
/**
- * Master thread: data plane thread init
+ * Main thread: data plane thread init
*/
static void
thread_free(void)
continue;
/* MSGQs */
- if (t->msgq_req)
- rte_ring_free(t->msgq_req);
+ rte_ring_free(t->msgq_req);
- if (t->msgq_rsp)
- rte_ring_free(t->msgq_rsp);
+ rte_ring_free(t->msgq_rsp);
}
}
{
uint32_t i;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
char name[NAME_MAX];
struct rte_ring *msgq_req, *msgq_rsp;
struct thread *t = &thread[i];
return -1;
}
- /* Master thread records */
+ /* Main thread records */
t->msgq_req = msgq_req;
t->msgq_rsp = msgq_rsp;
t->enabled = 1;
}
/**
- * Master thread & data plane threads: message passing
+ * Main thread & data plane threads: message passing
*/
enum thread_req_type {
THREAD_REQ_PIPELINE_ENABLE = 0,
};
/**
- * Master thread
+ * Main thread
*/
static struct thread_msg_req *
thread_msg_alloc(void)
/* Send request and wait for response */
rsp = thread_msg_send_recv(thread_id, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = thread_msg_send_recv(thread_id, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
}
/**
- * Master thread & data plane threads: message passing
+ * Main thread & data plane threads: message passing
*/
enum pipeline_req_type {
/* Port IN */
};
/**
- * Master thread
+ * Main thread
*/
static struct pipeline_msg_req *
pipeline_msg_alloc(void)
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
- if (status)
+ if (status == 0)
memcpy(stats, &rsp->port_in_stats_read.stats, sizeof(*stats));
/* Free response */
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
- if (status)
+ if (status == 0)
memcpy(stats, &rsp->port_out_stats_read.stats, sizeof(*stats));
/* Free response */
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
- if (status)
+ if (status == 0)
memcpy(stats, &rsp->table_stats_read.stats, sizeof(*stats));
/* Free response */
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL) {
- free(rule);
- return -1;
- }
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL) {
- free(rule);
- return -1;
- }
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL) {
- table_rule_list_free(list);
- return -ENOMEM;
- }
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;
/* Send request and wait for response */
rsp = pipeline_msg_send_recv(p, req);
- if (rsp == NULL)
- return -1;
/* Read response */
status = rsp->status;