Commit ac6fdbfe authored by Ofir Bitton's avatar Ofir Bitton Committed by Oded Gabbay

habanalabs/gaudi: support CS with no completion

As part of the staged submission feature, we need Gaudi to support
command submissions that will never get a completion.
Signed-off-by: default avatarOfir Bitton <obitton@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent 8e39e75a
...@@ -225,6 +225,7 @@ static int cs_parser(struct hl_fpriv *hpriv, struct hl_cs_job *job) ...@@ -225,6 +225,7 @@ static int cs_parser(struct hl_fpriv *hpriv, struct hl_cs_job *job)
parser.queue_type = job->queue_type; parser.queue_type = job->queue_type;
parser.is_kernel_allocated_cb = job->is_kernel_allocated_cb; parser.is_kernel_allocated_cb = job->is_kernel_allocated_cb;
job->patched_cb = NULL; job->patched_cb = NULL;
parser.completion = true;
rc = hdev->asic_funcs->cs_parser(hdev, &parser); rc = hdev->asic_funcs->cs_parser(hdev, &parser);
......
...@@ -1223,6 +1223,7 @@ struct hl_cs_job { ...@@ -1223,6 +1223,7 @@ struct hl_cs_job {
* MSG_PROT packets. Relevant only for GAUDI as GOYA doesn't * MSG_PROT packets. Relevant only for GAUDI as GOYA doesn't
* have streams so the engine can't be busy by another * have streams so the engine can't be busy by another
* stream. * stream.
* @completion: true if we need completion for this CS.
*/ */
struct hl_cs_parser { struct hl_cs_parser {
struct hl_cb *user_cb; struct hl_cb *user_cb;
...@@ -1237,6 +1238,7 @@ struct hl_cs_parser { ...@@ -1237,6 +1238,7 @@ struct hl_cs_parser {
u8 job_id; u8 job_id;
u8 is_kernel_allocated_cb; u8 is_kernel_allocated_cb;
u8 contains_dma_pkt; u8 contains_dma_pkt;
u8 completion;
}; };
/* /*
......
...@@ -5060,7 +5060,8 @@ static int gaudi_validate_cb(struct hl_device *hdev, ...@@ -5060,7 +5060,8 @@ static int gaudi_validate_cb(struct hl_device *hdev,
* 1. A packet that will act as a completion packet * 1. A packet that will act as a completion packet
* 2. A packet that will generate MSI-X interrupt * 2. A packet that will generate MSI-X interrupt
*/ */
parser->patched_cb_size += sizeof(struct packet_msg_prot) * 2; if (parser->completion)
parser->patched_cb_size += sizeof(struct packet_msg_prot) * 2;
return rc; return rc;
} }
...@@ -5287,8 +5288,11 @@ static int gaudi_parse_cb_mmu(struct hl_device *hdev, ...@@ -5287,8 +5288,11 @@ static int gaudi_parse_cb_mmu(struct hl_device *hdev,
* 1. A packet that will act as a completion packet * 1. A packet that will act as a completion packet
* 2. A packet that will generate MSI interrupt * 2. A packet that will generate MSI interrupt
*/ */
parser->patched_cb_size = parser->user_cb_size + if (parser->completion)
sizeof(struct packet_msg_prot) * 2; parser->patched_cb_size = parser->user_cb_size +
sizeof(struct packet_msg_prot) * 2;
else
parser->patched_cb_size = parser->user_cb_size;
rc = hl_cb_create(hdev, &hdev->kernel_cb_mgr, hdev->kernel_ctx, rc = hl_cb_create(hdev, &hdev->kernel_cb_mgr, hdev->kernel_ctx,
parser->patched_cb_size, false, false, parser->patched_cb_size, false, false,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment