Skip to content

Commit

Permalink
improve net uio driver logging
Browse files Browse the repository at this point in the history
Signed-off-by: Bill Nguyen <[email protected]>
  • Loading branch information
dreamliner787-9 committed Nov 17, 2024
1 parent b8fe17e commit 93b9f2f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 38 deletions.
49 changes: 21 additions & 28 deletions examples/net/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,61 +33,54 @@ make MICROKIT_SDK=<absolute path to 1.4.1 SDK> MICROKIT_BOARD=odroidc4 MICROKIT_
### Boot
On a successful boot, your console will look like this:
```
[ 0.729626] Run /init as init process
[ 0.729712] with arguments:
[ 0.729781] /init
[ 0.729836] with environment:
[ 0.729905] HOME=/
[ 0.729962] TERM=linux
[ 0.730018] earlyprintk=serial
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Saving random seed: [ 4.917479] random: crng init done
Saving random seed: [ 4.917610] random: crng init done
OK
Starting network: OK
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 00:1e:06:4a:35:e4 brd ff:ff:ff:ff:ff:ff
[ 5.149491] meson8b-dwmac ff3f0000.ethernet eth0: PHY [mdio_mux-0.0:00] driver [RTL8211F Gigabit Ethernet] (irq=POLL)
[ 5.150105] meson8b-dwmac ff3f0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 5.157500] meson8b-dwmac ff3f0000.ethernet eth0: No Safety Features support found
[ 5.157641] meson8b-dwmac ff3f0000.ethernet eth0: PTP not supported by HW
[ 5.158049] meson8b-dwmac ff3f0000.ethernet eth0: configuring for phy/rgmii link mode
[ 10.308629] meson8b-dwmac ff3f0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[ 5.149624] meson8b-dwmac ff3f0000.ethernet eth0: PHY [mdio_mux-0.0:00] driver [RTL8211F Gigabit Ethernet] (irq=POLL)
[ 5.150295] meson8b-dwmac ff3f0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 5.157634] meson8b-dwmac ff3f0000.ethernet eth0: No Safety Features support found
[ 5.157800] meson8b-dwmac ff3f0000.ethernet eth0: PTP not supported by HW
[ 5.158231] meson8b-dwmac ff3f0000.ethernet eth0: configuring for phy/rgmii link mode
[ 10.312812] meson8b-dwmac ff3f0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
ethtool -K eth0 gso off
ethtool -K eth0 gro off
ethtool -K eth0 tx off rx off
UIO(NET): *** Starting up
UIO(NET): *** Network interface: eth0
UIO(NET): *** Setting up raw promiscuous socket
[ 13.203479] device eth0 entered promiscuous mode
[ 13.203873] device eth0 entered promiscuous mode
UIO(NET): *** Creating epoll
UIO(NET): *** Binding socket to epoll
UIO(NET): *** Mapping in sDDF control and data queues
UIO(NET): total control + data size is 0xe00000
UIO(NET): *** Total control + data size is 0xe00000
UIO(NET): *** Setting up sDDF control and data queues
UIO(NET): rx_free_drv = 0x0xffff989ae000
UIO(NET): rx_active_drv = 0x0xffff98bae000
UIO(NET): tx_free_drv = 0x0xffff98dae000
UIO(NET): tx_active_drv = 0x0xffff98fae000
UIO(NET): rx_data_drv = 0x0xffff991ae000
UIO(NET): tx_data_drv cli0 = 0x0xffff993ae000
UIO(NET): tx_data_drv cli1 = 0x0xffff995ae000
UIO(NET): *** rx_free_drv = 0xffff8d905000
UIO(NET): *** rx_active_drv = 0xffff8db05000
UIO(NET): *** tx_free_drv = 0xffff8dd05000
UIO(NET): *** tx_active_drv = 0xffff8df05000
UIO(NET): *** rx_data_drv = 0xffff8e105000
UIO(NET): *** tx_data_drv cli0 = 0xffff8e305000
UIO(NET): *** tx_data_drv cli1 = 0xffff8e505000
UIO(NET): *** Setting up UIO TX and RX interrupts from VMM "incoming"
UIO(NET): *** Binding UIO TX and RX incoming interrupts to epoll
UIO(NET): *** Setting up UIO data passing between VMM and us
UIO(NET): RX paddr: 0x0x8000000
UIO(NET): TX cli0 paddr: 0x0x8200000
UIO(NET): TX cli1 paddr: 0x0x8600000
UIO(NET): *** RX paddr: 0x8000000
UIO(NET): *** TX cli0 paddr: 0x8200000
UIO(NET): *** TX cli1 paddr: 0x8600000
UIO(NET): *** Setting up UIO TX and RX interrupts to VMM "outgoing"
UIO(NET): *** Waiting for RX virt to boot up
UIO(NET): *** All initialisation successful, now sending all pending TX active before we block on events
UIO(NET): *** All pending TX active have been sent thru the raw sock, entering event loop now.
UIO(NET): *** You won't see any output from UIO Net anymore. Unless there is a warning or error.
LWIP|NOTICE: DHCP request for client0 returned IP address: 172.16.1.250
LWIP|NOTICE: DHCP request for client1 returned IP address: 172.16.1.251
LWIP|NOTICE: DHCP request for client0 returned IP address: 172.16.1.218
LWIP|NOTICE: DHCP request for client1 returned IP address: 172.16.1.219
```

