[dpdk-dev] I have a problem in setting up DPDK 2.1.0 in Fedora OS release 20 (Heisenbug). I cannot r

최익성 pnk003 at naver.com
Wed Oct 14 03:49:50 CEST 2015


 My DPDK setup shell script is as follows.
------------------------------------------------------------------------
 
 
#! /bin/bash
ifconfig -a > ifconfig.out.txt
sudo ifconfig p785p1 down
sudo ifconfig p785p2 down
 
sudo ifconfig p787p1 down
sudo ifconfig p787p2 down
 
setup_target()
{
        option=$1
        export RTE_TARGET=${TARGETS[option]}
 
        compiler=${RTE_TARGET##*-}
        if [ "$compiler" == "icc" ] ; then
                platform=${RTE_TARGET%%-*}
                if [ "$platform" == "x86_64" ] ; then
                        setup_icc intel64
                else
                        setup_icc ia32
                fi
        fi
        if [ "$QUIT" == "0" ] ; then
                make install T=${RTE_TARGET}
        fi
        echo "------------------------------------------------------------------------------"
        echo " RTE_TARGET exported as $RTE_TARGET"
        echo "------------------------------------------------------------------------------"
}
 
load_igb_uio_module()
{
        if [ ! -f $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko ];then
                echo "## ERROR: Target does not have the DPDK UIO Kernel Module."
                echo "       To fix, please try to rebuild target."
                return
        fi
 
        remove_igb_uio_module
 
        /sbin/lsmod | grep -s uio > /dev/null
        if [ $? -ne 0 ] ; then
                if [ -f /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko ] ; then
                        echo "Loading uio module"
                        sudo /sbin/modprobe uio
                        sudo /sbin/modprobe vfio-pci
                fi
        fi
 
        # UIO may be compiled into kernel, so it may not be an error if it can't
        # be loaded.
 
        echo "Loading DPDK UIO module"
        sudo /sbin/insmod $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko
        if [ $? -ne 0 ] ; then
                echo "## ERROR: Could not load kmod/igb_uio.ko."
                quit
        fi
}
#
# Unloads igb_uio.ko.
#
remove_igb_uio_module()
{
        echo "Unloading any existing DPDK UIO module"
        /sbin/lsmod | grep -s igb_uio > /dev/null
        if [ $? -eq 0 ] ; then
                sudo /sbin/rmmod igb_uio
        fi
}
 
create_mnt_huge()
{
        echo "Creating /mnt/huge and mounting as hugetlbfs"
        sudo mkdir -p /mnt/huge
 
        grep -s '/mnt/huge' /proc/mounts > /dev/null
        if [ $? -ne 0 ] ; then
                sudo mount -t hugetlbfs nodev /mnt/huge
        fi
}
set_non_numa_pages()
{
        clear_huge_pages
 
        echo ""
#        echo "  Input the number of 2MB pages"
#        echo "  Example: to have 128MB of hugepages available, enter '64' to"
#        echo "  reserve 64 * 2MB pages"
#        echo -n "Number of pages: "
#        read Pages
#        echo "echo $Pages > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages" > .echo_tmp
 
        echo " Reserve 2048 * 2MB pages"
        echo "echo 2048 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages" > .echo_tmp
 
        echo "Reserving hugepages"
        sudo sh .echo_tmp
        rm -f .echo_tmp
 
        create_mnt_huge
}
 
#
# Creates hugepages on specific NUMA nodes.
#
set_numa_pages()
{
        clear_huge_pages
 
        echo ""
        echo "  Input the number of 2MB pages for each node"
        echo "  Example: to have 128MB of hugepages available per node,"
        echo "  enter '64' to reserve 64 * 2MB pages on each node"
 
        echo > .echo_tmp
        for d in /sys/devices/system/node/node? ; do
                node=$(basename $d)
                echo -n "Number of pages for $node: "
#                read Pages
#                echo "echo $Pages > $d/hugepages/hugepages-2048kB/nr_hugepages" >> .echo_tmp
                echo "echo 2048 > $d/hugepages/hugepages-2048kB/nr_hugepages" >> .echo_tmp
        done
        echo "Reserving hugepages"
        sudo sh .echo_tmp
        rm -f .echo_tmp
 
        create_mnt_huge
}
 
#
# Removes hugepage filesystem.
#
remove_mnt_huge()
{
        echo "Unmounting /mnt/huge and removing directory"
        grep -s '/mnt/huge' /proc/mounts > /dev/null
        if [ $? -eq 0 ] ; then
                sudo umount /mnt/huge
        fi
 
        if [ -d /mnt/huge ] ; then
                sudo rm -R /mnt/huge
        fi
}
#
# Removes all reserved hugepages.
#
clear_huge_pages()
{
        echo > .echo_tmp
        for d in /sys/devices/system/node/node? ; do
                echo "echo 0 > $d/hugepages/hugepages-2048kB/nr_hugepages" >> .echo_tmp
        done
        echo "Removing currently reserved hugepages"
        sudo sh .echo_tmp
        rm -f .echo_tmp
 
        remove_mnt_huge
}
show_nics()
{
        if  /sbin/lsmod  | grep -q igb_uio ; then
                ${RTE_SDK}/tools/dpdk_nic_bind.py --status
        else
                echo "# Please load the 'igb_uio' kernel module before querying or "
                echo "# adjusting NIC device bindings"
        fi
}
bind_nics()
{
        if  /sbin/lsmod  | grep -q igb_uio ; then
                ${RTE_SDK}/tools/dpdk_nic_bind.py --status
                echo ""
#                echo -n "Enter PCI address of device to bind to IGB UIO driver: "
#                read PCI_PATH
                echo "Bind NICs to DPDK"
                sudo ${RTE_SDK}/tools/dpdk_nic_bind.py -b igb_uio 0000:09:00.0 && echo "OK"
                sudo ${RTE_SDK}/tools/dpdk_nic_bind.py -b igb_uio 0000:09:00.1 && echo "OK"
 
                sudo ${RTE_SDK}/tools/dpdk_nic_bind.py -b igb_uio 0000:81:00.0 && echo "OK"
                sudo ${RTE_SDK}/tools/dpdk_nic_bind.py -b igb_uio 0000:81:00.1 && echo "OK"
        else
                echo "# Please load the 'igb_uio' kernel module before querying or "
                echo "# adjusting NIC device bindings"
        fi
}
 
# setup environment &  build DPDK 
 
# export DPDK_DIR=/home/stack/Pktgen-DPDK-master/dpdk
# export RTE_SDK=/home/stack/Pktgen-DPDK-master/dpdk
# export RTE_TARGET=x86_64-pktgen-linuxapp-gcc
export DPDK_DIR=/home/stack/dpdk/
export RTE_SDK=/home/stack/dpdk/
export RTE_TARGET=x86_64-native-linuxapp-gcc
 
# setup environment &  build DPDK 
 
#setup_target
echo "---------------------------------------------------------------------------------------------"
echo "Build DPDK module"
echo "---------------------------------------------------------------------------------------------"
cd $DPDK_DIR
make install T=$RTE_TARGET
 
# Setup linuxapp environment
 
echo "---------------------------------------------------------------------------------------------"
echo "Insert IGB UIO module"
echo "---------------------------------------------------------------------------------------------"
load_igb_uio_module
echo "---------------------------------------------------------------------------------------------"
echo "Setup hugepage mappings for NUMA systems"
echo "---------------------------------------------------------------------------------------------"
# set_non_numa_pages
set_numa_pages
#echo "Display current Ethernet device settings"
#show_nics
echo "---------------------------------------------------------------------------------------------"
echo "Bind current Ethernet device to DPDK"
echo "---------------------------------------------------------------------------------------------"
bind_nics
show_nics
 
 
 
 
-----Original Message-----
From: "최익성"<pnk003 at naver.com> 
To: <dev at dpdk.org>; 
Cc: 
Sent: 2015-10-14 (수) 10:29:22
Subject: [dpdk-dev]  I have a problem in setting up DPDK 2.1.0 in Fedora OS release 20 (Heisenbug). I cannot r
 
Dear DPDK experts.
 
Thank you very much for your best great efforts and precious answers.
 
I have a problem in setting up DPDK 2.1.0 in Fedora OS release 20 (Heisenbug).
 
My problem is that I cannot receive any traffics in test-pmd.
 
There are 2 nics (2 port NIC), I connected port 0 to port 1(loopback), port 2 to port3 (loopback).
 
I attached details of my setup. I also attached my DPDK setup shell script.
 
Did I miss something? or Is there any my mistakes?
 
 
I will really appreciate if you check them and I can be given any advice and answers.
 
 
It is important for me and urgent job.
 
Thank you very much.
 
Sincerely Yours,
 
Ick-Sung Choi.
 
 
* test-pmd log.
 
 
$ sudo ./build/app/testpmd -c 0xF -n 4 -- -i --portmask=0xF --nb-cores=3
 
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 2 on socket 0
EAL: Detected lcore 3 as core 3 on socket 0
EAL: Detected lcore 4 as core 4 on socket 0
EAL: Detected lcore 5 as core 8 on socket 0
EAL: Detected lcore 6 as core 9 on socket 0
EAL: Detected lcore 7 as core 10 on socket 0
EAL: Detected lcore 8 as core 11 on socket 0
EAL: Detected lcore 9 as core 12 on socket 0
EAL: Detected lcore 10 as core 0 on socket 1
EAL: Detected lcore 11 as core 1 on socket 1
EAL: Detected lcore 12 as core 2 on socket 1
EAL: Detected lcore 13 as core 3 on socket 1
EAL: Detected lcore 14 as core 4 on socket 1
EAL: Detected lcore 15 as core 8 on socket 1
EAL: Detected lcore 16 as core 9 on socket 1
EAL: Detected lcore 17 as core 10 on socket 1
EAL: Detected lcore 18 as core 11 on socket 1
EAL: Detected lcore 19 as core 12 on socket 1
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 20 lcore(s)
EAL: Setting up physically contiguous memory...
EAL: Ask a virtual area of 0x1000000 bytes
EAL: Virtual area found at 0x7f85eb000000 (size = 0x1000000)
EAL: Ask a virtual area of 0x3800000 bytes
EAL: Virtual area found at 0x7f85e7600000 (size = 0x3800000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7f85e7200000 (size = 0x200000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7f85e6e00000 (size = 0x200000)
EAL: Ask a virtual area of 0xfb400000 bytes
EAL: Virtual area found at 0x7f84eb800000 (size = 0xfb400000)
EAL: Ask a virtual area of 0xffc00000 bytes
EAL: Virtual area found at 0x7f83eba00000 (size = 0xffc00000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7f83eb600000 (size = 0x200000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7f83eb200000 (size = 0x200000)
EAL: Requesting 2048 pages of size 2MB from socket 0
EAL: Requesting 2048 pages of size 2MB from socket 1
EAL: TSC frequency is ~2793267 KHz
EAL: Master lcore 0 is ready (tid=ee4a0940;cpuset=[0])
EAL: lcore 3 is ready (tid=ea1cf700;cpuset=[3])
EAL: lcore 2 is ready (tid=ecc69700;cpuset=[2])
EAL: lcore 1 is ready (tid=ed46a700;cpuset=[1])
EAL: PCI device 0000:04:00.0 on NUMA socket 0
EAL:   probe driver: 8086:1521 rte_igb_pmd
EAL:   Not managed by a supported kernel driver, skipped
EAL: PCI device 0000:04:00.1 on NUMA socket 0
EAL:   probe driver: 8086:1521 rte_igb_pmd
EAL:   Not managed by a supported kernel driver, skipped
EAL: PCI device 0000:04:00.2 on NUMA socket 0
EAL:   probe driver: 8086:1521 rte_igb_pmd
EAL:   Not managed by a supported kernel driver, skipped
EAL: PCI device 0000:04:00.3 on NUMA socket 0
EAL:   probe driver: 8086:1521 rte_igb_pmd
EAL:   Not managed by a supported kernel driver, skipped
EAL: PCI device 0000:09:00.0 on NUMA socket 0
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7f85ec000000
EAL:   PCI memory mapped at 0x7f85ec080000
PMD: eth_ixgbe_dev_init(): MAC: 2, PHY: 18, SFP+: 5
PMD: eth_ixgbe_dev_init(): port 0 vendorID=0x8086 deviceID=0x10fb
EAL: PCI device 0000:09:00.1 on NUMA socket 0
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7f85ec084000
EAL:   PCI memory mapped at 0x7f85ec104000
PMD: eth_ixgbe_dev_init(): MAC: 2, PHY: 18, SFP+: 6
PMD: eth_ixgbe_dev_init(): port 1 vendorID=0x8086 deviceID=0x10fb
EAL: PCI device 0000:81:00.0 on NUMA socket 1
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7f85ec108000
EAL:   PCI memory mapped at 0x7f85ec188000
PMD: eth_ixgbe_dev_init(): MAC: 2, PHY: 18, SFP+: 5
PMD: eth_ixgbe_dev_init(): port 2 vendorID=0x8086 deviceID=0x10fb
EAL: PCI device 0000:81:00.1 on NUMA socket 1
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7f85ec18c000
EAL:   PCI memory mapped at 0x7f85ec20c000
PMD: eth_ixgbe_dev_init(): MAC: 2, PHY: 18, SFP+: 6
PMD: eth_ixgbe_dev_init(): port 3 vendorID=0x8086 deviceID=0x10fb
Interactive-mode selected
Configuring Port 0 (socket 0)
PMD: ixgbe_dev_tx_queue_setup(): sw_ring=0x7f85e6f8a5c0 hw_ring=0x7f85e6f8c600 dma_addr=0x6c158c600
PMD: ixgbe_set_tx_function(): Using simple tx code path
PMD: ixgbe_set_tx_function(): Vector tx enabled.
PMD: ixgbe_dev_rx_queue_setup(): sw_ring=0x7f85e6f79cc0 sw_sc_ring=0x7f85e6f79780 hw_ring=0x7f85e6f7a200 dma_addr=0x6c157a200
PMD: ixgbe_set_rx_function(): Vector rx enabled, please make sure RX burst size no less than 32.
Port 0: 90:E2:BA:8B:BF:C0
Configuring Port 1 (socket 0)
PMD: ixgbe_dev_tx_queue_setup(): sw_ring=0x7f85e6f674c0 hw_ring=0x7f85e6f69500 dma_addr=0x6c1569500
PMD: ixgbe_set_tx_function(): Using simple tx code path
PMD: ixgbe_set_tx_function(): Vector tx enabled.
PMD: ixgbe_dev_rx_queue_setup(): sw_ring=0x7f85e6f56bc0 sw_sc_ring=0x7f85e6f56680 hw_ring=0x7f85e6f57100 dma_addr=0x6c1557100
PMD: ixgbe_set_rx_function(): Vector rx enabled, please make sure RX burst size no less than 32.
Port 1: 90:E2:BA:8B:BF:C1
Configuring Port 2 (socket 0)
PMD: ixgbe_dev_tx_queue_setup(): sw_ring=0x7f85e6f443c0 hw_ring=0x7f85e6f46400 dma_addr=0x6c1546400
PMD: ixgbe_set_tx_function(): Using simple tx code path
PMD: ixgbe_set_tx_function(): Vector tx enabled.
PMD: ixgbe_dev_rx_queue_setup(): sw_ring=0x7f85e6f33ac0 sw_sc_ring=0x7f85e6f33580 hw_ring=0x7f85e6f34000 dma_addr=0x6c1534000
PMD: ixgbe_set_rx_function(): Vector rx enabled, please make sure RX burst size no less than 32.
Port 2: 90:E2:BA:8B:B8:CC
Configuring Port 3 (socket 0)
PMD: ixgbe_dev_tx_queue_setup(): sw_ring=0x7f85e6f212c0 hw_ring=0x7f85e6f23300 dma_addr=0x6c1523300
PMD: ixgbe_set_tx_function(): Using simple tx code path
PMD: ixgbe_set_tx_function(): Vector tx enabled.
PMD: ixgbe_dev_rx_queue_setup(): sw_ring=0x7f85e6f109c0 sw_sc_ring=0x7f85e6f10480 hw_ring=0x7f85e6f10f00 dma_addr=0x6c1510f00
PMD: ixgbe_set_rx_function(): Vector rx enabled, please make sure RX burst size no less than 32.
Port 3: 90:E2:BA:8B:B8:CD
Checking link statuses...
Port 0 Link Up - speed 10000 Mbps - full-duplex
Port 1 Link Up - speed 10000 Mbps - full-duplex
Port 2 Link Up - speed 10000 Mbps - full-duplex
Port 3 Link Up - speed 10000 Mbps - full-duplex
Done
 
 
testpmd> show port stats all
  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-badcrc:  0          RX-badlen: 0          RX-errors: 5
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0
  ############################################################################
 
  ######################## NIC statistics for port 1  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-badcrc:  0          RX-badlen: 0          RX-errors: 3
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0
  ############################################################################
 
  ######################## NIC statistics for port 2  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-badcrc:  0          RX-badlen: 0          RX-errors: 4
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0
  ############################################################################
 
  ######################## NIC statistics for port 3  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-badcrc:  0          RX-badlen: 0          RX-errors: 3
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0
  ############################################################################
 
 
testpmd> start tx_first  io packet forwarding - CRC stripping disabled - packets/burst=32
  nb forwarding cores=3 - nb forwarding ports=4
  RX queues=1 - RX desc=128 - RX free threshold=32
  RX threshold registers: pthresh=8 hthresh=8 wthresh=0
  TX queues=1 - TX desc=512 - TX free threshold=32
  TX threshold registers: pthresh=32 hthresh=0 wthresh=0
  TX RS bit threshold=32 - TXQ flags=0xf01
 
 
testpmd> 
testpmd> 
testpmd> 
testpmd> stop
 
Telling cores to stop...
Waiting for lcores to finish...
 
  ---------------------- Forward statistics for port 0  ----------------------
  RX-packets: 0              RX-dropped: 0             RX-total: 0
  RX-badcrc:  0              RX-badlen:  0             RX-error: 5
  RX-nombufs: 0             
  TX-packets: 0              TX-dropped: 0             TX-total: 0
  ----------------------------------------------------------------------------
 
  ---------------------- Forward statistics for port 1  ----------------------
  RX-packets: 0              RX-dropped: 0             RX-total: 0
  RX-badcrc:  0              RX-badlen:  0             RX-error: 3
  RX-nombufs: 0             
  TX-packets: 0              TX-dropped: 0             TX-total: 0
  ----------------------------------------------------------------------------
 
  ---------------------- Forward statistics for port 2  ----------------------
  RX-packets: 0              RX-dropped: 0             RX-total: 0
  RX-badcrc:  0              RX-badlen:  0             RX-error: 4
  RX-nombufs: 0             
  TX-packets: 0              TX-dropped: 0             TX-total: 0
  ----------------------------------------------------------------------------
 
  ---------------------- Forward statistics for port 3  ----------------------
  RX-packets: 0              RX-dropped: 0             RX-total: 0
  RX-badcrc:  0              RX-badlen:  0             RX-error: 3
  RX-nombufs: 0             
  TX-packets: 0              TX-dropped: 0             TX-total: 0
  ----------------------------------------------------------------------------
 
  +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
  RX-packets: 0              RX-dropped: 0             RX-total: 0
  TX-packets: 0              TX-dropped: 0             TX-total: 0
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
Done.
 
 
testpmd> quitStopping port 0...done
Stopping port 1...done
Stopping port 2...done
Stopping port 3...done
bye...
 
 
 
 
* Port setup.
 
Network devices using DPDK-compatible driver
============================================
0000:09:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection' drv=igb_uio unused=ixgbe,vfio-pci
0000:09:00.1 '82599ES 10-Gigabit SFI/SFP+ Network Connection' drv=igb_uio unused=ixgbe,vfio-pci
0000:81:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection' drv=igb_uio unused=ixgbe,vfio-pci
0000:81:00.1 '82599ES 10-Gigabit SFI/SFP+ Network Connection' drv=igb_uio unused=ixgbe,vfio-pci
 
Network devices using kernel driver
===================================
0000:04:00.0 'I350 Gigabit Network Connection' if=em1 drv=igb unused=igb_uio,vfio-pci *Active*
0000:04:00.1 'I350 Gigabit Network Connection' if=em2 drv=igb unused=igb_uio,vfio-pci 
0000:04:00.2 'I350 Gigabit Network Connection' if=em3 drv=igb unused=igb_uio,vfio-pci 
0000:04:00.3 'I350 Gigabit Network Connection' if=em4 drv=igb unused=igb_uio,vfio-pci
 
Other network devices
=====================
<none>
 
 
* I used 2048 for NUMA node 0, 2048 for NUMA node 1.
 
/proc/meminfo file.
HugePages_Total:    4096
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
 
* Fedora OS version : Fedora release 20 (Heisenbug)
 
* gcc version : gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7).
 
* Intel(R) Xeon(R) CPU E5-2680  10 cores, 64G bytes system memory.
* 2 2-port NIC cards, Intel® 82599ES 10 Gigabit Ethernet 2 port Controller. SFI/SFP+. optical link. Hence there are 4 10 GbE ports.
 
* I attached DPDK setup script in my environment.
 
 
Thank you very much.
 
Sincerely Yours,
 
Ick-Sung Choi.



More information about the dev mailing list