rename packet_io_ingress/egress to packet_io_input/output
This commit is contained in:
@@ -219,7 +219,7 @@ static void *work_thread(void *arg)
|
|||||||
|
|
||||||
if (packet_io_init(packet_io, thr_idx) != 0)
|
if (packet_io_init(packet_io, thr_idx) != 0)
|
||||||
{
|
{
|
||||||
CORE_LOG_ERROR("unable to init marsio thread");
|
CORE_LOG_ERROR("unable to init packet io");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ static void *work_thread(void *arg)
|
|||||||
* Suggestion: After modifying the system time, restart the service to ensure consistent timing.
|
* Suggestion: After modifying the system time, restart the service to ensure consistent timing.
|
||||||
*/
|
*/
|
||||||
now_ms = clock_get_real_time_ms();
|
now_ms = clock_get_real_time_ms();
|
||||||
nr_recv = packet_io_ingress(packet_io, thr_idx, packets, RX_BURST_MAX);
|
nr_recv = packet_io_input(packet_io, thr_idx, packets, RX_BURST_MAX);
|
||||||
if (nr_recv == 0)
|
if (nr_recv == 0)
|
||||||
{
|
{
|
||||||
goto idle_tasks;
|
goto idle_tasks;
|
||||||
@@ -323,12 +323,12 @@ static void *work_thread(void *arg)
|
|||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
// copy meta from defraged_pkt to packets[i]
|
// copy meta from defraged_pkt to packets[i]
|
||||||
packet_io_egress(packet_io, thr_idx, &packets[i], 1);
|
packet_io_output(packet_io, thr_idx, &packets[i], 1);
|
||||||
packet_free(defraged_pkt);
|
packet_free(defraged_pkt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet_io_egress(packet_io, thr_idx, pkt, 1);
|
packet_io_output(packet_io, thr_idx, pkt, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -717,7 +717,7 @@ void stellar_send_build_packet(struct stellar *st, struct packet *pkt)
|
|||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
abort();
|
abort();
|
||||||
packet_io_egress(packet_io, thr_idx, pkt, 1);
|
packet_io_output(packet_io, thr_idx, pkt, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ int dumpfile_io_init(struct dumpfile_io *handle __attribute__((unused)), uint16_
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t dumpfile_io_ingress(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
uint16_t dumpfile_io_input(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||||
{
|
{
|
||||||
struct packet_queue *queue = handle->queue[thr_idx];
|
struct packet_queue *queue = handle->queue[thr_idx];
|
||||||
struct packet_io_stat *stat = &handle->stat[thr_idx];
|
struct packet_io_stat *stat = &handle->stat[thr_idx];
|
||||||
@@ -404,7 +404,7 @@ uint16_t dumpfile_io_ingress(struct dumpfile_io *handle, uint16_t thr_idx, struc
|
|||||||
return nr_parsed;
|
return nr_parsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dumpfile_io_egress(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
void dumpfile_io_output(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
struct packet *pkt = NULL;
|
struct packet *pkt = NULL;
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ void dumpfile_io_free(struct dumpfile_io *handle);
|
|||||||
int dumpfile_io_isbreak(struct dumpfile_io *handle);
|
int dumpfile_io_isbreak(struct dumpfile_io *handle);
|
||||||
|
|
||||||
int dumpfile_io_init(struct dumpfile_io *handle, uint16_t thr_idx);
|
int dumpfile_io_init(struct dumpfile_io *handle, uint16_t thr_idx);
|
||||||
uint16_t dumpfile_io_ingress(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
uint16_t dumpfile_io_input(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
void dumpfile_io_egress(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
void dumpfile_io_output(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
void dumpfile_io_drop(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
void dumpfile_io_drop(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
uint16_t dumpfile_io_inject(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
uint16_t dumpfile_io_inject(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
void dumpfile_io_yield(struct dumpfile_io *handle, uint16_t thr_idx, uint64_t timeout_ms);
|
void dumpfile_io_yield(struct dumpfile_io *handle, uint16_t thr_idx, uint64_t timeout_ms);
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ int marsio_io_init(struct marsio_io *handle, uint16_t thr_idx __attribute__((unu
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t marsio_io_ingress(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
uint16_t marsio_io_input(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||||
{
|
{
|
||||||
struct packet *pkt;
|
struct packet *pkt;
|
||||||
marsio_buff_t *mbuff;
|
marsio_buff_t *mbuff;
|
||||||
@@ -316,7 +316,7 @@ uint16_t marsio_io_ingress(struct marsio_io *handle, uint16_t thr_idx, struct pa
|
|||||||
return nr_parsed;
|
return nr_parsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void marsio_io_egress(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
void marsio_io_output(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||||
{
|
{
|
||||||
struct packet *pkt;
|
struct packet *pkt;
|
||||||
marsio_buff_t *mbuff;
|
marsio_buff_t *mbuff;
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ struct marsio_io *marsio_io_new(const char *app_symbol, const char *dev_symbol,
|
|||||||
void marsio_io_free(struct marsio_io *handle);
|
void marsio_io_free(struct marsio_io *handle);
|
||||||
|
|
||||||
int marsio_io_init(struct marsio_io *handle, uint16_t thr_idx);
|
int marsio_io_init(struct marsio_io *handle, uint16_t thr_idx);
|
||||||
uint16_t marsio_io_ingress(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
uint16_t marsio_io_input(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
void marsio_io_egress(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
void marsio_io_output(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
void marsio_io_drop(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
void marsio_io_drop(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
uint16_t marsio_io_inject(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
uint16_t marsio_io_inject(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
void marsio_io_yield(struct marsio_io *handle, uint16_t thr_idx, uint64_t timeout_ms);
|
void marsio_io_yield(struct marsio_io *handle, uint16_t thr_idx, uint64_t timeout_ms);
|
||||||
|
|||||||
@@ -81,27 +81,27 @@ int packet_io_init(struct packet_io *packet_io, uint16_t thr_idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t packet_io_ingress(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
uint16_t packet_io_input(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||||
{
|
{
|
||||||
if (likely(packet_io->mode == PACKET_IO_MARSIO))
|
if (likely(packet_io->mode == PACKET_IO_MARSIO))
|
||||||
{
|
{
|
||||||
return marsio_io_ingress(packet_io->marsio, thr_idx, pkts, nr_pkts);
|
return marsio_io_input(packet_io->marsio, thr_idx, pkts, nr_pkts);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return dumpfile_io_ingress(packet_io->dumpfile, thr_idx, pkts, nr_pkts);
|
return dumpfile_io_input(packet_io->dumpfile, thr_idx, pkts, nr_pkts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void packet_io_egress(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
void packet_io_output(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||||
{
|
{
|
||||||
if (likely(packet_io->mode == PACKET_IO_MARSIO))
|
if (likely(packet_io->mode == PACKET_IO_MARSIO))
|
||||||
{
|
{
|
||||||
marsio_io_egress(packet_io->marsio, thr_idx, pkts, nr_pkts);
|
marsio_io_output(packet_io->marsio, thr_idx, pkts, nr_pkts);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dumpfile_io_egress(packet_io->dumpfile, thr_idx, pkts, nr_pkts);
|
dumpfile_io_output(packet_io->dumpfile, thr_idx, pkts, nr_pkts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ void packet_io_free(struct packet_io *packet_io);
|
|||||||
int packet_io_isbreak(struct packet_io *packet_io); // used for dumpfile mode
|
int packet_io_isbreak(struct packet_io *packet_io); // used for dumpfile mode
|
||||||
|
|
||||||
int packet_io_init(struct packet_io *packet_io, uint16_t thr_idx);
|
int packet_io_init(struct packet_io *packet_io, uint16_t thr_idx);
|
||||||
uint16_t packet_io_ingress(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
uint16_t packet_io_input(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
void packet_io_egress(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
void packet_io_output(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
void packet_io_drop(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
void packet_io_drop(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
uint16_t packet_io_inject(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
uint16_t packet_io_inject(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||||
void packet_io_yield(struct packet_io *packet_io, uint16_t thr_idx, uint64_t timeout_ms);
|
void packet_io_yield(struct packet_io *packet_io, uint16_t thr_idx, uint64_t timeout_ms);
|
||||||
|
|||||||
Reference in New Issue
Block a user