From ffe224e7e93e9683ac04a68772b8c874913c5c7d Mon Sep 17 00:00:00 2001 From: jimmylu890303 Date: Sat, 20 Jul 2024 13:15:17 +0800 Subject: [PATCH 1/6] Define virtio-net header - Define `VIRTIO_NET_IRQ` macro for the `notify_used` virtq callback function to send IRQ - Define `VIRTIO_PCI_DEVICE_ID_NET` (0x1041) according to the Virtio 1.1 specification - Define `VIRTIO_NET_PCI_CLASS` macro according to the PCI specification with class code (0x020000) for Ethernet Controller - Define struct `virtio_net_dev` and operation functions for the virtio-net device --- src/arch/x86/desc.h | 1 + src/virtio-net.h | 30 ++++++++++++++++++++++++++++++ src/virtio-pci.h | 1 + 3 files changed, 32 insertions(+) create mode 100644 src/virtio-net.h diff --git a/src/arch/x86/desc.h b/src/arch/x86/desc.h index b2933cc..2960c51 100644 --- a/src/arch/x86/desc.h +++ b/src/arch/x86/desc.h @@ -2,5 +2,6 @@ #define RAM_BASE 0 #define SERIAL_IRQ 4 +#define VIRTIO_NET_IRQ 14 #define VIRTIO_BLK_IRQ 15 #define KERNEL_OPTS "console=ttyS0 pci=conf1" diff --git a/src/virtio-net.h b/src/virtio-net.h new file mode 100644 index 0000000..8f1797e --- /dev/null +++ b/src/virtio-net.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include "pci.h" +#include "virtio-pci.h" +#include "virtq.h" + +#define VIRTIO_NET_VIRTQ_NUM 2 +#define VIRTIO_NET_PCI_CLASS 0x020000 + +struct virtio_net_dev { + struct virtio_pci_dev virtio_pci_dev; + struct virtio_net_config config; + struct virtq vq[VIRTIO_NET_VIRTQ_NUM]; + int tapfd; + int irqfd; + int rx_ioeventfd; + int tx_ioeventfd; + int irq_num; + pthread_t rx_thread; + pthread_t tx_thread; + bool enable; +}; + +bool virtio_net_init(struct virtio_net_dev *virtio_net_dev); +void virtio_net_exit(struct virtio_net_dev *virtio_net_dev); +void virtio_net_init_pci(struct virtio_net_dev *virtio_net_dev, + struct pci *pci, + struct bus *io_bus, + struct bus *mmio_bus); diff --git a/src/virtio-pci.h b/src/virtio-pci.h index bb04153..903d1de 100644 --- a/src/virtio-pci.h +++ b/src/virtio-pci.h @@ -6,6 +6,7 @@ #include "virtq.h" #define VIRTIO_PCI_VENDOR_ID 0x1AF4 +#define VIRTIO_PCI_DEVICE_ID_NET 0x1041 #define VIRTIO_PCI_DEVICE_ID_BLK 0x1042 #define VIRTIO_PCI_CAP_NUM 5 #define VIRTIO_PCI_ISR_QUEUE 1 From e0477f9ab5f3aecdb032bd27cd66133c31589871 Mon Sep 17 00:00:00 2001 From: jimmylu890303 Date: Sun, 21 Jul 2024 21:54:12 +0800 Subject: [PATCH 2/6] Implement Virtio-net Device Operations and Initialization - Defined struct `virtio_net_dev` to represent the virtio-net device. - Implemented `virtio_net_init` to initialize the TAP device and prepare it for communication. - Added `virtio_net_init_pci` for registering the virtio-net device to PCI, setting up virtqueues. - Implemented functions to enable and handle available events for RX and TX virtqueues. - Added functions to notify the guest OS about used descriptors after packet processing. --- src/virtio-net.c | 285 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 src/virtio-net.c diff --git a/src/virtio-net.c b/src/virtio-net.c new file mode 100644 index 0000000..ecd3434 --- /dev/null +++ b/src/virtio-net.c @@ -0,0 +1,285 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "err.h" +#include "utils.h" +#include "virtio-net.h" +#include "vm.h" + +#define TAP_INTERFACE "tap%d" +#define VIRTQ_RX 0 +#define VIRTQ_TX 1 +#define NOTIFY_OFFSET 2 + +static volatile bool thread_stop = false; + +static int virtio_net_virtq_available_rx(struct virtio_net_dev *dev, + int timeout) +{ + struct pollfd pollfd = (struct pollfd){ + .fd = dev->tapfd, + .events = POLLIN, + }; + return (poll(&pollfd, 1, timeout) > 0) && (pollfd.revents & POLLIN); +} + +static int virtio_net_virtq_available_tx(struct virtio_net_dev *dev, + int timeout) +{ + struct pollfd pollfds[] = { + [0] = {.fd = dev->tx_ioeventfd, .events = POLLIN}, + [1] = {.fd = dev->tapfd, .events = POLLOUT}, + }; + + int ret = poll(pollfds, 2, timeout); + + return ret > 0 && (pollfds[0].revents & POLLIN) && + (pollfds[1].revents & POLLOUT); +} + +static void *virtio_net_vq_avail_handler_rx(void *arg) +{ + struct virtq *vq = (struct virtq *) arg; + struct virtio_net_dev *dev = (struct virtio_net_dev *) vq->dev; + + while (!__atomic_load_n(&thread_stop, __ATOMIC_RELAXED)) { + vq->guest_event->flags = VRING_PACKED_EVENT_FLAG_ENABLE; + if (virtio_net_virtq_available_rx(dev, -1)) + virtq_handle_avail(vq); + } + return NULL; +} + +static void *virtio_net_vq_avail_handler_tx(void *arg) +{ + struct virtq *vq = (struct virtq *) arg; + struct virtio_net_dev *dev = (struct virtio_net_dev *) vq->dev; + + while (!__atomic_load_n(&thread_stop, __ATOMIC_RELAXED)) { + vq->guest_event->flags = VRING_PACKED_EVENT_FLAG_ENABLE; + if (virtio_net_virtq_available_tx(dev, -1)) + virtq_handle_avail(vq); + } + return NULL; +} + +static void virtio_net_enable_vq_rx(struct virtq *vq) +{ + struct virtio_net_dev *dev = (struct virtio_net_dev *) vq->dev; + vm_t *v = container_of(dev, vm_t, virtio_net_dev); + + if (vq->info.enable) + return; + vq->info.enable = true; + vq->desc_ring = + (struct vring_packed_desc *) vm_guest_to_host(v, vq->info.desc_addr); + vq->device_event = (struct vring_packed_desc_event *) vm_guest_to_host( + v, vq->info.device_addr); + vq->guest_event = (struct vring_packed_desc_event *) vm_guest_to_host( + v, vq->info.driver_addr); + uint64_t addr = virtio_pci_get_notify_addr(&dev->virtio_pci_dev, vq); + vm_ioeventfd_register(v, dev->rx_ioeventfd, addr, NOTIFY_OFFSET, 0); + pthread_create(&dev->rx_thread, NULL, virtio_net_vq_avail_handler_rx, + (void *) vq); +} + +static void virtio_net_enable_vq_tx(struct virtq *vq) +{ + struct virtio_net_dev *dev = (struct virtio_net_dev *) vq->dev; + vm_t *v = container_of(dev, vm_t, virtio_net_dev); + + if (vq->info.enable) + return; + vq->info.enable = true; + vq->desc_ring = + (struct vring_packed_desc *) vm_guest_to_host(v, vq->info.desc_addr); + vq->device_event = (struct vring_packed_desc_event *) vm_guest_to_host( + v, vq->info.device_addr); + vq->guest_event = (struct vring_packed_desc_event *) vm_guest_to_host( + v, vq->info.driver_addr); + + uint64_t addr = virtio_pci_get_notify_addr(&dev->virtio_pci_dev, vq); + vm_ioeventfd_register(v, dev->tx_ioeventfd, addr, NOTIFY_OFFSET, 0); + pthread_create(&dev->tx_thread, NULL, virtio_net_vq_avail_handler_tx, + (void *) vq); +} + +static void virtio_net_notify_used_rx(struct virtq *vq) +{ + struct virtio_net_dev *dev = (struct virtio_net_dev *) vq->dev; + uint64_t n = 1; + if (write(dev->irqfd, &n, sizeof(n)) < 0) + throw_err("Failed to write the irqfd"); +} + +static void virtio_net_notify_used_tx(struct virtq *vq) +{ + struct virtio_net_dev *dev = (struct virtio_net_dev *) vq->dev; + uint64_t n = 1; + + if (write(dev->irqfd, &n, sizeof(n)) < 0) + throw_err("Failed to write the irqfd"); +} + +void virtio_net_complete_request_rx(struct virtq *vq) +{ + struct virtio_net_dev *dev = (struct virtio_net_dev *) vq->dev; + vm_t *v = container_of(dev, vm_t, virtio_net_dev); + struct vring_packed_desc *desc; + + while ((desc = virtq_get_avail(vq)) != NULL) { + uint8_t *data = vm_guest_to_host(v, desc->addr); + struct virtio_net_hdr_v1 *virtio_hdr = + (struct virtio_net_hdr_v1 *) data; + memset(virtio_hdr, 0, sizeof(struct virtio_net_hdr_v1)); + + virtio_hdr->num_buffers = 1; + + size_t virtio_header_len = sizeof(struct virtio_net_hdr_v1); + ssize_t read_bytes = read(dev->tapfd, data + virtio_header_len, + desc->len - virtio_header_len); + if (read_bytes < 0) { + vq->guest_event->flags = VRING_PACKED_EVENT_FLAG_DISABLE; + return; + } + desc->len = virtio_header_len + read_bytes; + + desc->flags ^= (1ULL << VRING_PACKED_DESC_F_USED); + dev->virtio_pci_dev.config.isr_cap.isr_status |= VIRTIO_PCI_ISR_QUEUE; + return; + } + vq->guest_event->flags = VRING_PACKED_EVENT_FLAG_DISABLE; + return; +} + +void virtio_net_complete_request_tx(struct virtq *vq) +{ + struct virtio_net_dev *dev = (struct virtio_net_dev *) vq->dev; + vm_t *v = container_of(dev, vm_t, virtio_net_dev); + struct vring_packed_desc *desc; + while ((desc = virtq_get_avail(vq)) != NULL) { + uint8_t *data = vm_guest_to_host(v, desc->addr); + size_t virtio_header_len = sizeof(struct virtio_net_hdr_v1); + + if (desc->len < virtio_header_len) { + vq->guest_event->flags = VRING_PACKED_EVENT_FLAG_DISABLE; + return; + } + + uint8_t *actual_data = data + virtio_header_len; + size_t actual_data_len = desc->len - virtio_header_len; + + struct iovec iov[1]; + iov[0].iov_base = actual_data; + iov[0].iov_len = actual_data_len; + + ssize_t write_bytes = writev(dev->tapfd, iov, 1); + if (write_bytes < 0) { + vq->guest_event->flags = VRING_PACKED_EVENT_FLAG_DISABLE; + return; + } + desc->flags ^= (1ULL << VRING_PACKED_DESC_F_USED); + dev->virtio_pci_dev.config.isr_cap.isr_status |= VIRTIO_PCI_ISR_QUEUE; + return; + } + vq->guest_event->flags = VRING_PACKED_EVENT_FLAG_DISABLE; + return; +} + +static struct virtq_ops virtio_net_ops[VIRTIO_NET_VIRTQ_NUM] = { + [VIRTQ_RX] = {.enable_vq = virtio_net_enable_vq_rx, + .complete_request = virtio_net_complete_request_rx, + .notify_used = virtio_net_notify_used_rx}, + [VIRTQ_TX] = {.enable_vq = virtio_net_enable_vq_tx, + .complete_request = virtio_net_complete_request_tx, + .notify_used = virtio_net_notify_used_tx}, +}; + +bool virtio_net_init(struct virtio_net_dev *virtio_net_dev) +{ + memset(virtio_net_dev, 0x00, sizeof(struct virtio_net_dev)); + + virtio_net_dev->tapfd = open("/dev/net/tun", O_RDWR); + if (virtio_net_dev->tapfd < 0) { + return false; + } + struct ifreq ifreq = {.ifr_flags = IFF_TAP | IFF_NO_PI}; + strncpy(ifreq.ifr_name, TAP_INTERFACE, sizeof(ifreq.ifr_name)); + if (ioctl(virtio_net_dev->tapfd, TUNSETIFF, &ifreq) < 0) { + fprintf(stderr, "failed to allocate TAP device: %s\n", strerror(errno)); + close(virtio_net_dev->tapfd); + return false; + } + int flags = fcntl(virtio_net_dev->tapfd, F_GETFL, 0); + flags |= O_NONBLOCK; + if (fcntl(virtio_net_dev->tapfd, F_SETFL, flags) == -1) { + fprintf(stderr, "failed to set flags on TAP device: %s\n", + strerror(errno)); + close(virtio_net_dev->tapfd); + return false; + } + return true; +} + +static void virtio_net_setup(struct virtio_net_dev *dev) +{ + vm_t *v = container_of(dev, vm_t, virtio_net_dev); + + dev->enable = true; + dev->irq_num = VIRTIO_NET_IRQ; + dev->rx_ioeventfd = eventfd(0, EFD_CLOEXEC); + dev->tx_ioeventfd = eventfd(0, EFD_CLOEXEC); + dev->irqfd = eventfd(0, EFD_CLOEXEC); + vm_irqfd_register(v, dev->irqfd, dev->irq_num, 0); + for (int i = 0; i < VIRTIO_NET_VIRTQ_NUM; i++) { + struct virtq_ops *ops = &virtio_net_ops[i]; + dev->vq[i].info.notify_off = i; + virtq_init(&dev->vq[i], dev, ops); + } +} + +void virtio_net_init_pci(struct virtio_net_dev *virtio_net_dev, + struct pci *pci, + struct bus *io_bus, + struct bus *mmio_bus) +{ + struct virtio_pci_dev *dev = &virtio_net_dev->virtio_pci_dev; + virtio_net_setup(virtio_net_dev); + virtio_pci_init(dev, pci, io_bus, mmio_bus); + virtio_pci_set_dev_cfg(dev, &virtio_net_dev->config, + sizeof(virtio_net_dev->config)); + virtio_pci_set_pci_hdr(dev, VIRTIO_PCI_DEVICE_ID_NET, VIRTIO_NET_PCI_CLASS, + virtio_net_dev->irq_num); + dev->notify_cap->notify_off_multiplier = NOTIFY_OFFSET; + virtio_pci_set_virtq(dev, virtio_net_dev->vq, VIRTIO_NET_VIRTQ_NUM); + + virtio_pci_add_feature(dev, VIRTIO_NET_F_MQ); + virtio_pci_enable(dev); +} + +void virtio_net_exit(struct virtio_net_dev *dev) +{ + if (!dev->enable) + return; + __atomic_store_n(&thread_stop, true, __ATOMIC_RELAXED); + pthread_join(dev->rx_thread, NULL); + pthread_join(dev->tx_thread, NULL); + virtio_pci_exit(&dev->virtio_pci_dev); + close(dev->irqfd); + close(dev->rx_ioeventfd); + close(dev->tx_ioeventfd); + close(dev->tapfd); +} From 79d0a3ed1e616428ed3dd25b9b1d7dba33c10ca1 Mon Sep 17 00:00:00 2001 From: jimmylu890303 Date: Sat, 20 Jul 2024 13:15:17 +0800 Subject: [PATCH 3/6] Remove Initial Value for vq->info.notify_off in virtio-net This commit removes the initialization of vq->info.notify_off value in the virtio-net implementation. The reason for this change is that during the execution of RX and TX enable callback functions, the `vm_ioeventfd_register` function registers the ioeventfd at the same address repeatly. Therefore, the notify_off value is now initialized directly within the virtqueue enable callback functions. --- src/virtq.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/virtq.c b/src/virtq.c index 494b691..3550624 100644 --- a/src/virtq.c +++ b/src/virtq.c @@ -25,7 +25,6 @@ void virtq_disable(struct virtq *vq) {} void virtq_init(struct virtq *vq, void *dev, struct virtq_ops *ops) { vq->info.size = VIRTQ_SIZE; - vq->info.notify_off = 0; vq->info.enable = 0; vq->next_avail_idx = 0; vq->used_wrap_count = 1; From d87e2dcd6717c21ea0bbe9ce6a1e72e338e8c160 Mon Sep 17 00:00:00 2001 From: jimmylu890303 Date: Sat, 20 Jul 2024 13:15:17 +0800 Subject: [PATCH 4/6] Add struct virtio_net_dev Entry in struct vm_t This commit adds a struct `virtio_net_dev` entry within the struct `vm_t` structure to facilitate the implementation of the virtio-net device. This addition is necessary to integrate and manage the virtio-net device within the broader context of the virtual machine. --- src/vm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vm.h b/src/vm.h index 4e9c5c4..0e66d53 100644 --- a/src/vm.h +++ b/src/vm.h @@ -5,6 +5,7 @@ #include "pci.h" #include "serial.h" #include "virtio-blk.h" +#include "virtio-net.h" typedef struct { int kvm_fd, vm_fd, vcpu_fd; @@ -15,6 +16,7 @@ typedef struct { struct pci pci; struct diskimg diskimg; struct virtio_blk_dev virtio_blk_dev; + struct virtio_net_dev virtio_net_dev; void *priv; } vm_t; From 04548f7c83e59c2c6ac93c2e12764b2a9c8f21fb Mon Sep 17 00:00:00 2001 From: jimmylu890303 Date: Mon, 22 Jul 2024 02:00:35 +0800 Subject: [PATCH 5/6] Implement vm_enable_net API The vm_enable_net function to facilitate the integration of additional I/O devices in the future. The function initializes the virtio-net device by setting up the tap device using virtio_net_init and subsequently registers the virtio-net device with the PCI bus. This function is invoked during the VM initialization session. --- Makefile | 1 + src/main.c | 2 ++ src/vm.c | 8 ++++++++ src/vm.h | 1 + 4 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index cb6c1ac..09d5917 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ OBJS := \ virtio-pci.o \ virtq.o \ virtio-blk.o \ + virtio-net.o \ diskimg.o \ main.o diff --git a/src/main.c b/src/main.c index d26d9a3..3e1ad22 100644 --- a/src/main.c +++ b/src/main.c @@ -93,6 +93,8 @@ int main(int argc, char *argv[]) return throw_err("Failed to load initrd"); if (diskimg_file && vm_load_diskimg(&vm, diskimg_file) < 0) return throw_err("Failed to load disk image"); + if (vm_enable_net(&vm) < 0) + fprintf(stderr, "Failed to enable virtio-net device\n"); if (vm_late_init(&vm) < 0) return -1; diff --git a/src/vm.c b/src/vm.c index a88b386..92a0fca 100644 --- a/src/vm.c +++ b/src/vm.c @@ -97,6 +97,14 @@ int vm_load_diskimg(vm_t *v, const char *diskimg_file) return 0; } +int vm_enable_net(vm_t *v) +{ + if (!virtio_net_init(&v->virtio_net_dev)) + return -1; + virtio_net_init_pci(&v->virtio_net_dev, &v->pci, &v->io_bus, &v->mmio_bus); + return 0; +} + void vm_handle_io(vm_t *v, struct kvm_run *run) { uint64_t addr = run->io.port; diff --git a/src/vm.h b/src/vm.h index 0e66d53..5ebd9d3 100644 --- a/src/vm.h +++ b/src/vm.h @@ -31,6 +31,7 @@ int vm_load_image(vm_t *v, const char *image_path); int vm_load_initrd(vm_t *v, const char *initrd_path); int vm_load_diskimg(vm_t *v, const char *diskimg_file); int vm_late_init(vm_t *v); +int vm_enable_net(vm_t *v); int vm_run(vm_t *v); int vm_irq_line(vm_t *v, int irq, int level); void *vm_guest_to_host(vm_t *v, uint64_t guest); From f727c6efbb408af7f0436b55bdf89fb44899afac Mon Sep 17 00:00:00 2001 From: jimmylu890303 Date: Sun, 21 Jul 2024 20:43:52 +0800 Subject: [PATCH 6/6] Enable necessary kernel networking options for virtio-net device Enabled kernel configuration options required for networking functionality,including `CONFIG_NET`,`CONFIG_INET`,`CONFIG_VIRTIO`, `CONFIG_VIRTIO_NET`,`CONFIG_NETDEVICES` etc. Additionally, enabled specific networking commacands necessary for testing the virtio-net device. --- configs/busybox.config | 87 ++++++++++++++++++++-------------------- configs/linux-x86.config | 14 ++++++- 2 files changed, 57 insertions(+), 44 deletions(-) diff --git a/configs/busybox.config b/configs/busybox.config index 2c68f16..509281c 100644 --- a/configs/busybox.config +++ b/configs/busybox.config @@ -849,14 +849,14 @@ CONFIG_TREE=y # # CONFIG_FEATURE_IPV6 is not set # CONFIG_FEATURE_UNIX_LOCAL is not set -# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set +CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y # CONFIG_VERBOSE_RESOLUTION_ERRORS is not set # CONFIG_FEATURE_ETC_NETWORKS is not set # CONFIG_FEATURE_ETC_SERVICES is not set # CONFIG_FEATURE_HWIB is not set # CONFIG_FEATURE_TLS_SHA1 is not set -# CONFIG_ARP is not set -# CONFIG_ARPING is not set +CONFIG_ARP=y +CONFIG_ARPING=y # CONFIG_BRCTL is not set # CONFIG_FEATURE_BRCTL_FANCY is not set # CONFIG_FEATURE_BRCTL_SHOW is not set @@ -869,7 +869,7 @@ CONFIG_TREE=y # CONFIG_FTPGET is not set # CONFIG_FTPPUT is not set # CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set -# CONFIG_HOSTNAME is not set +CONFIG_HOSTNAME=y # CONFIG_DNSDOMAINNAME is not set # CONFIG_HTTPD is not set CONFIG_FEATURE_HTTPD_PORT_DEFAULT=0 @@ -888,21 +888,21 @@ CONFIG_FEATURE_HTTPD_PORT_DEFAULT=0 # CONFIG_FEATURE_HTTPD_LAST_MODIFIED is not set # CONFIG_FEATURE_HTTPD_DATE is not set # CONFIG_FEATURE_HTTPD_ACL_IP is not set -# CONFIG_IFCONFIG is not set -# CONFIG_FEATURE_IFCONFIG_STATUS is not set -# CONFIG_FEATURE_IFCONFIG_SLIP is not set -# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set -# CONFIG_FEATURE_IFCONFIG_HW is not set +CONFIG_IFCONFIG=y +CONFIG_FEATURE_IFCONFIG_STATUS=y +CONFIG_FEATURE_IFCONFIG_SLIP=y +CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y +CONFIG_FEATURE_IFCONFIG_HW=y # CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set # CONFIG_IFENSLAVE is not set # CONFIG_IFPLUGD is not set -# CONFIG_IFUP is not set -# CONFIG_IFDOWN is not set +CONFIG_IFUP=y +CONFIG_IFDOWN=y CONFIG_IFUPDOWN_IFSTATE_PATH="" -# CONFIG_FEATURE_IFUPDOWN_IP is not set -# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set -# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set -# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set +CONFIG_FEATURE_IFUPDOWN_IP=y +CONFIG_FEATURE_IFUPDOWN_IPV4=y +CONFIG_FEATURE_IFUPDOWN_IPV6=y +CONFIG_FEATURE_IFUPDOWN_MAPPING=y # CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set # CONFIG_INETD is not set # CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set @@ -911,20 +911,20 @@ CONFIG_IFUPDOWN_IFSTATE_PATH="" # CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set # CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set # CONFIG_FEATURE_INETD_RPC is not set -# CONFIG_IP is not set -# CONFIG_IPADDR is not set -# CONFIG_IPLINK is not set -# CONFIG_IPROUTE is not set -# CONFIG_IPTUNNEL is not set -# CONFIG_IPRULE is not set -# CONFIG_IPNEIGH is not set -# CONFIG_FEATURE_IP_ADDRESS is not set -# CONFIG_FEATURE_IP_LINK is not set -# CONFIG_FEATURE_IP_ROUTE is not set +CONFIG_IP=y +CONFIG_IPADDR=y +CONFIG_IPLINK=y +CONFIG_IPROUTE=y +CONFIG_IPTUNNEL=y +CONFIG_IPRULE=y +CONFIG_IPNEIGH=y +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_ROUTE=y CONFIG_FEATURE_IP_ROUTE_DIR="" -# CONFIG_FEATURE_IP_TUNNEL is not set -# CONFIG_FEATURE_IP_RULE is not set -# CONFIG_FEATURE_IP_NEIGH is not set +CONFIG_FEATURE_IP_TUNNEL=y +CONFIG_FEATURE_IP_RULE=y +CONFIG_FEATURE_IP_NEIGH=y # CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set # CONFIG_IPCALC is not set # CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set @@ -938,31 +938,31 @@ CONFIG_FEATURE_IP_ROUTE_DIR="" # CONFIG_NC_SERVER is not set # CONFIG_NC_EXTRA is not set # CONFIG_NC_110_COMPAT is not set -# CONFIG_NETSTAT is not set +CONFIG_NETSTAT=y # CONFIG_FEATURE_NETSTAT_WIDE is not set # CONFIG_FEATURE_NETSTAT_PRG is not set -# CONFIG_NSLOOKUP is not set -# CONFIG_FEATURE_NSLOOKUP_BIG is not set -# CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS is not set +CONFIG_NSLOOKUP=y +CONFIG_FEATURE_NSLOOKUP_BIG=y +CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y # CONFIG_NTPD is not set # CONFIG_FEATURE_NTPD_SERVER is not set # CONFIG_FEATURE_NTPD_CONF is not set # CONFIG_FEATURE_NTP_AUTH is not set -# CONFIG_PING is not set +CONFIG_PING=y # CONFIG_PING6 is not set -# CONFIG_FEATURE_FANCY_PING is not set +CONFIG_FEATURE_FANCY_PING=y # CONFIG_PSCAN is not set -# CONFIG_ROUTE is not set +CONFIG_ROUTE=y # CONFIG_SLATTACH is not set # CONFIG_SSL_CLIENT is not set # CONFIG_TC is not set # CONFIG_FEATURE_TC_INGRESS is not set # CONFIG_TCPSVD is not set # CONFIG_UDPSVD is not set -# CONFIG_TELNET is not set -# CONFIG_FEATURE_TELNET_TTYPE is not set -# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set -# CONFIG_FEATURE_TELNET_WIDTH is not set +CONFIG_TELNET=y +CONFIG_FEATURE_TELNET_TTYPE=y +CONFIG_FEATURE_TELNET_AUTOLOGIN=y +CONFIG_FEATURE_TELNET_WIDTH=y # CONFIG_TELNETD is not set # CONFIG_FEATURE_TELNETD_STANDALONE is not set CONFIG_FEATURE_TELNETD_PORT_DEFAULT=0 @@ -976,7 +976,7 @@ CONFIG_FEATURE_TELNETD_PORT_DEFAULT=0 # CONFIG_FEATURE_TFTP_BLOCKSIZE is not set # CONFIG_TFTP_DEBUG is not set # CONFIG_TLS is not set -# CONFIG_TRACEROUTE is not set +CONFIG_TRACEROUTE=y # CONFIG_TRACEROUTE6 is not set # CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set # CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set @@ -999,9 +999,9 @@ CONFIG_FEATURE_TELNETD_PORT_DEFAULT=0 CONFIG_DHCPD_LEASES_FILE="" # CONFIG_DUMPLEASES is not set # CONFIG_DHCPRELAY is not set -# CONFIG_UDHCPC is not set -# CONFIG_FEATURE_UDHCPC_ARPING is not set -# CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set +CONFIG_UDHCPC=y +CONFIG_FEATURE_UDHCPC_ARPING=y +CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y CONFIG_UDHCPC_DEFAULT_SCRIPT="" CONFIG_UDHCPC6_DEFAULT_SCRIPT="" # CONFIG_UDHCPC6 is not set @@ -1009,6 +1009,7 @@ CONFIG_UDHCPC6_DEFAULT_SCRIPT="" # CONFIG_FEATURE_UDHCPC6_RFC4704 is not set # CONFIG_FEATURE_UDHCPC6_RFC4833 is not set # CONFIG_FEATURE_UDHCPC6_RFC5970 is not set + CONFIG_UDHCPC_DEFAULT_INTERFACE="" # CONFIG_FEATURE_UDHCP_PORT is not set CONFIG_UDHCP_DEBUG=0 diff --git a/configs/linux-x86.config b/configs/linux-x86.config index 1ebbe45..f83ac17 100644 --- a/configs/linux-x86.config +++ b/configs/linux-x86.config @@ -15,7 +15,7 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_SGETMASK_SYSCALL is not set # CONFIG_SYSFS_SYSCALL is not set # CONFIG_FHANDLE is not set -# CONFIG_POSIX_TIMERS is not set +# CONFIG_POSIX_TIMERS=y # CONFIG_BUG is not set # CONFIG_PCSPKR_PLATFORM is not set # CONFIG_BASE_FULL is not set @@ -115,3 +115,15 @@ CONFIG_FRAME_WARN=1024 # CONFIG_X86_DEBUG_FPU is not set CONFIG_UNWINDER_GUESS=y # CONFIG_RUNTIME_TESTING_MENU is not set +CONFIG_NET=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_NETDEVICES=y +CONFIG_VIRTIO=y +CONFIG_VIRTIO_NET=y +CONFIG_VIRTIO_RING=y +CONFIG_UNIX=y +CONFIG_UNIX_SCM=y +CONFIG_AF_UNIX_OOB=y \ No newline at end of file