rename packet_io_input/output to packet_io_ingress/egress
This commit is contained in:
@@ -270,7 +270,7 @@ int marsio_io_init(void *handle, uint16_t thr_idx __attribute__((unused)))
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t marsio_io_input(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
uint16_t marsio_io_ingress(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
{
|
||||
int len;
|
||||
char *data;
|
||||
@@ -327,7 +327,7 @@ uint16_t marsio_io_input(void *handle, uint16_t thr_idx, struct packet *pkts, ui
|
||||
return nr_packet_parsed;
|
||||
}
|
||||
|
||||
void marsio_io_output(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
void marsio_io_egress(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
{
|
||||
int len;
|
||||
struct packet *pkt;
|
||||
|
||||
@@ -12,8 +12,8 @@ void marsio_io_free(void *handle);
|
||||
int marsio_io_isbreak(void *handle);
|
||||
|
||||
int marsio_io_init(void *handle, uint16_t thr_idx);
|
||||
uint16_t marsio_io_input(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void marsio_io_output(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
uint16_t marsio_io_ingress(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void marsio_io_egress(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void marsio_io_drop(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
uint16_t marsio_io_inject(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void marsio_io_yield(void *handle, uint16_t thr_idx);
|
||||
|
||||
@@ -19,8 +19,8 @@ struct packet_io
|
||||
int (*isbreak_func)(void *handle);
|
||||
|
||||
int (*init_func)(void *handle, uint16_t thr_idx);
|
||||
uint16_t (*input_func)(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void (*output_func)(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
uint16_t (*ingress_func)(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void (*egress_func)(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void (*drop_func)(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
uint16_t (*inject_func)(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void (*yield_func)(void *handle, uint16_t thr_idx);
|
||||
@@ -256,8 +256,8 @@ struct packet_io *packet_io_new(const struct packet_io_config *cfg)
|
||||
pkt_io->free_func = marsio_io_free;
|
||||
pkt_io->isbreak_func = marsio_io_isbreak;
|
||||
pkt_io->init_func = marsio_io_init;
|
||||
pkt_io->input_func = marsio_io_input;
|
||||
pkt_io->output_func = marsio_io_output;
|
||||
pkt_io->ingress_func = marsio_io_ingress;
|
||||
pkt_io->egress_func = marsio_io_egress;
|
||||
pkt_io->drop_func = marsio_io_drop;
|
||||
pkt_io->inject_func = marsio_io_inject;
|
||||
pkt_io->yield_func = marsio_io_yield;
|
||||
@@ -269,8 +269,8 @@ struct packet_io *packet_io_new(const struct packet_io_config *cfg)
|
||||
pkt_io->free_func = pcap_io_free;
|
||||
pkt_io->isbreak_func = pcap_io_isbreak;
|
||||
pkt_io->init_func = pcap_io_init;
|
||||
pkt_io->input_func = pcap_io_input;
|
||||
pkt_io->output_func = pcap_io_output;
|
||||
pkt_io->ingress_func = pcap_io_ingress;
|
||||
pkt_io->egress_func = pcap_io_egress;
|
||||
pkt_io->drop_func = pcap_io_drop;
|
||||
pkt_io->inject_func = pcap_io_inject;
|
||||
pkt_io->yield_func = pcap_io_yield;
|
||||
@@ -310,14 +310,14 @@ int packet_io_init(struct packet_io *pkt_io, uint16_t thr_idx)
|
||||
return pkt_io->init_func(pkt_io->handle, thr_idx);
|
||||
}
|
||||
|
||||
uint16_t packet_io_input(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
uint16_t packet_io_ingress(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
{
|
||||
return pkt_io->input_func(pkt_io->handle, thr_idx, pkts, nr_pkts);
|
||||
return pkt_io->ingress_func(pkt_io->handle, thr_idx, pkts, nr_pkts);
|
||||
}
|
||||
|
||||
void packet_io_output(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
void packet_io_egress(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
{
|
||||
pkt_io->output_func(pkt_io->handle, thr_idx, pkts, nr_pkts);
|
||||
pkt_io->egress_func(pkt_io->handle, thr_idx, pkts, nr_pkts);
|
||||
}
|
||||
|
||||
void packet_io_drop(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
|
||||
@@ -75,8 +75,8 @@ void packet_io_free(struct packet_io *pkt_io);
|
||||
int packet_io_isbreak(struct packet_io *pkt_io);
|
||||
|
||||
int packet_io_init(struct packet_io *pkt_io, uint16_t thr_idx);
|
||||
uint16_t packet_io_input(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void packet_io_output(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
uint16_t packet_io_ingress(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void packet_io_egress(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void packet_io_drop(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
uint16_t packet_io_inject(struct packet_io *pkt_io, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void packet_io_yield(struct packet_io *pkt_io, uint16_t thr_idx);
|
||||
|
||||
@@ -367,7 +367,7 @@ int pcap_io_init(void *handle __attribute__((unused)), uint16_t thr_idx __attrib
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t pcap_io_input(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
uint16_t pcap_io_ingress(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
{
|
||||
uint16_t nr_packet_parsed = 0;
|
||||
struct packet *pkt = NULL;
|
||||
@@ -404,7 +404,7 @@ uint16_t pcap_io_input(void *handle, uint16_t thr_idx, struct packet *pkts, uint
|
||||
return nr_packet_parsed;
|
||||
}
|
||||
|
||||
void pcap_io_output(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
void pcap_io_egress(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts)
|
||||
{
|
||||
int len;
|
||||
struct packet *pkt = NULL;
|
||||
|
||||
@@ -12,8 +12,8 @@ void pcap_io_free(void *handle);
|
||||
int pcap_io_isbreak(void *handle);
|
||||
|
||||
int pcap_io_init(void *handle, uint16_t thr_idx);
|
||||
uint16_t pcap_io_input(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void pcap_io_output(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
uint16_t pcap_io_ingress(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void pcap_io_egress(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void pcap_io_drop(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
uint16_t pcap_io_inject(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
|
||||
void pcap_io_yield(void *handle, uint16_t thr_idx);
|
||||
|
||||
@@ -177,7 +177,7 @@ static void *worker_thread(void *arg)
|
||||
* Suggestion: After modifying the system time, restart the service to ensure consistent timing.
|
||||
*/
|
||||
now_ms = clock_get_real_time_ms();
|
||||
nr_pkt_received = packet_io_input(packet_io, thr_idx, packets, RX_BURST_MAX);
|
||||
nr_pkt_received = packet_io_ingress(packet_io, thr_idx, packets, RX_BURST_MAX);
|
||||
if (nr_pkt_received == 0)
|
||||
{
|
||||
goto idle_tasks;
|
||||
@@ -260,12 +260,12 @@ static void *worker_thread(void *arg)
|
||||
{
|
||||
// TODO
|
||||
// copy meta from defraged_pkt to packets[i]
|
||||
packet_io_output(packet_io, thr_idx, &packets[i], 1);
|
||||
packet_io_egress(packet_io, thr_idx, &packets[i], 1);
|
||||
packet_free(defraged_pkt);
|
||||
}
|
||||
else
|
||||
{
|
||||
packet_io_output(packet_io, thr_idx, pkt, 1);
|
||||
packet_io_egress(packet_io, thr_idx, pkt, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -580,7 +580,7 @@ void stellar_send_build_packet(struct stellar *st, struct packet *pkt)
|
||||
{
|
||||
// TODO
|
||||
abort();
|
||||
packet_io_output(packet_io, thr_idx, pkt, 1);
|
||||
packet_io_egress(packet_io, thr_idx, pkt, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user