What you wrote is not correct.

DPDK drivers run in user-mode, as part of the vpp executable. To a first 
approximation: device drivers use the uio_pci_generic kernel module to map 
device registers into user-space. Once that happens, user-mode device drivers – 
either dpdk or vpp native – manipulate the device registers directly. No 
transition to kernel mode and/or system calls are required on a regular basis.

Device RX and TX rings are allocated from hugetlb pages (aka non-pageable 
memory), mmap’ed into the vpp+dpdk address space.

In short, the kernel is simply not involved in packet processing.

D.

From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Gulakh
Sent: Wednesday, July 11, 2018 7:19 AM
To: vpp-dev@lists.fd.io
Subject: [vpp-dev] DPDK and VPP Relationship

Hi,
I have a question about DPDK and VPP.
As far as I know, DPDK has some NIC drivers developed for some types of NICs. 
These drivers are Linux device drivers that are installed as kernel module e.g. 
uio_pci_generic and ixgbe (yes?).

In Linux , kernel modules have the as privilege as the Linux kernel. So DPDK 
NIC drivers run in kernel space (yes?)

When a packet comes in, It is first received by DPDK drivers in kernel mode. As 
VPP runs in user space, there must be a context switch to deliver packet to VPP.
Now if VPP decides that the packet should be forwarded to some next hop, then 
the packet must have another context switch from user space to kernel space, 
meaning that to forward a packet which is not destined to us, we have to 
tolerate two context switch that is not necessary.

I guess (because I have seen an L3 forwarding sample in DPDK sample programs 
but I did not dive into it to see what it did)  that DPDK has a FIB by which it 
can decide what to do with the received packet without the need of context 
switch(all done in kernel space).

I summary:
I think that we have 3 ways to handle a received packet:

1- Send it from DPDK to VPP and tolerate two context switch
          Question: if that is the case, Why do we need to tolerate 2 context 
switch that is not necessary?

2- Have a FIB in DPDK and forward the received packet directly in kernel space
         Question: if that is the case, How does VPP show this packet in its 
show trace because VPP is unaware of this packet?

3- Another solution that I do not know ....
          Question: Please tell me the procedure

Thanks
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#9823): https://lists.fd.io/g/vpp-dev/message/9823
Mute This Topic: https://lists.fd.io/mt/23244323/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to