fixed the msg_transfer issue

This commit is contained in:
xianfeng.du 2023-08-01 19:08:29 +08:00
parent 50e11a1be7
commit a9d77a5d60
4 changed files with 18 additions and 7 deletions

View File

@ -130,9 +130,9 @@ int32_t msg_transfer_send_start(int32_t handle_id, uint16_t cu_flag)
UCP_PRINT_ERROR("msg_transfer_send_start,UNINITIALIZED_QUEUE");
return UNINITIALIZED_QUEUE;
}
msg_queue_dl_block_init(inst_id,que_id);
return SUCCESS;
int32_t ret = msg_queue_dl_block_init(inst_id,que_id);
return ret;
}
@ -157,10 +157,16 @@ int32_t msg_transfer_alloc_msg(int32_t handle_id, uint16_t cu_flag, uint32_t buf
MsgQueueLocalMgt_t* pMsgQueueLocalMgt = get_msg_queue_local_mgt();
MsgQueueLocalInfo_t* ch = (MsgQueueLocalInfo_t*)&pMsgQueueLocalMgt->localDlQueue[inst_id][que_id];
if (bufSize > ch->availableSize) {
UCP_PRINT_ERROR("msg_transfer_alloc_msg,OUT_OF_BLOCK_MEMORY");
return OUT_OF_BLOCK_MEMORY;
}
if (0 == ch->msgCnt)
{
msg_queue_dl_alloc_buf(inst_id,que_id);
}
*(uint64_t *)buf = ch->bufAddr + ch->offset;
*availableSize = ch->availableSize;
*offset = ch->offset;

View File

@ -73,6 +73,11 @@ int32_t msg_queue_dl_block_init(uint8_t inst_id, uint8_t que_id)
PetSmLocalMgt_t* pPetSmLocalMgt = get_pet_sm_local_mgt();
MsgQueueCommonInfo_t* chCommon = pPetSmLocalMgt->pDlQueue[inst_id][que_id];
if((MSG_MBUF_HEAD_SIZE >= chCommon->bufSize) || (0 == ch->bufBase))
{
return UNINITIALIZED_QUEUE;
}
ch->availableSize = chCommon->bufSize - MSG_MBUF_HEAD_SIZE;
ch->offset = 0;
ch->msgCnt = 0;

@ -1 +1 @@
Subproject commit 99d6653cd9acb4b2797ec3c36252f0c80dcf0895
Subproject commit 8ea437815106d50f2230e0b3989f7f7174ac0fed

@ -1 +1 @@
Subproject commit 7908793098da2a3fcc5da3f3f2831c84fe4947f7
Subproject commit 7bd0c4a6b87b70cf28b0c47eea74b731c9e90e38