diff options
| author | luwenpeng <[email protected]> | 2024-11-08 19:16:06 +0800 |
|---|---|---|
| committer | luwenpeng <[email protected]> | 2024-11-08 19:17:23 +0800 |
| commit | 8349a631e1a2542e3e7075b9c8f00e7d57337888 (patch) | |
| tree | 8d62f67fc3ea85fd2f7868b8353fab6fc869bffd /infra/packet_io | |
| parent | d0a868591470a4a9d71a65a5d540058e72c8d92c (diff) | |
rename: update session pool and packet pool API names for clarity
Diffstat (limited to 'infra/packet_io')
| -rw-r--r-- | infra/packet_io/mars_io.c | 8 | ||||
| -rw-r--r-- | infra/packet_io/pcap_io.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/infra/packet_io/mars_io.c b/infra/packet_io/mars_io.c index 6ce3de4..0dcec91 100644 --- a/infra/packet_io/mars_io.c +++ b/infra/packet_io/mars_io.c @@ -243,7 +243,7 @@ static void origin_free_cb(struct packet *pkt, void *args) stat->bytes_user_freed += packet_get_raw_len(pkt); marsio_buff_free(mars_io->mr_ins, &mbuff, 1, 0, origin->thr_idx); - packet_pool_push(pool, pkt); + packet_pool_release_packet(pool, pkt); } /****************************************************************************** @@ -408,7 +408,7 @@ int mars_io_recv(void *handle, uint16_t thr_idx, struct packet *pkts[], int nr_p } else { - pkt = packet_pool_pop(pool); + pkt = packet_pool_acquire_packet(pool); assert(pkt != NULL); struct packet_origin origin = { .type = ORIGIN_TYPE_MR, @@ -449,7 +449,7 @@ void mars_io_send(void *handle, uint16_t thr_idx, struct packet *pkts[], int nr_ mbuff = (marsio_buff_t *)origin->ctx; copy_metadata_to_mbuff(pkt, mbuff); marsio_send_burst(mars_io->mr_path, thr_idx, &mbuff, 1); - packet_pool_push(mars_io->pool[thr_idx], pkt); + packet_pool_release_packet(mars_io->pool[thr_idx], pkt); } else { @@ -501,7 +501,7 @@ void mars_io_drop(void *handle, uint16_t thr_idx, struct packet *pkts[], int nr_ { mbuff = (marsio_buff_t *)origin->ctx; marsio_buff_free(mars_io->mr_ins, &mbuff, 1, 0, thr_idx); - packet_pool_push(mars_io->pool[thr_idx], pkt); + packet_pool_release_packet(mars_io->pool[thr_idx], pkt); } else { diff --git a/infra/packet_io/pcap_io.c b/infra/packet_io/pcap_io.c index 8242a18..8d7090f 100644 --- a/infra/packet_io/pcap_io.c +++ b/infra/packet_io/pcap_io.c @@ -344,7 +344,7 @@ static void origin_free_cb(struct packet *pkt, void *args) stat->bytes_user_freed += packet_get_raw_len(pkt); free(pcap); - packet_pool_push(pool, pkt); + packet_pool_release_packet(pool, pkt); } /****************************************************************************** @@ -476,7 +476,7 @@ int pcap_io_recv(void *handle, uint16_t thr_idx, struct packet *pkts[], int nr_p stat->pkts_rx++; stat->bytes_rx += pcap->len; - pkt = packet_pool_pop(pool); + pkt = packet_pool_acquire_packet(pool); assert(pkt != NULL); struct packet_origin origin = { .type = ORIGIN_TYPE_PCAP, @@ -524,7 +524,7 @@ void pcap_io_send(void *handle, uint16_t thr_idx, struct packet *pkts[], int nr_ { pcap = (struct pcap_pkt *)origin->ctx; free(pcap); - packet_pool_push(pcap_io->pool[thr_idx], pkt); + packet_pool_release_packet(pcap_io->pool[thr_idx], pkt); } else { @@ -582,7 +582,7 @@ void pcap_io_drop(void *handle, uint16_t thr_idx, struct packet *pkts[], int nr_ { pcap = (struct pcap_pkt *)origin->ctx; free(pcap); - packet_pool_push(pcap_io->pool[thr_idx], pkt); + packet_pool_release_packet(pcap_io->pool[thr_idx], pkt); } else { |
