제품 동향
공용 이미지 업데이트 동향
운영 체제 공식 지원 종료 계획
제품 공지
yum install -y sysstat wget tar automake make gcc
wget http://git.dpdk.org/dpdk/snapshot/dpdk-17.11.tar.gz
tar -xf dpdk-17.11.tar.gz
mv dpdk-17.11 dpdk
dpdk/app/test-pmd/txonly.c 파일을 수정합니다.vim dpdk/app/test-pmd/txonly.c
#include "testpmd.h"를 찾아 새 행에 다음 내용을 입력합니다.RTE_DEFINE_PER_LCORE(struct udp_hdr, lcore_udp_hdr);RTE_DEFINE_PER_LCORE(uint16_t, test_port);

ol_flags |= PKT_TX_MACSEC;를 찾아 새 행에 다음 내용을 입력합니다./* dummy test udp port */memcpy(&RTE_PER_LCORE(lcore_udp_hdr), &pkt_udp_hdr, sizeof(pkt_udp_hdr));
for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {을 찾아 새 행에 다음 내용을 입력합니다.RTE_PER_LCORE(test_port)++;RTE_PER_LCORE(lcore_udp_hdr).src_port = rte_cpu_to_be_16(rte_lcore_id() * 199 + test_port % 2222);RTE_PER_LCORE(lcore_udp_hdr).dst_port = rte_cpu_to_be_16(rte_lcore_id() * 2000 + test_port % 64);

copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt,를 찾아, 다음 내용으로 바꿉니다.copy_buf_to_pkt(&RTE_PER_LCORE(lcore_udp_hdr), sizeof(RTE_PER_LCORE(lcore_udp_hdr)), pkt,

dpdk/config/common_base 파일을 수정합니다.vim dpdk/config/common_base
CONFIG_RTE_MAX_MEMSEG=256을 찾아 1024로 수정합니다. 수정 완료 후는 다음 이미지와 같습니다.

CONFIG_RTE_MAX_LCORE=128을 찾습니다. 시스템의 CPU 코어 수가 128보다 크면 256으로 변경할 수 있습니다. 수정 완료 후는 다음 이미지와 같습니다.

scp -P 22 /root/dpdk/app/test-pmd/txonly.c root@<IP주소>:/root/dpdk/app/test-pmd/scp -P 22 /root/dpdk/config/common_base root@<IP주소>:/root/dpdk/config
dpdk/app/test-pmd/txonly.c의 IP 주소를 테스트 서버용 IP로 수정합니다.vim dpdk/app/test-pmd/txonly.c
#define IP_SRC_ADDR (198U << 24) | (18 << 16) | (0 << 8) | 1;#define IP_DST_ADDR (198U << 24) | (18 << 16) | (0 << 8) | 2;
yum install numactl-devel
apt-get install libnuma-dev
dpdk/ 디렉터리에서 다음 명령을 실행하고 KNI를 비활성화합니다.sed -i "s/\\(^CONFIG_.*KNI.*\\)=y/\\1=n/g" ./config/*
sed -i "s/\\(^WERROR_FLAGS += -Wundef -Wwrite-strings$\\)/\\1 -Wno-address-of-packed-member/g" ./mk/toolchain/gcc/rte.vars.mk
sed -i "s/fall back/falls through -/g" ./lib/librte_eal/linuxapp/igb_uio/igb_uio.c
make defconfig
make -j
echo 4096 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
echo 2048 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
ifconfig eth0 0
ifconfig eth0 down
modprobe uio
insmod /root/dpdk/build/kmod/igb_uio.ko
cd /root/dpdk/usertools/
python3 dpdk-devbind.py --bind=igb_uio 00:05.0
python3 dpdk-devbind.py -s
cd /root/dpdk/usertools/
python3 dpdk-devbind.py --bind=virtio-pci 00:05.0
ifconfig eth0 up
nb-cores를 2로 수정할 수 있습니다. 명령 매개변수에 대한 자세한 내용은 testpmd-command-line-options를 참고하십시오./root/dpdk/build/app/testpmd -- --txd=128 --rxd=128 --txq=512 --rxq=512 --nb-cores=16 --forward-mode=txonly --txpkts=1430 --stats-period=1
-l 8-191 -w 0000:00:05.0 이 두 매개변수는 테스트 환경의 실제 값으로 대체해야 하며 그 다음은 동일하게 처리합니다./root/dpdk/build/app/testpmd -- --txd=128 --rxd=128 --txq=512 --rxq=512 --nb-cores=16 --forward-mode=rxonly --stats-period=1
/root/dpdk/build/app/testpmd -- --txd=128 --rxd=128 --txq=512 --rxq=512 --nb-cores=16 --forward-mode=txonly --txpkts=64 --stats-period=1
/root/dpdk/build/app/testpmd -- --txd=128 --rxd=128 --txq=512 --rxq=512 --nb-cores=16 --forward-mode=rxonly --stats-period=1

피드백