As part of the staged submission feature, we need Gaudi to support command submissions that will never get a completion.
Unified · Split
| @@ -225,6 +225,7 @@ static int cs_parser(struct hl_fpriv *hpriv, struct hl_cs_job *job) · 224 unmodified lines | ||
| 225 | 225 | parser.queue_type = job->queue_type; |
| 226 | 226 | parser.is_kernel_allocated_cb = job->is_kernel_allocated_cb; |
| 227 | 227 | job->patched_cb = NULL; |
| 228 | + parser.completion = true; | |
| 228 | 229 | |
| 229 | 230 | rc = hdev->asic_funcs->cs_parser(hdev, &parser); |
| 230 | 231 | |
| @@ -1223,6 +1223,7 @@ struct hl_cs_job { · 1222 unmodified lines | ||
| 1223 | 1223 | * MSG_PROT packets. Relevant only for GAUDI as GOYA doesn't |
| 1224 | 1224 | * have streams so the engine can't be busy by another |
| 1225 | 1225 | * stream. |
| 1226 | + * @completion: true if we need completion for this CS. | |
| 1226 | 1227 | */ |
| 1227 | 1228 | struct hl_cs_parser { |
| 1228 | 1229 | struct hl_cb *user_cb; |
| @@ -1237,6 +1238,7 @@ struct hl_cs_parser { · 8 unmodified lines | ||
| 1237 | 1238 | u8 job_id; |
| 1238 | 1239 | u8 is_kernel_allocated_cb; |
| 1239 | 1240 | u8 contains_dma_pkt; |
| 1241 | + u8 completion; | |
| 1240 | 1242 | }; |
| 1241 | 1243 | |
| 1242 | 1244 | /* |
| @@ -5060,7 +5060,8 @@ static int gaudi_validate_cb(struct hl_device *hdev, · 5059 unmodified lines | ||
| 5060 | 5060 | * 1. A packet that will act as a completion packet |
| 5061 | 5061 | * 2. A packet that will generate MSI-X interrupt |
| 5062 | 5062 | */ |
| 5063 | − parser->patched_cb_size += sizeof(struct packet_msg_prot) * 2; | |
| 5063 | + if (parser->completion) | |
| 5064 | + parser->patched_cb_size += sizeof(struct packet_msg_prot) * 2; | |
| 5064 | 5065 | |
| 5065 | 5066 | return rc; |
| 5066 | 5067 | } |
| @@ -5287,8 +5288,11 @@ static int gaudi_parse_cb_mmu(struct hl_device *hdev, · 220 unmodified lines | ||
| 5287 | 5288 | * 1. A packet that will act as a completion packet |
| 5288 | 5289 | * 2. A packet that will generate MSI interrupt |
| 5289 | 5290 | */ |
| 5290 | − parser->patched_cb_size = parser->user_cb_size + | |
| 5291 | − sizeof(struct packet_msg_prot) * 2; | |
| 5291 | + if (parser->completion) | |
| 5292 | + parser->patched_cb_size = parser->user_cb_size + | |
| 5293 | + sizeof(struct packet_msg_prot) * 2; | |
| 5294 | + else | |
| 5295 | + parser->patched_cb_size = parser->user_cb_size; | |
| 5292 | 5296 | |
| 5293 | 5297 | rc = hl_cb_create(hdev, &hdev->kernel_cb_mgr, hdev->kernel_ctx, |
| 5294 | 5298 | parser->patched_cb_size, false, false, |