Though the MAC, IP and memory addreses would be different of course. There will be delay in the tens of seconds between the Linux userspace network driver initialisation and LWIP DHCP completion. This is due to all the components being able to initialise first before the guest can get to userspace. So LWIP will send many DHCP requests without success, with increasing timeout for each request.
20 changes: 10 additions & 10 deletions tools/linux/uio_drivers/net/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ int main(int argc, char **argv)

LOG_NET("*** Mapping in sDDF control and data queues\n");
uio_sddf_net_queues_fd = open_uio(UIO_PATH_SDDF_NET_CONTROL_AND_DATA_QUEUES);
// tx active+free + rx active+free common rx data and per client tx data
// tx active+free + rx active+free + common rx data and per client tx data
uint64_t sddf_net_control_and_data_size = (NET_DATA_REGION_BYTES * 4) + (NET_DATA_REGION_BYTES *
(1 + NUM_NETWORK_CLIENTS));
sddf_net_queues_vaddr = map_uio(sddf_net_control_and_data_size, uio_sddf_net_queues_fd);

LOG_NET("total control + data size is %p\n", sddf_net_control_and_data_size);
LOG_NET("*** Total control + data size is %p\n", sddf_net_control_and_data_size);

LOG_NET("*** Setting up sDDF control and data queues\n");
rx_free_drv = sddf_net_queues_vaddr;
Expand All @@ -336,13 +336,13 @@ int main(int argc, char **argv)
net_queue_init(&rx_queue, (net_queue_t *)rx_free_drv, (net_queue_t *)rx_active_drv, NET_RX_QUEUE_CAPACITY_DRIV);
net_queue_init(&tx_queue, (net_queue_t *)tx_free_drv, (net_queue_t *)tx_active_drv, NET_TX_QUEUE_CAPACITY_DRIV);

LOG_NET("rx_free_drv = 0x%p\n", rx_free_drv);
LOG_NET("rx_active_drv = 0x%p\n", rx_active_drv);
LOG_NET("tx_free_drv = 0x%p\n", tx_free_drv);
LOG_NET("tx_active_drv = 0x%p\n", tx_active_drv);
LOG_NET("rx_data_drv = 0x%p\n", rx_data_drv);
LOG_NET("*** rx_free_drv = %p\n", rx_free_drv);
LOG_NET("*** rx_active_drv = %p\n", rx_active_drv);
LOG_NET("*** tx_free_drv = %p\n", tx_free_drv);
LOG_NET("*** tx_active_drv = %p\n", tx_active_drv);
LOG_NET("*** rx_data_drv = %p\n", rx_data_drv);
for (int i = 0; i < NUM_NETWORK_CLIENTS; i++) {
LOG_NET("tx_data_drv cli%d = 0x%p\n", i, tx_datas_drv[i]);
LOG_NET("*** tx_data_drv cli%d = %p\n", i, tx_datas_drv[i]);
}

LOG_NET("*** Setting up UIO TX and RX interrupts from VMM \"incoming\"\n");
Expand All @@ -358,9 +358,9 @@ int main(int argc, char **argv)
LOG_NET("*** Setting up UIO data passing between VMM and us\n");
uio_sddf_vmm_net_info_passing_fd = open_uio(UIO_PATH_SDDF_NET_SHARED_DATA);
vmm_info_passing = (vmm_net_info_t *) map_uio(PAGE_SIZE_4K, uio_sddf_vmm_net_info_passing_fd);
LOG_NET("RX paddr: 0x%p\n", vmm_info_passing->rx_paddr);
LOG_NET("*** RX paddr: %p\n", vmm_info_passing->rx_paddr);
for (int i = 0; i < NUM_NETWORK_CLIENTS; i++) {
LOG_NET("TX cli%d paddr: 0x%p\n", i, vmm_info_passing->tx_paddrs[i]);
LOG_NET("*** TX cli%d paddr: %p\n", i, vmm_info_passing->tx_paddrs[i]);
}

LOG_NET("*** Setting up UIO TX and RX interrupts to VMM \"outgoing\"\n");
Expand Down

0 comments on commit 93b9f2f

Please sign in to comment.