Beispiel #1
0
unsigned
rw_piot_kni_tx_burst(struct rte_kni *kni,
                     struct rte_mbuf **mbufs, 
                     unsigned num)
{
  return(rte_kni_tx_burst(kni, mbufs, num));
}
Beispiel #2
0
static void
kni_ring_to_kni(struct kni_port_params *p)
{
	uint8_t i, port_id;
	unsigned nb_rx, num;
	struct rte_mbuf *pkts_burst[PKT_BURST_SZ];

	if (p == NULL)
		return;

	port_id = p->port_id;

	/* Burst rx from ring */
	nb_rx = rte_ring_dequeue_burst(p->ring,(void **)&pkts_burst, PKT_BURST_SZ);

	if (unlikely(nb_rx > PKT_BURST_SZ)) {
		RTE_LOG(ERR, APP, "Error receiving from eth\n");
	return;
	}

	/* Burst tx to kni */
	num = rte_kni_tx_burst(p->kni, pkts_burst, nb_rx);
	//kni_stats[port_id].rx_packets += num;

	rte_kni_handle_request(p->kni);
	if (unlikely(num < nb_rx)) {
		/* Free mbufs not tx to kni interface */
		kni_burst_free_mbufs(&pkts_burst[num], nb_rx - num);
		//kni_stats[port_id].rx_dropped += nb_rx - num;
	}

	return;
}
static inline void
send_burst(struct dpdk_knidev_writer *p)
{
    uint32_t nb_tx;

    nb_tx = rte_kni_tx_burst(p->kni, p->tx_buf, p->tx_buf_count);

    DPDK_KNIDEV_WRITER_STATS_PKTS_DROP_ADD(p, p->tx_buf_count - nb_tx);
    for ( ; nb_tx < p->tx_buf_count; nb_tx++)
        /* TODO: a separate counter for this drop */
        vr_dpdk_pfree(p->tx_buf[nb_tx], VP_DROP_INTERFACE_DROP);

    p->tx_buf_count = 0;
}
Beispiel #4
0
/*
 * Enqueue single packet to a KNI fifo
 */
static void
send_to_kni(uint8_t vportid, struct rte_mbuf *buf)
{
	int i = 0;
	int rslt = 0;
	struct kni_port *kp = NULL;
	struct statistics *s = NULL;

	s = &vport_stats[vportid];

	rslt = rte_kni_tx_burst(&rte_kni_list[vportid & KNI_MASK], &buf, 1);
	/* FIFO is full */
	if (rslt == 0) {
		rte_pktmbuf_free(buf);
		s->rx_drop++;
		switch_tx_drop++;
	} else {
		s->rx++;
	}
}
Beispiel #5
0
uint16_t kni_dev_tx_burst(uint8_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
{
	return rte_kni_tx_burst(dev_list[port_id]->kni, tx_pkts, nb_pkts);
}
Beispiel #6
0
unsigned mg_kni_tx_single(struct rte_kni * kni, struct rte_mbuf * mbuf){
  return rte_kni_tx_burst(kni, &mbuf, 1);
}