From 8c0a847822edcc98a409d13511b70c50748a2301 Mon Sep 17 00:00:00 2001 From: fengbojiang Date: Fri, 18 Jun 2021 11:04:49 +0800 Subject: [PATCH 1/5] fix config.ini. --- config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.ini b/config.ini index 598120417..870940609 100644 --- a/config.ini +++ b/config.ini @@ -93,7 +93,7 @@ gateway=192.168.1.1 # Multi virtual IPv4/IPv6 net addr, Optional parameters. # `vip_ifname`: default `f-stack-x` # `vip_addr`: Separated by semicolons, MAX number 64; - Only support netmask 255.255.255.255, broadcast x.x.x.255 now, hard code in `ff_veth_setvaddr`. +# Only support netmask 255.255.255.255, broadcast x.x.x.255 now, hard code in `ff_veth_setvaddr`. # `vip_addr6`: Separated by semicolons, MAX number 64. # `vip_prefix_len`: All addr6 use the same prefix now, default 64. #vip_ifname=lo0 From 42f4b806a7f51324c9ca5bae3f388dbcb7023563 Mon Sep 17 00:00:00 2001 From: Chenzs108 Date: Wed, 23 Jun 2021 13:52:13 +0100 Subject: [PATCH 2/5] Docs: Fix the path of `igb_uio.c` and line number --- doc/F-Stack_Build_Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/F-Stack_Build_Guide.md b/doc/F-Stack_Build_Guide.md index 9d70b97f7..41810febe 100644 --- a/doc/F-Stack_Build_Guide.md +++ b/doc/F-Stack_Build_Guide.md @@ -65,7 +65,7 @@ $ make ## Compile dpdk in virtual machine -- f-stack/dpdk/lib/librte_eal/linuxapp/igb_uio/igb_uio.c line 279: +- f-stack/dpdk/kernel/linux/igb_uio/igb_uio.c line 274: ``` - if (pci_intx_mask_supported(udev->pdev)) { From 0b4a084c8a5fa4b13888108b1164f3382de5129e Mon Sep 17 00:00:00 2001 From: fengbojiang Date: Thu, 2 Sep 2021 11:47:13 +0800 Subject: [PATCH 3/5] fix a plurality of packets may not statistics in ff_traffic.rx_packets and ff_traffic.rx_bytes. --- lib/ff_dpdk_if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ff_dpdk_if.c b/lib/ff_dpdk_if.c index 3152d761e..3bb75db37 100644 --- a/lib/ff_dpdk_if.c +++ b/lib/ff_dpdk_if.c @@ -1281,8 +1281,8 @@ process_packets(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **bufs, uint16_t len = rte_pktmbuf_data_len(rtem); if (!pkts_from_ring) { - ff_traffic.rx_packets++; - ff_traffic.rx_bytes += len; + ff_traffic.rx_packets += rtem->nb_segs; + ff_traffic.rx_bytes += rte_pktmbuf_pkt_len(rtem); } if (!pkts_from_ring && packet_dispatcher) { From 0508c8b8ec567df217d39ef70614f263f7fb17a0 Mon Sep 17 00:00:00 2001 From: fengbojiang Date: Thu, 2 Sep 2021 12:04:32 +0800 Subject: [PATCH 4/5] The CPU usage of packet_dispatcher() is modified to usr. --- lib/ff_dpdk_if.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ff_dpdk_if.c b/lib/ff_dpdk_if.c index 3bb75db37..d7f5d84b1 100644 --- a/lib/ff_dpdk_if.c +++ b/lib/ff_dpdk_if.c @@ -77,6 +77,7 @@ static int numa_on; static unsigned idle_sleep; static unsigned pkt_tx_delay; +static uint64_t usr_cb_tsc; static struct rte_timer freebsd_clock; @@ -1286,7 +1287,9 @@ process_packets(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **bufs, } if (!pkts_from_ring && packet_dispatcher) { + uint64_t cur_tsc = rte_rdtsc(); int ret = (*packet_dispatcher)(data, &len, queue_id, nb_queues); + usr_cb_tsc += rte_rdtsc() - cur_tsc; if (ret == FF_DISPATCH_RESPONSE) { rte_pktmbuf_pkt_len(rtem) = rte_pktmbuf_data_len(rtem) = len; @@ -1844,6 +1847,7 @@ main_loop(void *arg) idle = 1; sys_tsc = 0; usr_tsc = 0; + usr_cb_tsc = 0; /* * TX burst queue drain @@ -1925,12 +1929,13 @@ main_loop(void *arg) end_tsc = idle_sleep_tsc; } + usr_tsc = usr_cb_tsc; if (usch_tsc == cur_tsc) { - usr_tsc = idle_sleep_tsc - div_tsc; + usr_tsc += idle_sleep_tsc - div_tsc; } if (!idle) { - sys_tsc = div_tsc - cur_tsc; + sys_tsc = div_tsc - cur_tsc - usr_cb_tsc; ff_top_status.sys_tsc += sys_tsc; } From 81dd6c7a2431831e26a4d856052c87201c994c10 Mon Sep 17 00:00:00 2001 From: fengbojiang Date: Thu, 2 Sep 2021 12:09:09 +0800 Subject: [PATCH 5/5] If process_dispatch_ring() has data packet to be processed and it is considered non-idle state. --- lib/ff_dpdk_if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ff_dpdk_if.c b/lib/ff_dpdk_if.c index d7f5d84b1..47f5a2d78 100644 --- a/lib/ff_dpdk_if.c +++ b/lib/ff_dpdk_if.c @@ -1402,7 +1402,7 @@ process_dispatch_ring(uint16_t port_id, uint16_t queue_id, process_packets(port_id, queue_id, pkts_burst, nb_rb, ctx, 1); } - return 0; + return nb_rb; } static inline void @@ -1884,7 +1884,7 @@ main_loop(void *arg) } #endif - process_dispatch_ring(port_id, queue_id, pkts_burst, ctx); + idle &= !process_dispatch_ring(port_id, queue_id, pkts_burst, ctx); nb_rx = rte_eth_rx_burst(port_id, queue_id, pkts_burst, MAX_PKT_BURST);