dpdk | SPDK mirror of DPDK

 by   spdk C Version: v21.02 License: No License

kandi X-RAY | dpdk Summary

kandi X-RAY | dpdk Summary

dpdk is a C library. dpdk has no bugs and it has low support. However dpdk has 1 vulnerabilities. You can download it from GitHub.

DPDK is a set of libraries and drivers for fast packet processing. It supports many processor architectures and both FreeBSD and Linux. The DPDK uses the Open Source BSD-3-Clause license for the core libraries and drivers. The kernel components are GPL-2.0 licensed. Please check the doc directory for release notes, API documentation, and sample application information. For questions and usage discussions, subscribe to: users@dpdk.org Report bugs and issues to the development mailing list: dev@dpdk.org.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              dpdk has a low active ecosystem.
              It has 50 star(s) with 43 fork(s). There are 12 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 2 open issues and 2 have been closed. On average issues are closed in 71 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of dpdk is v21.02

            kandi-Quality Quality

              dpdk has 0 bugs and 0 code smells.

            kandi-Security Security

              dpdk has 1 vulnerability issues reported (0 critical, 1 high, 0 medium, 0 low).
              dpdk code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              dpdk does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              dpdk releases are not available. You will need to build from source code and install.
              It has 2753 lines of code, 83 functions and 13 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dpdk
            Get all kandi verified functions for this library.

            dpdk Key Features

            No Key Features are available at this moment for dpdk.

            dpdk Examples and Code Snippets

            No Code Snippets are available at this moment for dpdk.

            Community Discussions

            QUESTION

            dpdk Rx TCP checksum failed
            Asked 2022-Apr-11 at 18:35

            I am using the checksum offloads feature in DPDK and it did not working under virtual macine. virtual port only support TCP checksum and do not support IP checksum.

            so I config rxmode.offload txmode.offloads as below:

            ...

            ANSWER

            Answered 2022-Apr-11 at 18:35

            According to the original commit, RX_L4_CKSUM_NONE helps to cover the virtio / vhost use case and indicates that "the checksum in packet may be wrong, but data integrity is valid".

            My takeaway from this explanation is that confirming the "data integrity" might be possible because of the very nature of this specific use case, but, since no checksum validation is done (the value is not recalculated), one cannot set RX_L4_CKSUM_GOOD or RX_L4_CKSUM_BAD. Hence RX_L4_CKSUM_NONE.

            Perhaps it pays to add a printout of rte_ipv4_udptcp_cksum_verify() invocation (temporarily) to the application. If it reports that the checksum is valid, then above explanation should prove correct (no checksum failure).

            Source https://stackoverflow.com/questions/71827706

            QUESTION

            dpdk ixgbe nic multi rx queue with rss not work well
            Asked 2022-Apr-11 at 05:25

            I am using IXGBE Nic, using dpdk 19.11 multi rx queue with rss "ETH_RSS_TCP | ETH_RSS_IP". IXGBE support max 64 queues, and i used 4 queues. But all packages arrvied to the same queue(queue 0), it seems rss function not work well. The following is the pseudo code of my rss part. Is the rss function not taking effect due to my incorrect configuration?

            ...

            ANSWER

            Answered 2022-Apr-11 at 05:25
            1. Looks like the program does not invoke rte_eth_dev_configure() before invoking rss_setup(). This is not correct as rte_eth_dev_configure() "must be invoked first before any other function in the Ethernet API" (doc reference). Please re-arrange the program to first invoke rte_eth_dev_configure() with rx_adv_conf.rss_conf and ETH_MQ_RX_RSS specified, then proceed with the rest of bring-up.

            2. In rss_setup(), the program invokes rte_eth_dev_rss_reta_update(). For the PMD in question, this API can only be invoked in started state (code reference). So please re-arrange the program a bit more to invoke rte_eth_dev_start() before rss_setup().

            3. Please make sure that TCP source port numbers (and/or IP source addresses) are randomised at the sender side. If IP/TCP source and destination fields do not vary, it's no surprise that the packets end up in the same Rx queue.

            Source https://stackoverflow.com/questions/71817725

            QUESTION

            softlockup with dpdk 19 mellanox connectx5
            Asked 2022-Apr-03 at 08:42

            I have server with centos 7.9 3.10.0-1160.53.1.el7.x86_64

            When running my dpdk 19 muliple process application i have softlockup

            The server i run on have 2 ixgbe 10G, and one 100G connectx-5

            ...

            ANSWER

            Answered 2022-Apr-03 at 08:42

            Adding iommu=pt intel_iommu=on to the grub solve the softlockup and the 10 G Rx

            Source https://stackoverflow.com/questions/71018338

            QUESTION

            rte flow for arp packet with dpdk
            Asked 2022-Mar-29 at 06:45

            Is there a way using rte_flow to send arp and ndp packet to specific rx queue with dpdk

            In the rte_flow_item_type I don’t see an entry for arp or ndp

            For ipv4 I did the following way

            ...

            ANSWER

            Answered 2022-Mar-29 at 00:05

            Since v18.05-rc1, there has been item type RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4. That being said, it might be unsupported by the PMD in question.

            Consider matching on the EtherType field instead:

            Source https://stackoverflow.com/questions/71643934

            QUESTION

            NIC is unavailable in DPDK application
            Asked 2022-Mar-29 at 06:29

            I'm studying DPDK and trying to create a simple application, however it can't see a NIC bound to DPDK.

            1. Here is a list of network devices I have on my machine
            ...

            ANSWER

            Answered 2022-Mar-29 at 06:29

            The main reason why DPDK ports are not identified in your environment is because the NIC in use is not having a supported vendor Poll Mode Driver. Please refer to list of supported NIC from various vendor Realtek is not among them.

            Work around: you can use PCAP PMD to solve the problem. Please follow the steps for your environment as

            1. ensure your ethernet port is linked to kernel driver r8169
            2. isntall libpacp-dev for your enviorment (linux/bsd)
            3. rebuild dpdk with PCAP support.
            4. start your application with following args --no-pci --vdev=net_pcap0,iface=enp1s0

            This will use libpcap PMD as wrapper for RX and TX over non supported NIC

            Source https://stackoverflow.com/questions/71657277

            QUESTION

            How to load balance by way of round-robin in DPDK using RTE_FLOW?
            Asked 2022-Mar-26 at 02:47

            in my problem RSS did not have a good load balance between CPU cores case the rx packets has been modified by insert tags between mac and ip so the dpdk could not recognize it.assume I want to load balance by way of round-robin, Multiple rx queues have been set up. in this question answer: How to disable RSS but still using multiple RX queues in DPDK? it says its possible to load balance in round robin fashion by using RTE_FLOW. what is the right way to do it grammatically ? I would like to know the API or structs for setting up the round-robin method here is my runtime environment infomation: 1)dpdk version: 19.11.9 2)nic PMD :ixgbe 3) fireware:825999 and XXV710 4) os version: ubuntu 16.04 kernel:4.4.0-186

            ...

            ANSWER

            Answered 2022-Mar-26 at 02:47

            As per the question

            RSS did not have a good load balance between CPU cores case the rx packets has been modified by insert tags between mac and ip

            There are couple of items which needs to be clarified. so let me explain

            1. Certain Physical and virtual NIC exposes RSS via DPDK RX offload for fixed tuples like IP, Protocol, TCP|UDP|SCTP port number.
            2. Certain NIC allows to configure the hash reta algorithm to better suit to needs (example when the source destination IP address is fixed we can skip and use others).
            3. As I recollect from DPDK 18.11, RTE_FLOW is been introduced to support RSS on selected RX queues (example Q1,Q2,Q3 can be RSS for TCP packets while Q4,Q5 can be used for UDP). But again this is based on the either Inner or Outer IP+PORT number
            4. For DPDK version 19.11 onwards RTE_FLOW is been enhanced to support RAW Pattern. The intend of this feature is support Special protocol which by default the NIC does not understand like (VXLAN, GENEVE, RTP and other protocols).
            5. For NIC like Fortville & Columbiaville (from Intel) allows loading of special firmware via DDP (Dynamic Device Personation) to configure special fabric headers or MPLS like headers (between ethernet and ip) to be parsed, lookup and used as seed for RSS (allowing better distribution).
            6. There are NIC which do support L2 layer but these would be limited SMAC, DMAC, VLAN1,VLAn2, MPLS only and not custom header.

            Hence depending upon NIC, vendor, RSS support for L2 and firmware the ability calculating RSS on fields between varies in port init or RTE_FLOW specific configuration. For example RSS ETH supported on

            1. I40E is I40E_INSET_DMAC | I40E_INSET_SMAC
            2. DPAA2 is NH_FLD_ETH_TYPE and NET_PROT_ETH
            3. CNXK is RSS_DMAC_INDEX
            4. OCTEONX2 is FLOW_KEY_TYPE_VLAN and FLOW_KEY_TYPE_CH_LEN_90B

            Hence for NIC ixgbe and XXV710 there is no ready support for the custom header between ethernet and IP.

            Alternatives:

            1. Use a smart NIC or FPGA: that is programmed to parse and RSS on your specific headers to RSS on multiple RX queue
            2. Work with Intel using XXV710 (Fortville): to create DDP which can parse your specific headers as RSS on multiple RX queue.
            3. Identify DPDK NIC: which can parse RAW header as defined 12.2.6.2. Once the support is added by the vendor you can create a simple traffic spread tool which will ensure traffic distribution across the desired RX queues in round robin fashion.
            4. Use SW to support the missing hardware.

            note: I am not recommending use of HW based static Round Robin as it will create 2 fold problem

            • if it is pure DPDK BOND Round ROBIN you will not have any flow pinning
            • If you use hash based pinning, there are chances elephant flow can pushed 1 or a few queues causing performance drops in cpu processing.
            • My recommendation is to use EVENTDEV model with atomic mode, which ensure better cache locality (at a given instance same flows will fall onto worker thread) and almost linear performance performance. sample app

            For option 4 (Software Model):

            1. Disable RSS in port_init function
            2. Use single RX queue to receive all the packet either custom rx thread.
            3. calculate the hash based on the desired header and update mbuf hash field.
            4. Use rte_distributor library to spread traffic based on the custom.
            5. or use rte_eventdev with atomic model to spread the work load on multiple worker.

            [Clarification from Comments]:

            1. I have asked relevant practitioners, they said modifying the pmd driver can solves my problem, its the only way?

            [ANSWER] Since you are using custom header and not generic VLAN|IP|Port this suggestion is not correct. As you have clarified in question and comments you want to distribute like RSS for custom header.

            1. I haven't written any code about rte_flow distribution yet, i read the rte_flow example, don't see the code to configure round-robin

            [ANSWER] as explained above not all nic support RSS and RAW. Since your current NIC is ixgbe and i40e the function of parsing and executing RSS for custom header is unlikely. you can try option 2 (work with intel create new ddp) for i40e to achieve the same or implement in SW as suggested in option 4.

            1. im not ask for solution, I just want to know how to set up round robin by 'RTE_FLOW' Can you give me a few API

            [ANSWER] normally one updates with code snippets or steps used for reproducing the error. But the current question is more like clarification. Please refer above.

            Source https://stackoverflow.com/questions/71581875

            QUESTION

            DPDK l2fwd - How to forward ethernet interface to my PMD
            Asked 2022-Mar-18 at 12:37

            I have a board with one ethernet interface (eth0) running Linux. I'm trying to forward all incoming traffic from eth0 to my PMD driver, using dpdk-l2fwd example application.

            Here is what I've tried:

            ...

            ANSWER

            Answered 2022-Feb-14 at 09:16

            [EDIT-1] clarification of using same interface for DPDK and Kernel routing

            Answer> as discussed over comments please refer to DPDKD + kernel on same interface

            Based on the information shared there are multiple questions to the single query I'm trying to bypass all traffic to the PMD I'm currently developing. Addressing each one separately below

            1. question 1: using dpdk-l2fwd example application

            Answer> DPDK application l2fwd application makes use of basic APi with almost no HW offloads. Based on your environment (I have a board with one ethernet interface (eth0)), the right set of parameters should be -p 0x1 --no-mac-updating -T 1. This will configure the application to receive and transmit packet using single DPDK interface (that is eth0 on your board).

            Note: DPDK Application can work with DPDK PMD both physical and virtual

            1. question 2: I tried to use net_tap, using the following command:

            Answer> If the intend is to intercept the traffic from physical and then forward to tap interface, then one needs modify the eal arguments as ./build/l2fwd --vdev=net_tap0,iface="my_eth0" -- -p 0x3 -T 1 --no-mac-updating. This will allow the application to probe physical NXP interface (eth0) and make use of Linux TAP interface as secondary interface. Thus any traffic from NXP and TAP will be cross connected such as NXP (eth0) <==> TAP (my_eth0)

            1. question 3: ./usertools/dpdk-devbind.py --status returns empty

            Answer> Form the dpdk site supported NIC list NXP dpaa, dpaa2, enetc, enetfec, pfe. Cross checking the kernel driver fsl_dpaa2_eth I think it is safe to assume dpaa2 PMD is supported. As you have mentioned the NIC is not enumerated, it looks like there are certain caveats to such model revision, supported board, BSP package, vendor-sub vendor ID check etc. More details can be found Board Support Package, and DPAA2 NIC guide

            Debug & Alternative solutions:

            1. To start with use the Kernel Driver to bring in packets
            2. Use extra logging and debug to identify why the NIC is shown in the application

            Approach 1:

            1. Make sure the NIC is bind with kernel driver fsl_dpaa2_eth.
            2. ensure NIC is connected and link is up with ethtool eth0
            3. set to promiscous mode with ifconfig eth0 promisc up
            4. start DPDK application with PCAP PMD, ./build/l2fwd --vdev=net_pcap0,iface=eth0 -- -p 1 --no-mac-updating -T 1
            5. Check packet are received and redirected to PCAP eth0 PMD by checking the statistics.

            Approach 2:

            1. Ideally the NIC should be categorized under network device to be probed by debind.py.
            2. Check the device details using lshw -c net -businfo for network.
            3. try checking with lspci -Dvmmnnk [PCIe BUS:Slot:Function id] for network details.
            4. If above details does not show up as network device this might be reason for not getting listed.
            • Suggestions or workaround: You can try to forcefully bind with igb_uio or vfio-pci (I am not much famialr with NXP SoC) by dpdk-devbind -b vfio-pci [PCIe S:B:F]. Then cross check with lspci -ks [PCIe S:B:F]. Once successfully done, one can start dpdk l2fwd in PMD debug mode with ./build/l2fwd -a [PCIe S:B:F] --log-level=pmd,8 -- -p 1 --no-mac-updating | more. Thus by intercepting and interpreting the logs one can identify what is going

            Note:

            1. It is assumed the application is build with static libraries and not dynamic. To build with static libraries use make static for l2fwd.
            2. For the described use case recommended application is basicfwd/skeleton rather than l2fwd.

            Source https://stackoverflow.com/questions/71101764

            QUESTION

            RSS hash for ip over gre packet
            Asked 2022-Mar-14 at 15:03

            I am using Mellanox Technologies MT27800 Family [ConnectX-5], using dpdk multi rx queue with rss "ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP"

            I receive packet with ETH:IP:GRE:ETH:IP:UDP

            I want the load balancing to be according to inner ip+port and not with the gre ip

            I tried adding ETH_RSS_LEVEL_INNERMOST to the rss_hf but i got an error about rss invalid value 0x800000003afbc should be 0xf00000000003afbc

            I am using dpdk 21.11.0 - Is it possible to do it and how? If not how can i do it.

            Is it also supported in dpdk 19.11?

            ...

            ANSWER

            Answered 2022-Mar-12 at 16:36

            Support for GRE and/or Inner RSS is touch and go for many NIC, so most NIC does not work out of box. For example

            1. For Intel Fortville (10gbps, 25Gbps, 40Gbps) NIC: one needs to update firmware and DDP profile to parse and compute inner RSS.
            2. For Intel Columbiaville (100Gbps, 50Gbps, 25Gbps) NIC: one needs to update firmware and then update driver. As I recollect default DDP profile parses GRE.
            3. In case of Mellanox MLX5 (there are multiple variant for ConnectX-5 and Connect-6), some of them support GRE based parsing and RSS, while other require ESWITCH to perform such actions.

            Hence using testpmd one needs to

            1. enable MQ_RSS in port and RX queue configuration
            2. For specific (inner RSS) enable via RTE_FLOW API

            With MT2892 Family [ConnectX-6 Dx] one can enable Inner 5 tuple RSS for GRE encapsulated packet with testpmd.

            1. Start packet generator (DPDK pktgen) use sudo ./usr/local/bin/pktgen --file-prefix=3 -a81:00.0,txq_inline_mpw=128 -l 6-27 -- -P -m "[8-11:12-27].0" -N -s"0:rtp_balanced_gre.pcap"
            2. Start testpmd in interactive mode with multiple RX queues using dpdk-testpmd --socket-mem=1024 --file-prefix=2 -l 7,8-23 -a0000:41:00.1,mprq_en=1,rxqs_min_mprq=1,mprq_log_stride_num=9,txq_inline_mpw=128,rxq_pkt_pad_en=1,rxq_cqe_comp_en=4 -- --port-numa-config=0,0 --socket-num=0 --burst=128 --txd=8192 --rxd=8192 --mbcache=512 --rxq=16 --txq=16 --nb-cores=8 -a --forward-mode=io --numa --rss-udp --enable-rx-cksum --no-mlockall --no-lsc-interrupt -a --enable-rx-cksum --enable-drop-en --eth-link-speed=100000 --no-rmv-interrupt -i
            3. In interactive shell configure the rule as flow create 0 ingress pattern eth / ipv4 / gre / eth / ipv4 / udp / end actions rss level 2 types ip udp end queues 0 1 2 3 end / end.

            Note:

            1. Ensure to use the right format in match field eth / ipv4 / gre / eth / ipv4 / udp /
            2. if the rule is not set on the device only device RX queue0 will be receiving the packets.

            Source https://stackoverflow.com/questions/71338802

            QUESTION

            How to Receive and capture packets from internet/remote host using DPDK?
            Asked 2022-Mar-13 at 06:15

            I want to capture Raw Packets from any host and capture them in a file like "recieved.pcap" bypassing the kernel. I am using a virtual ec2 instace for this. To bypass kernel I have set up DPDK on my instance. I am new to networking and any help would be appreciated !

            I have:

            1. DPDK version: 19.11.5 installed on Amazon Linux 2 ec2 instance.
            2. NIC binded to DPDK : Amazon eni
            3. I have libpcap-dev installed.

            I ran testpmd application ,and here is the output :

            ...

            ANSWER

            Answered 2022-Mar-13 at 06:15

            Based on the intercept scenario, there are 4 options to solve this problem

            1. Option-1: for Remote Termination use of single DPDK port with MAC|VLAN address modification.
            2. Option-2: for Remote Termination use of two DPDK port with no MAC address modification.
            3. Option-3: for Local Termination use of DPDK TAP PMD to terminate to HOST/GUEST OS, with no packet MAC|VLAN modification.
            4. Option-4: for Local Termination use of DPDK PCAP PMD to intercept the packets from Kernel interface, with no packet MAC|VLAN modification.

            Please follow the steps to capture the traffic appropriately. For

            Option-1:

            1. Create the VM with 1 DPDK port.
            2. Use testpmd or sample application l2fwd (modified with DPDK rte_pdump_init) to capture and replay back into PORT.
            3. Since MAC-address|VLAN is modified with appropriate rules one can forward from remote HOST to desired destination
            4. Start dpdk PDUMP application, example sudo ./build/app/dpdk-pdump -- --pdump 'port=0,queue=*,tx-dev=./tx.pcap' . This will capture packets that enter from outside and write into tx.pcap.

            Option-2:

            1. Create VM with 2 DPDK ports
            2. Start DPDK modified application (use dpdk rte_pdump_init) either skeleton or l2fwd.
            3. for l2fwd use option --no-mac-updating.
            4. Start dpdk PDUMP application, example sudo ./build/app/dpdk-pdump -- --pdump 'port=0,queue=*,tx-dev=./tx.pcap' . This will capture packets that enter from outside and write into tx.pcap

            Option-3:

            1. Create the VM with 1 DPDK port (AMAZON enic)
            2. bind the desired DPDK port (WAN) with appropriate UIO driver
            3. Start DPDK application like basicfwd sudo ./build/basicfwd -l 2 --vdev=net_tap0,mac="mac address of DPDK port" -a .
            4. Within linux terminal sudo ifconfig dtap0 up
            5. [optional] add desired route entry.
            6. use linux tcpdump, python or any packet capture application to grab packets from dtap0 interface for RX|TX or both direction.

            Option-4:

            1. Create the VM with 1 DPDK port (AMAZON enic)
            2. make sure the interface is bind with kernel driver.
            3. ensure the interface is able to reach outside network (WAN) using ping -I stackoverflow.com
            4. run dpdk modified application like basicfwd or l2fwd with rte_pdump_init (example ./build/l2fwd -l 2 --vdev=net_pcap0,iface= -- -p 1 -T 1 --no-mac-updating)
            5. capture the packets using DPDK PDUMP applciation. example: sudo ./build/app/dpdk-pdump -- --pdump 'port=0,queue=*,tx-dev=./tx.pcap'

            Note:

            • refer for use DPDK PDUMP use case.
            • recommendation is use option 3, as it eliminates the need for DPDK secondary process and disabling ASLR.

            Source https://stackoverflow.com/questions/71391465

            QUESTION

            DPDK l3fwd-acl application is unable to send or receive using net_tap PMD using namespaces
            Asked 2022-Mar-10 at 02:09

            I compiled dpdk 19.11.11 version to test l3fwd-acl. After starting it in a VirtualBox instance with 2 CPUs and 2 ports I have used 2 TAP interfaces to simulate 2 network interfaces for putting traffic over one and getting that back over another. I have used the following command (and get the following output):

            ...

            ANSWER

            Answered 2022-Mar-09 at 07:45

            L3fwd-acl works with IP packets only, for all non IP packets it drops. Hence with TAP PMD I had to follow the changes as

            1. Disable any NIC PCIe device using --no-pci
            2. Use new commands as sudo ./build/l3fwd-acl --file-prefix=mytest -l 2-4 --vdev=net_tap0 --vdev=net_tap1 --no-pci -- -P -p 3 --config="(0,0,4),(1,0,3)" --rule_ipv4=ipv4-sample.db --rule-ipv6=ipv6-sample.db --eth-dest=0, --eth-dest=1,
            3. edit ip-sample.db file with the entries to be assigned for dtap0 and dtap1.
            4. refer section 24.1.3 to identify the format and for default drop rule
            5. start the application and use the following netns commands.

            Source https://stackoverflow.com/questions/71345975

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install dpdk

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/spdk/dpdk.git

          • CLI

            gh repo clone spdk/dpdk

          • sshUrl

            git@github.com:spdk/dpdk.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link