Comments (6)
Thank you for suggestion.
We are going to fix this pkt-> cache
code in next release.
The current implementation of raw-socket mode uses single thread for all packet processing, so the issue you mentioned is not critical for usual usecase now. But we need to fix it for the future version, which more flexible dataplane for various type of network I/O.
Thanks,
from lagopus.
Hi @eugene-che,
We have fixed the issue you mentioned and modified cache-related code to be more general as follows:
This patch is to be included at lagopu version 0.2.6.
---
src/dataplane/mgr/sock_io.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/dataplane/mgr/sock_io.c b/src/dataplane/mgr/sock_io.c
index b18620d..c6074e3 100644
--- a/src/dataplane/mgr/sock_io.c
+++ b/src/dataplane/mgr/sock_io.c
@@ -39,6 +39,10 @@
#include "thread.h"
#include "lock.h"
+#ifdef HAVE_DPDK
+#include "dpdk.h"
+#endif /* HAVE_DPDK */
+
static struct port_stats *rawsock_port_stats(struct port *port);
#define NUM_PORTID 256
@@ -46,12 +50,10 @@ static struct port_stats *rawsock_port_stats(struct port *port);
static struct pollfd pollfd[NUM_PORTID];
static int ifindex[NUM_PORTID];
-#ifndef HAVE_DPDK
static bool no_cache = true;
static int kvs_type = FLOWCACHE_HASHMAP_NOLOCK;
static int hashtype = HASH_TYPE_INTEL64;
static struct flowcache *flowcache;
-#endif /* HAVE_DPDK */
static bool volatile clear_cache = false;
@@ -636,13 +638,11 @@ dp_rawsock_thread_loop(__UNUSED const lagopus_thread_t *selfptr,
return rv;
}
-#ifndef HAVE_DPDK
if (no_cache == false) {
flowcache = init_flowcache(kvs_type);
} else {
flowcache = NULL;
}
-#endif /* HAVE_DPDK */
dparg = arg;
running = dparg->running;
@@ -655,12 +655,10 @@ dp_rawsock_thread_loop(__UNUSED const lagopus_thread_t *selfptr,
err(errno, "poll");
}
for (i = 0; i < portidx; i++) {
-#ifndef HAVE_DPDK
if (clear_cache == true && flowcache != NULL) {
clear_all_cache(flowcache);
clear_cache = false;
}
-#endif /* HAVE_DPDK */
flowdb_rdlock(NULL);
port = dp_port_lookup(DATASTORE_INTERFACE_TYPE_ETHERNET_RAWSOCK,
(uint32_t)i);
@@ -681,11 +679,8 @@ dp_rawsock_thread_loop(__UNUSED const lagopus_thread_t *selfptr,
if (port->bridge != NULL &&
(port->ofp_port.config & OFPPC_NO_RECV) == 0) {
pkt = alloc_lagopus_packet();
-#ifndef HAVE_DPDK
- if (flowcache != NULL) {
- pkt->cache = flowcache;
- }
-#endif /* HAVE_DPDK */
+ pkt->cache = flowcache;
+
/* not enough? */
(void)OS_M_APPEND(pkt->mbuf, MAX_PACKET_SZ);
len = read_packet(pollfd[i].fd, OS_MTOD(pkt->mbuf, uint8_t *),
@@ -769,6 +764,11 @@ dp_rawsock_thread_init(int argc,
lagopus_result_t
dp_rawsock_thread_start(void) {
+#ifdef HAVE_DPDK
+ no_cache = app.no_cache;
+ kvs_type = app.kvs_type;
+ hashtype = app.hashtype;
+#endif /* HAVE_DPDK */
return dp_thread_start(&rawsock_thread, &rawsock_lock, &rawsock_run);
}
Could you check it on your environment?
from lagopus.
Hi @ynkjm,
The patch works as expected. Thank you!
The only thing that bothers me, the patched code does not handle failures of alloc_lagopus_packet
.
I have encountered a crush at this site, while debugging my patch to fix the queue handling.
Eugene
from lagopus.
I have inserted the patched switch into another testbed. Unfortunately, it crashes.
The problem seems to be somewhere in cache:
- gdb show instructions extracted from the cache point to a wrong piece of memory.
- if I reapply my modification
pkt->cache = NULL
(which practically disables caching for rawsock interfaces) the switch stops crashing
I do not have any guesses for the source of error right now.
from lagopus.
Hi @eugene-che,
Thank you for your detail report. We are going to fix this segfault issue by reference to your patch.
from lagopus.
HI @eugene-che,
We have submitted a series of bug fix patch to the Lagopus 0.2.8 release.
We have fixed this issues by reference of your patch code.
Thanks,
Yoshi
from lagopus.
Related Issues (20)
- Setting queues on ports HOT 9
- Question about GTP support HOT 24
- lagoons with dpdk in ubuntu16.04 HOT 1
- Performance of rawsocket HOT 3
- GTP Decoded packets don't have IP version 4 bit are decoded as ip version 0 HOT 2
- Alphanumeric TEID field HOT 1
- Issue with setting dl_type
- Support for openflow resubmit action or any equivalent action HOT 1
- Support for ARM 32 bit HOT 2
- [GTPU] GTP-U support HOT 1
- X720 and jumbo frame HOT 4
- KNI interface support in Lagopus HOT 1
- DPDK software PMD's in lagopus HOT 1
- Issues when using OFPActionEncap with type IPv6
- Lagopus dpdk parameters HOT 1
- Bad I/O performance using librte_pmd_pcap on Veth ports. HOT 4
- Problems installing lagopus in Centos 7 HOT 1
- Seeing higher latency with Lagopus in 64bit mode compared to 32bit
- Double tagged frame once stripped is treated as untagged packets in lagopus
- Recommendation for memory profiler needed to narrow down possible lagopus memory leak
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 lagopus.