Lines Matching refs:pcap_q
239 struct pcap_rx_queue *pcap_q = queue; in eth_pcap_rx_infinite() local
245 if (rte_pktmbuf_alloc_bulk(pcap_q->mb_pool, bufs, nb_pkts) != 0) in eth_pcap_rx_infinite()
250 int err = rte_ring_dequeue(pcap_q->pkts, (void **)&pcap_buf); in eth_pcap_rx_infinite()
259 bufs[i]->port = pcap_q->port_id; in eth_pcap_rx_infinite()
263 rte_ring_enqueue(pcap_q->pkts, pcap_buf); in eth_pcap_rx_infinite()
266 pcap_q->rx_stat.pkts += i; in eth_pcap_rx_infinite()
267 pcap_q->rx_stat.bytes += rx_bytes; in eth_pcap_rx_infinite()
280 struct pcap_rx_queue *pcap_q = queue; in eth_pcap_rx() local
285 pp = rte_eth_devices[pcap_q->port_id].process_private; in eth_pcap_rx()
286 pcap = pp->rx_pcap[pcap_q->queue_id]; in eth_pcap_rx()
300 mbuf = rte_pktmbuf_alloc(pcap_q->mb_pool); in eth_pcap_rx()
302 pcap_q->rx_stat.rx_nombuf++; in eth_pcap_rx()
313 if (unlikely(eth_pcap_rx_jumbo(pcap_q->mb_pool, in eth_pcap_rx()
317 pcap_q->rx_stat.err_pkts++; in eth_pcap_rx()
329 mbuf->port = pcap_q->port_id; in eth_pcap_rx()
334 pcap_q->rx_stat.pkts += num_rx; in eth_pcap_rx()
335 pcap_q->rx_stat.bytes += rx_bytes; in eth_pcap_rx()
582 count_packets_in_pcap(pcap_t **pcap, struct pcap_rx_queue *pcap_q) in count_packets_in_pcap() argument
594 open_single_rx_pcap(pcap_q->name, pcap); in count_packets_in_pcap()
840 struct pcap_rx_queue *pcap_q = &internals->rx_queue[i]; in eth_dev_close() local
846 if (pcap_q->pkts == NULL) in eth_dev_close()
849 infinite_rx_ring_free(pcap_q->pkts); in eth_dev_close()
876 struct pcap_rx_queue *pcap_q = &internals->rx_queue[rx_queue_id]; in eth_rx_queue_setup() local
878 pcap_q->mb_pool = mb_pool; in eth_rx_queue_setup()
879 pcap_q->port_id = dev->data->port_id; in eth_rx_queue_setup()
880 pcap_q->queue_id = rx_queue_id; in eth_rx_queue_setup()
881 dev->data->rx_queues[rx_queue_id] = pcap_q; in eth_rx_queue_setup()
891 pp = rte_eth_devices[pcap_q->port_id].process_private; in eth_rx_queue_setup()
892 pcap = &pp->rx_pcap[pcap_q->queue_id]; in eth_rx_queue_setup()
897 pcap_pkt_count = count_packets_in_pcap(pcap, pcap_q); in eth_rx_queue_setup()
902 pcap_q->pkts = rte_ring_create(ring_name, in eth_rx_queue_setup()
906 if (!pcap_q->pkts) in eth_rx_queue_setup()
910 while (eth_pcap_rx(pcap_q, bufs, 1)) { in eth_rx_queue_setup()
913 infinite_rx_ring_free(pcap_q->pkts); in eth_rx_queue_setup()
919 rte_ring_enqueue_bulk(pcap_q->pkts, in eth_rx_queue_setup()
923 if (rte_ring_count(pcap_q->pkts) < pcap_pkt_count) { in eth_rx_queue_setup()
924 infinite_rx_ring_free(pcap_q->pkts); in eth_rx_queue_setup()
936 pcap_q->rx_stat.pkts = 0; in eth_rx_queue_setup()
937 pcap_q->rx_stat.bytes = 0; in eth_rx_queue_setup()
951 struct pcap_tx_queue *pcap_q = &internals->tx_queue[tx_queue_id]; in eth_tx_queue_setup() local
953 pcap_q->port_id = dev->data->port_id; in eth_tx_queue_setup()
954 pcap_q->queue_id = tx_queue_id; in eth_tx_queue_setup()
955 dev->data->tx_queues[tx_queue_id] = pcap_q; in eth_tx_queue_setup()