Merge remote-tracking branch 'origin/t2-fix-4x4' into integration_2024_w48 (!3115)
T2: minor fix for 4x4 processing - correct max number of LDPC segments for T2 processing - use pointer arithmetics in retrieve_ldpc_enc_op() in T2 lib to optimize loop processing
This commit is contained in:
@@ -595,23 +595,22 @@ static int retrieve_ldpc_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,
|
||||
|
||||
static int retrieve_ldpc_enc_op(struct rte_bbdev_enc_op **ops, const uint16_t n, uint8_t *p_out, nrLDPC_params_per_cb_t *perCB)
|
||||
{
|
||||
struct rte_bbdev_op_data *output;
|
||||
struct rte_mbuf *m;
|
||||
unsigned int i;
|
||||
char *data;
|
||||
uint8_t *out;
|
||||
int offset = 0;
|
||||
for (i = 0; i < n; ++i) {
|
||||
output = &ops[i]->ldpc_enc.output;
|
||||
m = output->data;
|
||||
for (int i = 0; i < n; ++i) {
|
||||
struct rte_bbdev_op_data *output = &ops[i]->ldpc_enc.output;
|
||||
struct rte_mbuf *m = output->data;
|
||||
uint16_t data_len = rte_pktmbuf_data_len(m) - output->offset;
|
||||
out = &p_out[offset];
|
||||
data = m->buf_addr;
|
||||
for (int byte = 0; byte < data_len; byte++)
|
||||
for (int bit = 0; bit < 8; bit++)
|
||||
out[byte * 8 + bit] = (data[m->data_off + byte] >> (7 - bit)) & 1;
|
||||
uint8_t *out = &p_out[offset];
|
||||
const char *data = m->buf_addr + m->data_off;
|
||||
const char *end = data + data_len;
|
||||
while (data < end) {
|
||||
uint8_t byte = *data++; // get the current byte
|
||||
for (int bit = 7; bit >= 0; --bit) {
|
||||
*out++ = (byte >> bit) & 1; // extract each bit
|
||||
}
|
||||
}
|
||||
offset += perCB[i].E_cb;
|
||||
rte_pktmbuf_free(ops[i]->ldpc_enc.output.data);
|
||||
rte_pktmbuf_free(m);
|
||||
rte_pktmbuf_free(ops[i]->ldpc_enc.input.data);
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -99,7 +99,8 @@
|
||||
/** Maximum number of possible input LLR = NR_LDPC_NCOL_BG1*NR_LDPC_ZMAX */
|
||||
#define NR_LDPC_MAX_NUM_LLR 27000
|
||||
|
||||
#define NR_LDPC_MAX_NUM_CB 72
|
||||
/** Maximum number of segments per TB = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS */
|
||||
#define NR_LDPC_MAX_NUM_CB 144
|
||||
|
||||
// ==============================================================================
|
||||
// GLOBAL CONSTANT VARIABLES
|
||||
|
||||
@@ -232,7 +232,7 @@ int decode_offload(PHY_VARS_gNB *phy_vars_gNB,
|
||||
{
|
||||
NR_gNB_ULSCH_t *ulsch = &phy_vars_gNB->ulsch[ULSCH_id];
|
||||
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_process;
|
||||
int16_t z_ol[NR_LDPC_MAX_NUM_CB * LDPC_MAX_CB_SIZE] __attribute__((aligned(16)));
|
||||
int16_t z_ol[LDPC_MAX_CB_SIZE] __attribute__((aligned(16)));
|
||||
int8_t l_ol[NR_LDPC_MAX_NUM_CB * LDPC_MAX_CB_SIZE] __attribute__((aligned(16)));
|
||||
const int kc = decParams->BG == 2 ? 52 : 68;
|
||||
uint32_t A = (harq_process->TBS) << 3;
|
||||
@@ -247,8 +247,8 @@ int decode_offload(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
for (int r = 0; r < harq_process->C; r++) {
|
||||
decParams->perCB[r].E_cb = nr_get_E(G, harq_process->C, decParams->Qm, pusch_pdu->nrOfLayers, r);
|
||||
memcpy(&z_ol[offset], ulsch_llr + r_offset, decParams->perCB[r].E_cb * sizeof(*z_ol));
|
||||
simde__m128i *pv_ol128 = (simde__m128i *)&z_ol[offset];
|
||||
memcpy(z_ol, ulsch_llr + r_offset, decParams->perCB[r].E_cb * sizeof(int16_t));
|
||||
simde__m128i *pv_ol128 = (simde__m128i *)z_ol;
|
||||
simde__m128i *pl_ol128 = (simde__m128i *)&l_ol[offset];
|
||||
for (int i = 0, j = 0; j < ((kc * harq_process->Z) >> 4) + 1; i += 2, j++) {
|
||||
pl_ol128[j] = simde_mm_packs_epi16(pv_ol128[i], pv_ol128[i + 1]);
|
||||
|
||||
Reference in New Issue
Block a user