diff options
-rw-r--r-- | recipes-container/lxc-config/lxc-config-dpdk-demo/misc.in | 2 | ||||
-rw-r--r-- | recipes-container/lxc-config/lxc-config-dpdk-demo/mount.in | 4 | ||||
-rw-r--r-- | recipes-core/base-files/base-files/fstab | 3 | ||||
-rw-r--r-- | recipes-core/base-files/base-files/guest.sh | 7 | ||||
-rw-r--r-- | recipes-core/base-files/base-files/host.sh | 11 | ||||
-rw-r--r-- | recipes-core/base-files/base-files_%.bbappend | 12 | ||||
-rw-r--r-- | recipes-platform/images/host-image-dpdk.bb | 2 |
7 files changed, 34 insertions, 7 deletions
diff --git a/recipes-container/lxc-config/lxc-config-dpdk-demo/misc.in b/recipes-container/lxc-config/lxc-config-dpdk-demo/misc.in index 9b4f4883e4d..0d106940d4e 100644 --- a/recipes-container/lxc-config/lxc-config-dpdk-demo/misc.in +++ b/recipes-container/lxc-config/lxc-config-dpdk-demo/misc.in @@ -1,3 +1,3 @@ # lxc misc setting -lxc.start.auto = @LXC_AUTO_START@ +# lxc.start.auto = @LXC_AUTO_START@ diff --git a/recipes-container/lxc-config/lxc-config-dpdk-demo/mount.in b/recipes-container/lxc-config/lxc-config-dpdk-demo/mount.in index 7c4efc3f9ed..52c04dbc294 100644 --- a/recipes-container/lxc-config/lxc-config-dpdk-demo/mount.in +++ b/recipes-container/lxc-config/lxc-config-dpdk-demo/mount.in @@ -4,5 +4,5 @@ lxc.mount.entry = /var/lib/lxc/dpdk-demo/system.conf etc/systemd/system.conf.d/1 lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed lxc.mount.entry = shm /dev/shm tmpfs defaults 0 0 -lxc.mount.entry = /dev/hugepages dev/hugepages none bind,create=dir 0 0 -lxc.mount.entry = /tmp/dpdk /tmp/dpdk none bind,,create=dir 0 0 +lxc.mount.entry = /mnt/hugepages var/dpdk/hugepages none bind,create=dir 0 0 +lxc.mount.entry = /var/run/dpdk0 mnt/dpdk0 none bind,create=file 0 0 diff --git a/recipes-core/base-files/base-files/fstab b/recipes-core/base-files/base-files/fstab deleted file mode 100644 index a27f8cd6766..00000000000 --- a/recipes-core/base-files/base-files/fstab +++ /dev/null @@ -1,3 +0,0 @@ -# Reference fstab for container guest -devpts /dev/pts devpts mode=0620,gid=5 0 0 -tmpfs /var/volatile tmpfs defaults 0 0 diff --git a/recipes-core/base-files/base-files/guest.sh b/recipes-core/base-files/base-files/guest.sh new file mode 100644 index 00000000000..3b3e4f5ee67 --- /dev/null +++ b/recipes-core/base-files/base-files/guest.sh @@ -0,0 +1,7 @@ +#!/bin/sh -x + +dpdk-testpmd -l 2-3 -n 4 -m 2048 --no-pci \ + --vdev=virtio_user0,path=/mnt/dpdk0 \ + --huge-dir=/var/dpdk/hugepages \ + --file-prefix=container -- -i + diff --git a/recipes-core/base-files/base-files/host.sh b/recipes-core/base-files/base-files/host.sh new file mode 100644 index 00000000000..b2003241b19 --- /dev/null +++ b/recipes-core/base-files/base-files/host.sh @@ -0,0 +1,11 @@ +#!/bin/sh -x + +lxc-stop -k dpdk-demo +umount /mnt/hugepages +mkdir /mnt/hugepages +echo 2048 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages +mount -t hugetlbfs hugetlbfs /mnt/hugepages + +dpdk-testpmd -l 0-1 -n 4 --socket-mem 1024 \ + --vdev='eth_vhost0,iface=/var/run/dpdk0' \ + --huge-dir=/mnt/hugepages --file-prefix=host --no-pci -- -i diff --git a/recipes-core/base-files/base-files_%.bbappend b/recipes-core/base-files/base-files_%.bbappend index 2df9447b064..a064006c4ea 100644 --- a/recipes-core/base-files/base-files_%.bbappend +++ b/recipes-core/base-files/base-files_%.bbappend @@ -1,2 +1,12 @@ -FILESEXTRAPATHS:prepend:aglcontainerguest := "${THISDIR}/base-files:" +FILESEXTRAPATHS:prepend := "${THISDIR}/base-files:" + +SRC_URI += "file://host.sh \ + file://guest.sh" + +do_install:append() { + install -m 0755 -d ${D}${bindir} + install -m 0755 ${S}/host.sh ${D}${bindir}/host.sh + install -m 0755 ${S}/guest.sh ${D}${bindir}/guest.sh +} + diff --git a/recipes-platform/images/host-image-dpdk.bb b/recipes-platform/images/host-image-dpdk.bb index 2fd93b4d1e9..6f96346f522 100644 --- a/recipes-platform/images/host-image-dpdk.bb +++ b/recipes-platform/images/host-image-dpdk.bb @@ -33,6 +33,8 @@ VIRTUAL-RUNTIME_base-utils-syslog = "" VIRTUAL-RUNTIME_net_manager = "systemd" QB_MEM = "-m 12288" +QB_KERNEL_CMDLINE_APPEND += " " DISTRO_FEATURES:append = ' systemd usrmerge ' VIRTUAL-RUNTIME_init_manager = "systemd" VIRTUAL-RUNTIME_initscript = "systemd-compat-units" + |