PF_RING | High-speed packet processing framework | Audio Utils library
kandi X-RAY | PF_RING Summary
kandi X-RAY | PF_RING Summary
PF_RING is a Linux kernel module and user-space framework that allows you to process packets at high-rates while providing you a consistent API for packet processing applications.
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 PF_RING
PF_RING Key Features
PF_RING Examples and Code Snippets
Community Discussions
Trending Discussions on PF_RING
QUESTION
Yes, I will ultimately be using this for DMA but lets leave coherency aside for the moment. I have 64 bit BAR registers, therefore, AFAIK, all of RAM (e.g. higher than 4G) is available for DMA.
I am looking for about 64MB of contiguous RAM. Yes, that's a lot.
Ubuntu 16 and 18 have CONFIG_CMA=y but CONFIG_DMA_CMA is not set at kernel compile time.
I note that if both were set (at Kernel build time) I could simply call dma_alloc_coherent, however, for logistical reasons, it is undesirable to recompile the kernel.
The machines will always have at least 32GB of RAM, do not run anything RAM intensive, and the kernel module will load shortly after boot before RAM becomes significantly fragmented and, AFAIK, nothing else is using the CMA.
I have set the kernel parameter CMA=1G. (and have tried 256M and 512M)
...ANSWER
Answered 2020-Feb-20 at 15:49The short version is that __GFP_DIRECT_RECLAIM
(also provided by __GFP_RECLAIM
) is necessary as dma_alloc_contiguous
is eventually called and it checks, via a call to gfpflags_allow_blocking
, that blocking is okay. I used the usual GFP_KERNEL
which provides __GFP_RECLAIM | __GFP_IO | __GFP_FS
. But before all that one must call dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))
with DMA_BIT_MASK(64)
not DMA_BIT_MASK(32)
.
QUESTION
I'm working on porting a packet parsing/manipulation program from FreeBSD to Linux (specifically Debian - jessie). This program implements a bi-directional bridge between two physical interfaces while performing parsing/manipulation prior to TX operations.
In FreeBSD, this application used Pcap to RX/TX. In Linux, so far I've tested with Pcap, PACKET_MMAP (using TPACKET_V2) and Vanilla PF_RING.
Test Results:Using the same hardware and laboratory environment, I observed the following (approximate) throughput results from several tests performed with iperf:
- FreeBSD Kernel bridge: 880Mb/s
- FreeBSD Pcap (user space) bridge: 700Mb/s
- Debian Kernel bridge: 880Mb/s
- Debian Pcap (user space) bridge: 120Kb/s
- Debian Vanilla PF_RING (user space) bridge: 980Kb/s
- Debian PACKET_MMAP (user space) bridge: 480Kb/s
The Debian user space speeds seem ridiculous to me. They're unusable - and I suspect I'm missing something. Is there a system option I need to enable ("go fast", lol)?
Or is this just how it is with Linux user space bridging?
Edit / UpdateI have a lingering suspicion that there's an administrative limitation affecting the Debian tests. I'm searching system documentation for (something / anything) to no avail. Any ideas on what could be limiting this?
...ANSWER
Answered 2017-Jun-28 at 16:25Obscure questions find obscure answers...
After much research I found the "problems" with Linux in this case is actually the result of optimizations. By default, apparently, the systems are optimizing for large sustained loads (so YMMV with the below "fix").
I resolved the speed issues and found the same throughput as the FreeBSD systems by using ethtool to adjust the optimizations on my two bridge interfaces:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PF_RING
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