dpdk | SPDK mirror of DPDK
kandi X-RAY | dpdk Summary
kandi X-RAY | dpdk Summary
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
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dpdk
dpdk Key Features
dpdk Examples and Code Snippets
Community Discussions
Trending Discussions on dpdk
QUESTION
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:35According 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).
QUESTION
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:25Looks like the program does not invoke
rte_eth_dev_configure()
before invokingrss_setup()
. This is not correct asrte_eth_dev_configure()
"must be invoked first before any other function in the Ethernet API" (doc reference). Please re-arrange the program to first invokerte_eth_dev_configure()
withrx_adv_conf.rss_conf
andETH_MQ_RX_RSS
specified, then proceed with the rest of bring-up.In
rss_setup()
, the program invokesrte_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 invokerte_eth_dev_start()
beforerss_setup()
.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.
QUESTION
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:42Adding iommu=pt intel_iommu=on to the grub solve the softlockup and the 10 G Rx
QUESTION
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:05Since 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:
QUESTION
I'm studying DPDK and trying to create a simple application, however it can't see a NIC bound to DPDK.
- Here is a list of network devices I have on my machine
ANSWER
Answered 2022-Mar-29 at 06:29The 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
- ensure your ethernet port is linked to kernel driver
r8169
- isntall libpacp-dev for your enviorment (linux/bsd)
- rebuild dpdk with PCAP support.
- 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
QUESTION
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:47As 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
- Certain Physical and virtual NIC exposes RSS via DPDK RX offload for fixed tuples like IP, Protocol, TCP|UDP|SCTP port number.
- 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).
- 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
- 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). - 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).
- 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
- I40E is
I40E_INSET_DMAC | I40E_INSET_SMAC
- DPAA2 is
NH_FLD_ETH_TYPE and NET_PROT_ETH
- CNXK is
RSS_DMAC_INDEX
- 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:
- Use a smart NIC or FPGA: that is programmed to parse and RSS on your specific headers to RSS on multiple RX queue
- Work with Intel using XXV710 (Fortville): to create DDP which can parse your specific headers as RSS on multiple RX queue.
- 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 simpletraffic spread tool
which will ensure traffic distribution across the desired RX queues in round robin fashion. - 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):
- Disable RSS in port_init function
- Use single RX queue to receive all the packet either custom rx thread.
- calculate the hash based on the desired header and update mbuf hash field.
- Use
rte_distributor
library to spread traffic based on the custom. - or use
rte_eventdev
with atomic model to spread the work load on multiple worker.
[Clarification from Comments]:
- 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.
- 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.
- 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.
QUESTION
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
- 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
- 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)
- 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:
- To start with use the Kernel Driver to bring in packets
- Use extra logging and debug to identify why the NIC is shown in the application
Approach 1:
- Make sure the NIC is bind with kernel driver
fsl_dpaa2_eth
. - ensure NIC is connected and link is up with
ethtool eth0
- set to promiscous mode with
ifconfig eth0 promisc up
- start DPDK application with PCAP PMD,
./build/l2fwd --vdev=net_pcap0,iface=eth0 -- -p 1 --no-mac-updating -T 1
- Check packet are received and redirected to PCAP eth0 PMD by checking the statistics.
Approach 2:
- Ideally the NIC should be categorized under network device to be probed by debind.py.
- Check the device details using
lshw -c net -businfo
fornetwork
. - try checking with
lspci -Dvmmnnk [PCIe BUS:Slot:Function id]
for network details. - 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 withlspci -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:
- It is assumed the application is build with static libraries and not dynamic. To build with static libraries use
make static
for l2fwd. - For the described use case recommended application is
basicfwd/skeleton
rather than l2fwd.
QUESTION
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:36Support for GRE and/or Inner RSS is touch and go for many NIC, so most NIC does not work out of box. For example
- For Intel Fortville (10gbps, 25Gbps, 40Gbps) NIC: one needs to update firmware and DDP profile to parse and compute inner RSS.
- For Intel Columbiaville (100Gbps, 50Gbps, 25Gbps) NIC: one needs to update firmware and then update driver. As I recollect default DDP profile parses GRE.
- 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
- enable MQ_RSS in port and RX queue configuration
- 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.
- 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"
- 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
- 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:
- Ensure to use the right format in match field eth / ipv4 / gre / eth / ipv4 / udp /
- if the rule is not set on the device only device RX queue0 will be receiving the packets.
QUESTION
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:
- DPDK version: 19.11.5 installed on Amazon Linux 2 ec2 instance.
- NIC binded to DPDK : Amazon eni
- I have libpcap-dev installed.
I ran testpmd application ,and here is the output :
...ANSWER
Answered 2022-Mar-13 at 06:15Based on the intercept scenario, there are 4 options to solve this problem
- Option-1: for Remote Termination use of single DPDK port with MAC|VLAN address modification.
- Option-2: for Remote Termination use of two DPDK port with no MAC address modification.
- Option-3: for Local Termination use of DPDK TAP PMD to terminate to HOST/GUEST OS, with no packet MAC|VLAN modification.
- 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:
- Create the VM with 1 DPDK port.
- Use testpmd or sample application l2fwd (modified with DPDK rte_pdump_init) to capture and replay back into PORT.
- Since MAC-address|VLAN is modified with appropriate rules one can forward from remote HOST to desired destination
- 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:
- Create VM with 2 DPDK ports
- Start DPDK modified application (use dpdk rte_pdump_init) either skeleton or l2fwd.
- for l2fwd use option --no-mac-updating.
- 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:
- Create the VM with 1 DPDK port (AMAZON enic)
- bind the desired DPDK port (WAN) with appropriate UIO driver
- Start DPDK application like basicfwd
sudo ./build/basicfwd -l 2 --vdev=net_tap0,mac="mac address of DPDK port" -a
. - Within linux terminal
sudo ifconfig dtap0 up
- [optional] add desired route entry.
- use linux tcpdump, python or any packet capture application to grab packets from dtap0 interface for RX|TX or both direction.
Option-4:
- Create the VM with 1 DPDK port (AMAZON enic)
- make sure the interface is bind with kernel driver.
- ensure the interface is able to reach outside network (WAN) using
ping -I stackoverflow.com
- 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
) - 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.
QUESTION
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:45L3fwd-acl works with IP packets only, for all non IP packets it drops. Hence with TAP PMD I had to follow the changes as
- Disable any NIC PCIe device using
--no-pci
- 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,
- edit ip-sample.db file with the entries to be assigned for
dtap0 and dtap1
. - refer section 24.1.3 to identify the format and for default drop rule
- start the application and use the following netns commands.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dpdk
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page