Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
trx-ecpri
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
trx-ecpri
Commits
bdfdf896
Commit
bdfdf896
authored
May 03, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
aa579a91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
27 deletions
+13
-27
trx_ecpri_dpdk.c
trx_ecpri_dpdk.c
+13
-27
No files found.
trx_ecpri_dpdk.c
View file @
bdfdf896
...
...
@@ -48,11 +48,11 @@
#include "private/trx_driver.h"
#include "utils.c"
#define EFREQ
3840
0
#define EFREQ
1
0
//#define DEBUG // Enables / deactivates log_debug
//
#define TRACE 0
#define TRACE 0
//#define TRACE_TX
//
#define TRACE_RX
#define TRACE_RX
//#define MONITOR
//#define MONITOR_EXIT
...
...
@@ -76,8 +76,10 @@
#define N_SAMPLES (32)
#define TRX_MAX_GROUP 1500
#define TRX_BUF_MAX_SIZE 500000
#define TXRX_BUF_MAX_SIZE 500000
//#define TRX_BUF_MAX_SIZE 500000
//#define TXRX_BUF_MAX_SIZE 500000
#define TRX_BUF_MAX_SIZE 4000
#define TXRX_BUF_MAX_SIZE 4000
#define STATISTIC_REFRESH_RATE INT64_C(500 * 1000 * 1000)
#define STAT_INT_LEN "9"
...
...
@@ -164,10 +166,6 @@ static volatile int rx_trace_ready = 0;
static
volatile
int
tx_trace_ready
=
1
;
static
int64_t
encode_counter_prev
=
0
;
static
int64_t
decode_counter_prev
=
0
;
static
volatile
int
rx_exited
=
0
;
static
volatile
int
trxr_exited
=
0
;
static
volatile
int
trxw_exited
=
0
;
static
volatile
int
tx_exited
=
0
;
#endif
// Network
...
...
@@ -410,15 +408,14 @@ static void trace_handler(struct timespec initial, TRXEcpriState * s) {
log_info
(
"TRACE"
,
"Duration: %"
PRIi64
,
d
);
log_info
(
"TRACE"
,
"FRAME_FREQ: %"
PRIi64
,
FRAME_FREQ
);
usleep
(
1000
*
200
);
#ifdef TRACE_TX
while
(
!
tx_exited
||
!
trxw_exited
)
{
usleep
(
1000
);
}
memset
(
n
,
'\0'
,
256
);
sprintf
(
n
,
"%s/tx.trace"
,
s
->
log_directory
);
f
=
fopen
(
n
,
"wb+"
);
start
=
(
TRACE
+
encode_counter_prev
)
%
tx_rbuf
.
buf_len
;
log_info
(
"TRACE"
,
"Writing %d frames to tx.trace"
,
tx_rbuf
.
write_index
+
tx_rbuf
.
buf_len
-
start
);
log_info
(
"TRACE"
,
"Writing %d frames to tx.trace"
,
(
tx_rbuf
.
write_index
+
tx_rbuf
.
buf_len
-
start
)
%
tx_rbuf
.
buf_len
);
for
(
int
i
=
start
;
i
!=
tx_rbuf
.
write_index
;
i
=
(
i
+
1
)
%
tx_rbuf
.
buf_len
)
{
fwrite
(
ones
,
14
,
1
,
f
);
fwrite
(((
uint8_t
*
)
tx_rbuf
.
buffer
)
+
i
*
tx_rbuf
.
len
,
tx_rbuf
.
len
,
1
,
f
);
...
...
@@ -429,7 +426,7 @@ static void trace_handler(struct timespec initial, TRXEcpriState * s) {
sprintf
(
n
,
"%s/trxw.trace"
,
s
->
log_directory
);
f
=
fopen
(
n
,
"wb+"
);
start
=
(
TRACE
)
%
trxw_rbuf
[
0
].
buf_len
;
log_info
(
"TRACE"
,
"Writing %d frames to trxw.trace"
,
trxw_rbuf
[
0
].
write_index
+
trxw_rbuf
[
0
].
buf_len
-
start
);
log_info
(
"TRACE"
,
"Writing %d frames to trxw.trace"
,
(
trxw_rbuf
[
0
].
write_index
+
trxw_rbuf
[
0
].
buf_len
-
start
)
%
trxw_rbuf
[
0
].
buf_len
);
for
(
int
i
=
start
;
i
!=
trxw_rbuf
[
0
].
write_index
;
i
=
(
i
+
1
)
%
trxw_rbuf
[
0
].
buf_len
)
{
for
(
int
j
=
0
;
j
<
TX_N_CHANNEL
;
j
++
)
fwrite
((
uint8_t
*
)
(((
Complex
*
)
trxw_rbuf
[
j
].
buffer
)
+
i
*
trxw_rbuf
[
0
].
len
),
trxw_rbuf
[
0
].
len
*
sizeof
(
Complex
),
1
,
f
);
...
...
@@ -438,14 +435,11 @@ static void trace_handler(struct timespec initial, TRXEcpriState * s) {
#endif
#ifdef TRACE_RX
while
(
!
rx_exited
||
!
trxr_exited
)
{
usleep
(
1000
);
}
memset
(
n
,
'\0'
,
256
);
sprintf
(
n
,
"%s/rx.trace"
,
s
->
log_directory
);
f
=
fopen
(
n
,
"wb+"
);
start
=
TRACE
%
rx_rbuf
.
buf_len
;
log_info
(
"TRACE"
,
"Writing %d frames to rx.trace"
,
rx_rbuf
.
write_index
+
rx_rbuf
.
buf_len
-
start
);
log_info
(
"TRACE"
,
"Writing %d frames to rx.trace"
,
(
rx_rbuf
.
write_index
+
rx_rbuf
.
buf_len
-
start
)
%
rx_rbuf
.
buf_len
);
for
(
int
i
=
start
;
i
!=
rx_rbuf
.
write_index
;
i
=
(
i
+
1
)
%
rx_rbuf
.
buf_len
)
{
fwrite
(((
uint8_t
*
)
rx_rbuf
.
buffer
)
+
i
*
rx_rbuf
.
len
,
rx_rbuf
.
len
,
1
,
f
);
}
...
...
@@ -455,7 +449,7 @@ static void trace_handler(struct timespec initial, TRXEcpriState * s) {
sprintf
(
n
,
"%s/trxr.trace"
,
s
->
log_directory
);
f
=
fopen
(
n
,
"wb+"
);
start
=
(
TRACE
+
decode_counter_prev
)
%
trxr_rbuf
[
0
].
buf_len
;
log_info
(
"TRACE"
,
"Writing %d frames to trxr.trace"
,
trxr_rbuf
[
0
].
write_index
+
trxr_rbuf
[
0
].
buf_len
-
start
);
log_info
(
"TRACE"
,
"Writing %d frames to trxr.trace"
,
(
trxr_rbuf
[
0
].
write_index
+
trxr_rbuf
[
0
].
buf_len
-
start
)
%
trxr_rbuf
[
0
].
buf_len
);
for
(
int
i
=
start
;
i
!=
trxr_rbuf
[
0
].
write_index
;
i
=
(
i
+
1
)
%
trxr_rbuf
[
0
].
buf_len
)
{
for
(
int
j
=
0
;
j
<
RX_N_CHANNEL
;
j
++
)
fwrite
((
uint8_t
*
)
(((
Complex
*
)
trxr_rbuf
[
j
].
buffer
)
+
i
*
trxr_rbuf
[
0
].
len
),
trxr_rbuf
[
0
].
len
*
sizeof
(
Complex
),
1
,
f
);
...
...
@@ -553,10 +547,8 @@ static void *recv_thread(void *p) {
if
((
recv_counter
.
counter
+
nc
)
>=
(
rx_rbuf
.
buf_len
+
TRACE
))
{
rx_trace_ready
=
1
;
log_info
(
"RECV_THREAD"
,
"RX Trace ready"
);
rx_exited
=
1
;
pthread_exit
(
EXIT_SUCCESS
);
}
else
if
(
rx_trace_ready
)
{
rx_exited
=
1
;
pthread_exit
(
EXIT_SUCCESS
);
}
#endif
...
...
@@ -708,10 +700,8 @@ static void *encode_thread(void *p) {
if
(
sync_complete
&&
(
encode_counter
.
counter
+
nb_frames
)
>=
(
tx_rbuf
.
buf_len
+
TRACE
))
{
tx_trace_ready
=
1
;
log_info
(
"ENCODE_THREAD"
,
"TX Trace ready"
);
tx_exited
=
1
;
pthread_exit
(
EXIT_SUCCESS
);
}
else
if
(
tx_trace_ready
)
{
tx_exited
=
1
;
pthread_exit
(
EXIT_SUCCESS
);
}
#endif
...
...
@@ -813,10 +803,8 @@ static void *decode_thread(void *p) {
if
(
received_pkts
&&
((
decode_counter
.
counter
+
nc
)
>=
(
trxr_rbuf
[
0
].
buf_len
+
TRACE
)))
{
rx_trace_ready
=
1
;
log_info
(
"DECODE_THREAD"
,
"RX Trace ready"
);
trxr_exited
=
1
;
pthread_exit
(
EXIT_SUCCESS
);
}
else
if
(
rx_trace_ready
)
{
trxr_exited
=
1
;
pthread_exit
(
EXIT_SUCCESS
);
}
#endif
...
...
@@ -1164,10 +1152,8 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void
if
((
write_counter
.
counter
+
write_count
)
>=
(
trxw_rbuf
[
0
].
buf_len
+
TRACE
))
{
tx_trace_ready
=
1
;
log_info
(
"TRX_ECPRI_WRITE"
,
"TX Trace ready"
);
trxw_exited
=
1
;
pthread_exit
(
EXIT_SUCCESS
);
}
else
if
(
tx_trace_ready
)
{
trxw_exited
=
1
;
pthread_exit
(
EXIT_SUCCESS
);
}
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment