[dpdk-dev] [dpdk-users] how to build 'example' folder in dpdk-2.2.0?

Dharmesh Mehta mehtadharmesh at yahoo.com
Fri Jun 9 09:01:11 CEST 2017


Following is my makefile. I hope this will help.copy following content in "Makefile" and just run
1) make download_and_extract2) make


HOME_DIR = $(shell pwd)DPDK_VERSION=17.05PKTGEN_VERSION=3.2.10####################################################DPDK_PACKAGE_NAME=dpdk-$(DPDK_VERSION)DPDK_TAR_FILE_NAME=$(DPDK_PACKAGE_NAME).tar.xz####################################################PKTGEN_PACKAGE_NAME=pktgen-$(PKTGEN_VERSION)PKTGEN_TAR_FILE_NAME=$(PKTGEN_PACKAGE_NAME).tar.xz####################################################DPDK_SOURCE_CODE_URL=http://fast.dpdk.org/rel/$(DPDK_TAR_FILE_NAME)PKTGEN_SOURCE_CODE_URL=http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/$(PKTGEN_TAR_FILE_NAME)####################################################export RTE_SDK=$(HOME_DIR)/$(DPDK_PACKAGE_NAME)export RTE_TARGET=x86_64-native-linuxapp-gcc####################################################export PKTGEN_PATH=$(HOME_DIR)/$(PKTGEN_PACKAGE_NAME)####################################################
PATH_TO_DPDK_PACKAGE = $(HOME_DIR)/packages/$(DPDK_TAR_FILE_NAME)ifneq ("$(wildcard $(PATH_TO_DPDK_PACKAGE))","") export DPDK_PACKAGE_FILE_EXISTS = 1else export DPDK_PACKAGE_FILE_EXISTS = 0endif
PATH_TO_PKTGEN_PACKAGE = $(HOME_DIR)/packages/$(PKTGEN_TAR_FILE_NAME)ifneq ("$(wildcard $(PATH_TO_PKTGEN_PACKAGE))","") export PKTGEN_PACKAGE_FILE_EXISTS = 1else export PKTGEN_PACKAGE_FILE_EXISTS = 0endif
####################################################
all: banner make build_dpdk make build_dpdk_all_examples make load_module
####################################################
download_and_extract: banner make download make extract
download: bannerifeq ($(DPDK_PACKAGE_FILE_EXISTS),1) cp $(HOME_DIR)/packages/$(DPDK_TAR_FILE_NAME)  $(HOME_DIR)else rm -rf $(DPDK_TAR_FILE_NAME) wget $(DPDK_SOURCE_CODE_URL) mkdir -p $(HOME_DIR)/packages cp $(HOME_DIR)/$(DPDK_TAR_FILE_NAME) $(HOME_DIR)/packagesendif####ifeq ($(PKTGEN_PACKAGE_FILE_EXISTS),1) cp $(HOME_DIR)/packages/$(PKTGEN_TAR_FILE_NAME)  $(HOME_DIR)else rm -rf $(PKTGEN_TAR_FILE_NAME) wget $(PKTGEN_SOURCE_CODE_URL) mkdir -p $(HOME_DIR)/packages cp $(HOME_DIR)/$(PKTGEN_TAR_FILE_NAME) $(HOME_DIR)/packagesendif
####################################################
extract: tar -xJf $(DPDK_TAR_FILE_NAME) tar -xJf $(PKTGEN_TAR_FILE_NAME)
####################################################
build_dpdk: cd $(RTE_SDK) && mkdir -p $(RTE_SDK)/$(RTE_TARGET) cd $(RTE_SDK) && make config T=$(RTE_TARGET)#cd $(RTE_SDK) && sed -ri 's,(PMD_PCAP=).*,\1y,' build/.config cd $(RTE_SDK) && make T=$(RTE_TARGET) cd $(RTE_SDK) && sudo make install cd $(RTE_SDK) && cp $(RTE_SDK)/build/.config    $(RTE_SDK)/$(RTE_TARGET) cd $(RTE_SDK) && cp -r $(RTE_SDK)/build/include $(RTE_SDK)/$(RTE_TARGET)
####################################################
load_module: @echo "Loading module uio_pci_generic" sudo modprobe uio_pci_generic sudo modprobe uio -sudo insmod $(RTE_SDK)/build/kmod/igb_uio.ko sudo modprobe vfio-pci
####################################################
clean:  banner rm -rf $(RTE_SDK) rm -rf $(PKTGEN_PATH)
####################################################
clean_all: banner rm -rf $(RTE_SDK) rm -rf $(DPDK_TAR_FILE_NAME) rm -rf $(PKTGEN_TAR_FILE_NAME)
####################################################example_helloworld: cd $(RTE_SDK)/examples/helloworld && make
example_cmdline: cd $(RTE_SDK)/examples/cmdline && make
example_vhost: cd $(RTE_SDK)/examples/vhost && make
example_exception_path: cd $(RTE_SDK)/examples/exception_path && make
example_bond: cd $(RTE_SDK)/examples/bond  && make
example_ethtool: cd $(RTE_SDK)/examples/ethtool && make
example_ip_pipeline: cd $(RTE_SDK)/examples/ip_pipeline && make
example_kni: cd $(RTE_SDK)/examples/kni && make
example_l2fwd-jobstats: cd $(RTE_SDK)/examples/l2fwd-jobstats && make
example_l3fwd-power: cd $(RTE_SDK)/examples/l3fwd-power && make
example_performance-thread: cd $(RTE_SDK)/examples/performance-thread && make
example_quota_watermark: cd $(RTE_SDK)/examples/quota_watermark && make
example_tep_termination: cd $(RTE_SDK)/examples/tep_termination && make
example_vmdq: cd $(RTE_SDK)/examples/vmdq  && make
example_ip_reassembly: cd $(RTE_SDK)/examples/ip_reassembly && make
example_l2fwd: cd $(RTE_SDK)/examples/l2fwd && make
example_l2fwd-keepalive: cd $(RTE_SDK)/examples/l2fwd-keepalive && make
example_l3fwd-vf: cd $(RTE_SDK)/examples/l3fwd-vf && make
example_multi_process: cd $(RTE_SDK)/examples/multi_process && make
example_ptpclient: cd $(RTE_SDK)/examples/ptpclient && make
example_rxtx_callbacks: cd $(RTE_SDK)/examples/rxtx_callbacks && make
example_timer: cd $(RTE_SDK)/examples/timer && make
example_vmdq_dcb: cd $(RTE_SDK)/examples/vmdq_dcb && make
example_distributor: cd $(RTE_SDK)/examples/distributor && make
example_ipsec-secgw: cd $(RTE_SDK)/examples/ipsec-secgw && make
example_l2fwd-cat: cd $(RTE_SDK)/examples/l2fwd-cat && make
example_l3fwd: cd $(RTE_SDK)/examples/l3fwd && make
example_link_status_interrupt: cd $(RTE_SDK)/examples/link_status_interrupt && make
example_netmap_compat: cd $(RTE_SDK)/examples/netmap_compat && make
example_qos_meter: cd $(RTE_SDK)/examples/qos_meter && make
example_server_node_efd: cd $(RTE_SDK)/examples/server_node_efd && make
example_vm_power_manager: cd $(RTE_SDK)/examples/vm_power_manager && make
example_dpdk_qat: cd $(RTE_SDK)/examples/dpdk_qat && make
example_ip_fragmentation: cd $(RTE_SDK)/examples/ip_fragmentation && make
example_ipv4_multicast: cd $(RTE_SDK)/examples/ipv4_multicast && make
example_l2fwd-crypto: cd $(RTE_SDK)/examples/l2fwd-crypto && make
example_l3fwd-acl: cd $(RTE_SDK)/examples/l3fwd-acl && make
example_load_balancer: cd $(RTE_SDK)/examples/load_balancer && make
example_packet_ordering: cd $(RTE_SDK)/examples/packet_ordering && make
example_qos_sched: cd $(RTE_SDK)/examples/qos_sched && make
example_skeleton: cd $(RTE_SDK)/examples/skeleton && make
example_vhost_xen: cd $(RTE_SDK)/examples/vhost_xen && make
####################################################
build_dpdk_all_examples: banner make example_vhost make example_helloworld make example_cmdline make example_exception_path make example_bond make example_ethtool make example_ip_pipeline make example_kni make example_l2fwd-jobstats make example_l3fwd-power make example_performance-thread make example_quota_watermark make example_tep_termination make example_vmdq make example_ip_reassembly make example_l2fwd make example_l2fwd-keepalive make example_l3fwd-vf make example_multi_process make example_ptpclient make example_rxtx_callbacks make example_timer make example_vmdq_dcb make example_distributor make example_ipsec-secgw make example_l3fwd make example_link_status_interrupt make example_netmap_compat make example_qos_meter make example_server_node_efd make example_ip_fragmentation make example_ipv4_multicast make example_l2fwd-crypto make example_l3fwd-acl make example_load_balancer make example_packet_ordering make example_qos_sched make example_skeleton #make example_l2fwd-cat #make example_vm_power_manager #make example_dpdk_qat #make example_vhost_xen
####################################################
banner: @echo "" @echo "**************************************************" @echo "HOME_DIR=$(HOME_DIR)" @echo "DPDK_VERSION=$(DPDK_VERSION)" @echo "DPDK_PACKAGE_NAME=$(DPDK_PACKAGE_NAME)" @echo "DPDK_TAR_FILE_NAME=$(DPDK_TAR_FILE_NAME)" @echo "DPDK_SOURCE_CODE_URL=$(DPDK_SOURCE_CODE_URL)" @echo "RTE_SDK=$(RTE_SDK)" @echo "RTE_TARGET=$(RTE_TARGET)" @echo "PKTGEN_PACKAGE_NAME=$(PKTGEN_PACKAGE_NAME)" @echo "PKTGEN_TAR_FILE_NAME=$(PKTGEN_TAR_FILE_NAME)" @echo "PKTGEN_SOURCE_CODE_URL=$(PKTGEN_SOURCE_CODE_URL)" @echo "**************************************************" @echo ""
####################################################


      From: Shyam Shrivastav <shrivastav.shyam at gmail.com>
 To: Sam <batmanustc at gmail.com> 
Cc: users at dpdk.org; dev at dpdk.org
 Sent: Thursday, June 8, 2017 11:43 PM
 Subject: Re: [dpdk-users] [dpdk-dev] how to build 'example' folder in dpdk-2.2.0?
   
For linux

http://dpdk.org/doc/guides/linux_gsg/index.html
http://dpdk.org/doc/guides/linux_gsg/build_dpdk.html
http://dpdk.org/doc/guides/linux_gsg/build_sample_apps.html

On Fri, Jun 9, 2017 at 8:31 AM, Sam <batmanustc at gmail.com> wrote:

> hi all,
>
> I want to build example(DPDK_HOME/example/*) in dpdk, and to have a look at
> vhost demo. But I can't find guide in dpdk home page or document.
>
> So is there some document to tell me HOWTO?
>


   


More information about the dev mailing list