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
cf655f38
Commit
cf655f38
authored
Feb 13, 2025
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add one recv counter per antenna
parent
c1df2e0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
20 deletions
+33
-20
trx_ecpri.c
trx_ecpri.c
+33
-20
No files found.
trx_ecpri.c
View file @
cf655f38
...
@@ -200,7 +200,7 @@ static uint8_t rx_buf[MAX_PACKET_SIZE * MAX_RX_BURST];
...
@@ -200,7 +200,7 @@ static uint8_t rx_buf[MAX_PACKET_SIZE * MAX_RX_BURST];
static
uint8_t
tx_buf
[
MAX_PACKET_SIZE
*
MAX_TX_BURST
];
static
uint8_t
tx_buf
[
MAX_PACKET_SIZE
*
MAX_TX_BURST
];
// Counters
// Counters
static
counter_stat_t
recv_counter
;
// frames received from RRH
static
counter_stat_t
recv_counter
[
MAX_CHANNELS
]
;
// frames received from RRH
static
counter_stat_t
read_counter
;
// frames passed to amarisoft stack
static
counter_stat_t
read_counter
;
// frames passed to amarisoft stack
static
counter_stat_t
write_counter
;
// samples to write from TRX
static
counter_stat_t
write_counter
;
// samples to write from TRX
static
counter_stat_t
sent_counter
;
// frames sent to RRH
static
counter_stat_t
sent_counter
;
// frames sent to RRH
...
@@ -232,19 +232,11 @@ static void print_debug(FILE * f, int print_header) {
...
@@ -232,19 +232,11 @@ static void print_debug(FILE * f, int print_header) {
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"
\n
"
,
"
\n
"
,
"RX RA"
,
"TRXR RA"
,
"TRXR RA"
,
"TRXW RA"
,
"TRXW RA"
,
"TX RA"
,
"RX WA"
,
"TRXR WA"
,
"TRXR WA"
,
"TRXW WA"
,
"TRXW WA"
,
"TX WA"
,
"TRXW RI"
,
"TRXW RI"
,
"TRXW WI"
,
"TRXW WI"
,
"TRXR RI"
,
"TRXR RI"
,
...
@@ -289,6 +281,9 @@ static void print_stats(FILE * f, int print_header) {
...
@@ -289,6 +281,9 @@ static void print_stats(FILE * f, int print_header) {
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
"%"
STAT_INT_LEN
"s "
...
@@ -297,7 +292,10 @@ static void print_stats(FILE * f, int print_header) {
...
@@ -297,7 +292,10 @@ static void print_stats(FILE * f, int print_header) {
"
\n
"
,
"
\n
"
,
"rx dropped"
,
"rx dropped"
,
"tx dropped"
,
"tx dropped"
,
"received"
,
"received 0"
,
"received 1"
,
"received 2"
,
"received 3"
,
"read"
,
"read"
,
"write"
,
"write"
,
"sent"
,
"sent"
,
...
@@ -316,6 +314,9 @@ static void print_stats(FILE * f, int print_header) {
...
@@ -316,6 +314,9 @@ static void print_stats(FILE * f, int print_header) {
"%"
STAT_INT_LEN
""
PRIi64
" "
"%"
STAT_INT_LEN
""
PRIi64
" "
"%"
STAT_INT_LEN
""
PRIi64
" "
"%"
STAT_INT_LEN
""
PRIi64
" "
"%"
STAT_INT_LEN
""
PRIi64
" "
"%"
STAT_INT_LEN
""
PRIi64
" "
"%"
STAT_INT_LEN
""
PRIi64
" "
"%"
STAT_INT_LEN
""
PRIi64
" "
"%"
STAT_INT_LEN
""
PRIi64
" "
"%"
STAT_INT_LEN
""
PRIi64
"pps "
"%"
STAT_INT_LEN
""
PRIi64
"pps "
"%"
STAT_INT_LEN
""
PRIi64
"pps "
"%"
STAT_INT_LEN
""
PRIi64
"pps "
"%"
STAT_INT_LEN
""
PRIi64
"pps "
"%"
STAT_INT_LEN
""
PRIi64
"pps "
...
@@ -324,12 +325,15 @@ static void print_stats(FILE * f, int print_header) {
...
@@ -324,12 +325,15 @@ static void print_stats(FILE * f, int print_header) {
"
\n
"
,
"
\n
"
,
rx_drop_counter
.
counter
,
rx_drop_counter
.
counter
,
tx_drop_counter
.
counter
,
tx_drop_counter
.
counter
,
recv_counter
.
counter
,
recv_counter
[
0
].
counter
,
recv_counter
[
1
].
counter
,
recv_counter
[
2
].
counter
,
recv_counter
[
3
].
counter
,
read_counter
.
counter
,
read_counter
.
counter
,
write_counter
.
counter
,
write_counter
.
counter
,
sent_counter
.
counter
,
sent_counter
.
counter
,
lost_rx_counter
.
counter
,
lost_rx_counter
.
counter
,
recv_counter
.
pps
,
recv_counter
[
0
]
.
pps
,
read_counter
.
pps
,
read_counter
.
pps
,
write_counter
.
pps
,
write_counter
.
pps
,
sent_counter
.
pps
,
sent_counter
.
pps
,
...
@@ -483,8 +487,8 @@ static void *recv_thread(void *p) {
...
@@ -483,8 +487,8 @@ static void *recv_thread(void *p) {
antenna_id
=
ntohs
(
header
->
antenna_id
);
antenna_id
=
ntohs
(
header
->
antenna_id
);
// Exit if SEQ ID is not sequential
// Exit if SEQ ID is not sequential
if
(
prev_seq_id
[
antenna_id
]
!=
-
1
&&
(
header
->
seq_id
+
256
-
prev_seq_id
[
antenna_id
])
%
256
!=
1
)
{
if
(
prev_seq_id
[
antenna_id
]
!=
-
1
&&
(
header
->
seq_id
+
256
-
prev_seq_id
[
antenna_id
])
%
256
!=
1
)
{
log_info
(
"RECV_THREAD"
,
"seq_ids are not sequential (%d, %d)"
,
//
log_info("RECV_THREAD", "seq_ids are not sequential (%d, %d)",
prev_seq_id
[
antenna_id
],
header
->
seq_id
);
//
prev_seq_id[antenna_id], header->seq_id);
update_counter
(
&
lost_rx_counter
,
(
header
->
seq_id
+
256
-
prev_seq_id
[
antenna_id
])
%
256
);
update_counter
(
&
lost_rx_counter
,
(
header
->
seq_id
+
256
-
prev_seq_id
[
antenna_id
])
%
256
);
//stop = 1; break;
//stop = 1; break;
}
}
...
@@ -494,9 +498,12 @@ static void *recv_thread(void *p) {
...
@@ -494,9 +498,12 @@ static void *recv_thread(void *p) {
stop
=
1
;
break
;
stop
=
1
;
break
;
}
}
// Exit if there is no more space in the buffer
// Exit if there is no more space in the buffer
if
(
!
rbuf_write_amount
(
&
trxr_rbuf
[
antenna_id
]))
if
(
!
rbuf_write_amount
(
&
trxr_rbuf
[
antenna_id
]))
{
log_exit
(
"RECV_THREAD"
,
"No more space in %s buffer"
,
rbuf_increment_read
(
&
trxr_rbuf
[
antenna_id
],
MAX_IQ_PAYLOAD
);
trxr_rbuf
[
antenna_id
].
name
);
update_counter
(
&
rx_drop_counter
,
MAX_IQ_PAYLOAD
/
N_SAMPLES
);
//log_exit("RECV_THREAD", "No more space in %s buffer",
// trxr_rbuf[antenna_id].name);
}
prev_seq_id
[
antenna_id
]
=
header
->
seq_id
;
prev_seq_id
[
antenna_id
]
=
header
->
seq_id
;
iq_packet
=
(
ecpri_iq_packet
*
)
(
rx_buf
+
j
*
MAX_PACKET_SIZE
);
iq_packet
=
(
ecpri_iq_packet
*
)
(
rx_buf
+
j
*
MAX_PACKET_SIZE
);
...
@@ -505,7 +512,7 @@ static void *recv_thread(void *p) {
...
@@ -505,7 +512,7 @@ static void *recv_thread(void *p) {
iq_packet
->
iq_samples
,
iq_packet
->
iq_samples
,
iq_packet
->
payload_size
);
iq_packet
->
payload_size
);
rbuf_increment_write
(
&
trxr_rbuf
[
antenna_id
],
trxr_rbuf
[
antenna_id
].
block_len
);
rbuf_increment_write
(
&
trxr_rbuf
[
antenna_id
],
trxr_rbuf
[
antenna_id
].
block_len
);
update_counter
(
&
recv_counter
,
iq_packet
->
payload_size
/
N_SAMPLES
);
update_counter
(
&
recv_counter
[
antenna_id
]
,
iq_packet
->
payload_size
/
N_SAMPLES
);
}
}
if
(
stop
)
{
if
(
stop
)
{
for
(
int
j
=
0
;
j
<
ret
;
j
++
)
{
for
(
int
j
=
0
;
j
<
ret
;
j
++
)
{
...
@@ -643,7 +650,10 @@ static void *statistic_thread(void *p) {
...
@@ -643,7 +650,10 @@ static void *statistic_thread(void *p) {
update_counter_pps
(
&
rx_drop_counter
);
update_counter_pps
(
&
rx_drop_counter
);
update_counter_pps
(
&
tx_drop_counter
);
update_counter_pps
(
&
tx_drop_counter
);
update_counter_pps
(
&
recv_counter
);
update_counter_pps
(
&
recv_counter
[
0
]);
update_counter_pps
(
&
recv_counter
[
1
]);
update_counter_pps
(
&
recv_counter
[
2
]);
update_counter_pps
(
&
recv_counter
[
3
]);
update_counter_pps
(
&
read_counter
);
update_counter_pps
(
&
read_counter
);
update_counter_pps
(
&
write_counter
);
update_counter_pps
(
&
write_counter
);
update_counter_pps
(
&
sent_counter
);
update_counter_pps
(
&
sent_counter
);
...
@@ -744,7 +754,10 @@ int start(TRXEcpriState * s) {
...
@@ -744,7 +754,10 @@ int start(TRXEcpriState * s) {
tx_seq_id
=
0
;
tx_seq_id
=
0
;
init_counter
(
&
rx_drop_counter
);
init_counter
(
&
rx_drop_counter
);
init_counter
(
&
tx_drop_counter
);
init_counter
(
&
tx_drop_counter
);
init_counter
(
&
recv_counter
);
init_counter
(
&
recv_counter
[
0
]);
init_counter
(
&
recv_counter
[
1
]);
init_counter
(
&
recv_counter
[
2
]);
init_counter
(
&
recv_counter
[
3
]);
init_counter
(
&
read_counter
);
init_counter
(
&
read_counter
);
init_counter
(
&
write_counter
);
init_counter
(
&
write_counter
);
init_counter
(
&
sent_counter
);
init_counter
(
&
sent_counter
);
...
...
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