Comments (7)
I think it's possible to support a configurable packet size and have a default of RTE_MBUF_DEFAULT_BUF_SIZE
.
Please note we probably also need to change this:
PcapPlusPlus/Pcap++/src/MBufRawPacket.cpp
Line 38 in 1ff377c
Would you consider opening a PR with this change?
from pcapplusplus.
PcapPlusPlus/Pcap++/src/MBufRawPacket.cpp
Lines 25 to 27 in 1ff377c
PcapPlusPlus/Pcap++/src/MBufRawPacket.cpp
Line 38 in 1ff377c
PcapPlusPlus/Pcap++/src/DpdkDevice.cpp
Line 425 in 1ff377c
PcapPlusPlus/Pcap++/src/KniDevice.cpp
Lines 149 to 157 in 1ff377c
As seen here, both MBUF_DATA_SIZE_DEFINE and rte_pktmbuf_pool_create depend on RTE_MBUF_DEFAULT_DATAROOM. Do we modify the values in MBUF_DATA_SIZE_DEFINE and rte_pktmbuf_pool_create when enabling Jumbo Frame using macros? For example, like this.
MBufRawPacket.cpp
#ifndef MBUF_DATA_SIZE_DEFINE
#ifdef JUMBO_FRAME_SIZE_DEFINE
# define MBUF_DATA_SIZE_DEFINE (JUMBO_FRAME_SIZE_DEFINE + RTE_PKTMBUF_HEADROOM)
#else
# define MBUF_DATA_SIZE_DEFINE RTE_MBUF_DEFAULT_DATAROOM
#endif
#endi
const int MBufRawPacket::MBUF_DATA_SIZE = MBUF_DATA_SIZE_DEFINE;
DpdkDevice.cpp and KniDevice.cpp
#ifdef JUMBO_FRAME_SIZE_DEFINE
# define MBUF_DATA_SIZE_DEFINE (JUMBO_FRAME_SIZE_DEFINE + RTE_PKTMBUF_HEADROOM)
#else
# define MBUF_DATA_SIZE_DEFINE RTE_MBUF_DEFAULT_DATAROOM
#endif
// create mbuf pool
memPool = rte_pktmbuf_pool_create(mempoolName, mBufPoolSize, MEMPOOL_CACHE_SIZE, 0, MBUF_DATA_SIZE_DEFINE, rte_socket_id());
Such modifications appear quite messy. Perhaps we could redefine MBUF_DATA_SIZE_DEFINE in one place and then use it directly in other places.
from pcapplusplus.
If only three places, it should be fine. Personally, I consider it is more appropriate to define the value within the header, yet I'm struggling to identify the suitable header for this purpose.
from pcapplusplus.
If only three places, it should be fine. Personally, I consider it is more appropriate to define the value within the header, yet I'm struggling to identify the suitable header for this purpose.
The beginning of a bad smell indeed. Yes, we should define it in a header file.
from pcapplusplus.
I think that instead of a const value, we can add it to the DpdkDevice
constructor as an optional argument (with a default size of RTE_MBUF_DEFAULT_BUF_SIZE
) so users can set whatever value they want.
MBufRawPacket::init()
takes a DpdkDevice
as an argument so we can extract this value from there.
Regarding KniDevice
- I wouldn't change anything unless you really need it. KNI has been deprecated in DPDK and we'll soon remove it from PcapPlusPlus code-base
from pcapplusplus.
I've noticed that we try to minimize the inclusion of DPDK headers in our header files. If we modify the function signature in the header file to add a default value for the function parameter, RTE_MBUF_DEFAULT_BUF_SIZE, it will inevitably require including DPDK headers. I'm not sure if this is the right approach.
from pcapplusplus.
I've noticed that we try to minimize the inclusion of DPDK headers in our header files. If we modify the function signature in the header file to add a default value for the function parameter, RTE_MBUF_DEFAULT_BUF_SIZE, it will inevitably require including DPDK headers. I'm not sure if this is the right approach.
Yes, you're right. Maybe the default value can be some magic number (like -1
or something else) which will translate to RTE_MBUF_DEFAULT_BUF_SIZE
. We can mention it in the doxygen documentation
from pcapplusplus.
Related Issues (20)
- Power of 2 restriction for number of queues in DpdkDevice HOT 3
- Fix building warning due to LightPcapNg HOT 10
- Migrate LightPcapNg to the forked repo HOT 9
- Error linking pcapplusplus using vcpkg and CMake. HOT 2
- improve macOS get default gateway IP HOT 13
- PcapPlusPlus Configuration Error in CMake with vcpkg HOT 8
- PcapLiveDevice socket is not close HOT 2
- Problem with TcpReassembly and chunked transfer encoding HOT 6
- SNI Extension with zero length HOT 2
- Find alternative package for netifaces HOT 1
- Transfer this repository into PcapPlusPlus GitHub organization HOT 15
- warning C4193 HOT 4
- warning C4133 HOT 1
- warning C4129 HOT 1
- -DBUILD_SHARED_LIBS=ON cannot work in Windows HOT 12
- Address all MSVC compilation warnings
- using DPDK in server client fashion HOT 1
- Introduce GitHub issue template HOT 3
- DpdkDevice::openMultiQueues() is not NUMA aware HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pcapplusplus.