Modify some code of KNI support virtio_user.

This commit is contained in:
fengbojiang 2023-09-19 18:38:17 +08:00
parent ba2a7fe957
commit 51c6fbd66b
2 changed files with 3 additions and 3 deletions

View File

@ -582,7 +582,7 @@ init_port_start(void)
#ifdef FF_KNI
if (enable_kni && rte_eal_process_type() == RTE_PROC_PRIMARY) {
#ifdef FF_KNI_KNI
if (ff_global_cfg.kni.type == 1)
if (ff_global_cfg.kni.type == KNI_TYPE_VIRTIO)
#endif
{
total_nb_ports *= 2; /* one more virtio_user port for kernel per port */

View File

@ -571,7 +571,7 @@ ff_kni_alloc(uint16_t port_id, unsigned socket_id, int type, int port_idx,
printf("create kni on port %u success!\n", port_id);
kni_stat[port_id]->port_id = port_id;
}else if (type == KNI_TYPE_VIRTIO)
} else if (type == KNI_TYPE_VIRTIO)
#endif
{
/*
@ -623,7 +623,7 @@ ff_kni_process(uint16_t port_id, uint16_t queue_id,
struct rte_mbuf **pkts_burst, unsigned count)
{
kni_process_tx(port_id, queue_id, pkts_burst, count);
kni_process_rx(port_id, queue_id,pkts_burst, count);
kni_process_rx(port_id, queue_id, pkts_burst, count);
}
/* enqueue the packet, and own it */