Add carrier index to uplink PCAP captures

master
Ismael Gomez 4 years ago
parent c280ac5ad6
commit dd9889e07c

@ -30,7 +30,7 @@ public:
class process_callback
{
public:
virtual void process_pdu(uint8_t* buff, uint32_t len, channel_t channel, int ul_nof_prbs = -1) = 0;
virtual void process_pdu(uint8_t* buff, uint32_t len, uint32_t ue_cc_idx, channel_t channel, int ul_nof_prbs = -1) = 0;
};
pdu_queue(srslog::basic_logger& logger) : pool(DEFAULT_POOL_SIZE), callback(NULL), logger(logger) {}
@ -38,7 +38,7 @@ public:
uint8_t* request(uint32_t len);
void deallocate(const uint8_t* pdu);
void push(const uint8_t* ptr, uint32_t len, channel_t channel = DCH, int ul_nof_prbs = -1);
void push(const uint8_t* ptr, uint32_t len, uint32_t ue_cc_idx, channel_t channel = DCH, int ul_nof_prbs = -1);
bool process_pdus();
@ -51,6 +51,7 @@ private:
typedef struct {
uint8_t ptr[MAX_PDU_LEN];
uint32_t len;
uint32_t ue_cc_idx;
channel_t channel;
int grant_nof_prbs;
#ifdef SRSRAN_BUFFER_POOL_LOG_ENABLED

@ -50,15 +50,16 @@ void pdu_queue::deallocate(const uint8_t* pdu)
}
/* Demultiplexing of logical channels and dissassemble of MAC CE
* This function enqueues the packet and returns quicly because ACK
* This function enqueues the packet and returns quickly because ACK
* deadline is important here.
*/
void pdu_queue::push(const uint8_t* ptr, uint32_t len, channel_t channel, int grant_nof_prbs)
void pdu_queue::push(const uint8_t* ptr, uint32_t len, uint32_t ue_cc_idx, channel_t channel, int grant_nof_prbs)
{
if (ptr) {
pdu_t* pdu = (pdu_t*)ptr;
pdu->len = len;
pdu->channel = channel;
pdu->ue_cc_idx = ue_cc_idx;
pdu->grant_nof_prbs = grant_nof_prbs;
if (!pdu_q.try_push(pdu)) {
logger.warning("Error pushing pdu: queue is full");
@ -75,7 +76,7 @@ bool pdu_queue::process_pdus()
pdu_t* pdu;
while (pdu_q.try_pop(pdu)) {
if (callback) {
callback->process_pdu(pdu->ptr, pdu->len, pdu->channel, pdu->grant_nof_prbs);
callback->process_pdu(pdu->ptr, pdu->len, pdu->ue_cc_idx, pdu->channel, pdu->grant_nof_prbs);
}
cnt++;
have_data = true;

@ -160,7 +160,7 @@ public:
srsran_softbuffer_rx_t* get_rx_softbuffer(uint32_t enb_cc_idx, uint32_t tti);
uint8_t* request_buffer(uint32_t tti, uint32_t enb_cc_idx, uint32_t len);
void process_pdu(srsran::unique_byte_buffer_t pdu, uint32_t grant_nof_prbs);
void process_pdu(srsran::unique_byte_buffer_t pdu, uint32_t ue_cc_idx, uint32_t grant_nof_prbs);
srsran::unique_byte_buffer_t release_pdu(uint32_t tti, uint32_t enb_cc_idx);
void clear_old_buffers(uint32_t tti);

@ -331,10 +331,10 @@ int mac::push_pdu(uint32_t tti_rx,
tti_rx,
nof_bytes,
(int)pdu->size());
auto process_pdu_task = [this, rnti, ul_nof_prbs](srsran::unique_byte_buffer_t& pdu) {
auto process_pdu_task = [this, rnti, enb_cc_idx, ul_nof_prbs](srsran::unique_byte_buffer_t& pdu) {
srsran::rwlock_read_guard lock(rwlock);
if (check_ue_active(rnti)) {
ue_db[rnti]->process_pdu(std::move(pdu), ul_nof_prbs);
ue_db[rnti]->process_pdu(std::move(pdu), enb_cc_idx, ul_nof_prbs);
} else {
logger.debug("Discarding PDU rnti=0x%x", rnti);
}

@ -287,7 +287,7 @@ uint32_t ue::set_ta(int ta_)
return nof_cmd;
}
void ue::process_pdu(srsran::unique_byte_buffer_t pdu, uint32_t grant_nof_prbs)
void ue::process_pdu(srsran::unique_byte_buffer_t pdu, uint32_t ue_cc_idx, uint32_t grant_nof_prbs)
{
// Unpack ULSCH MAC PDU
mac_msg_ul.init_rx(pdu->size(), true);
@ -300,11 +300,11 @@ void ue::process_pdu(srsran::unique_byte_buffer_t pdu, uint32_t grant_nof_prbs)
}
if (pcap != nullptr) {
pcap->write_ul_crnti(pdu->data(), pdu->size(), rnti, true, last_tti, UL_CC_IDX);
pcap->write_ul_crnti(pdu->data(), pdu->size(), rnti, true, last_tti, ue_cc_idx);
}
if (pcap_net != nullptr) {
pcap_net->write_ul_crnti(pdu->data(), pdu->size(), rnti, true, last_tti, UL_CC_IDX);
pcap_net->write_ul_crnti(pdu->data(), pdu->size(), rnti, true, last_tti, ue_cc_idx);
}
uint32_t lcid_most_data = 0;

@ -56,7 +56,7 @@ public:
bool get_uecrid_successful();
void process_pdu(uint8_t* pdu, uint32_t nof_bytes, srsran::pdu_queue::channel_t channel, int ul_nof_prbs);
void process_pdu(uint8_t* pdu, uint32_t nof_bytes, uint32_t cc_idx, srsran::pdu_queue::channel_t channel, int ul_nof_prbs);
void mch_start_rx(uint32_t lcid);
private:

@ -123,7 +123,7 @@ void demux::push_pdu(uint8_t* buff, uint32_t nof_bytes, uint32_t tti)
// Process Real-Time PDUs
process_sch_pdu_rt(buff, nof_bytes, tti);
return pdus.push(buff, nof_bytes, srsran::pdu_queue::DCH);
return pdus.push(buff, nof_bytes, 0, srsran::pdu_queue::DCH);
}
/* Demultiplexing of MAC PDU associated with SI-RNTI. The PDU passes through
@ -147,7 +147,7 @@ bool demux::process_pdus()
return pdus.process_pdus();
}
void demux::process_pdu(uint8_t* mac_pdu, uint32_t nof_bytes, srsran::pdu_queue::channel_t channel, int ul_nof_prbs)
void demux::process_pdu(uint8_t* mac_pdu, uint32_t nof_bytes, uint32_t cc_idx, srsran::pdu_queue::channel_t channel, int ul_nof_prbs)
{
Debug("Processing MAC PDU channel %d", channel);
switch (channel) {

Loading…
Cancel
Save