mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: Address Vectorcast gap for posix queue
Update unit test for posix queue unit to cover Vectorcast gap. Jira NVGPU-4478 Change-Id: I0d79861f173d511d25cf45051c399e3193eabdbe Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2294146 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
566b1df08c
commit
c2fbc99967
@@ -661,6 +661,7 @@ nvgpu_queue_in
|
|||||||
nvgpu_queue_in_locked
|
nvgpu_queue_in_locked
|
||||||
nvgpu_queue_out
|
nvgpu_queue_out
|
||||||
nvgpu_queue_out_locked
|
nvgpu_queue_out_locked
|
||||||
|
nvgpu_queue_out_get_fault_injection
|
||||||
nvgpu_preempt_channel
|
nvgpu_preempt_channel
|
||||||
nvgpu_preempt_get_timeout
|
nvgpu_preempt_get_timeout
|
||||||
nvgpu_preempt_poll_tsg_on_pbdma
|
nvgpu_preempt_poll_tsg_on_pbdma
|
||||||
|
|||||||
@@ -185,6 +185,8 @@ int test_nvgpu_queue_out(struct unit_module *m, struct gk20a *g, void *args)
|
|||||||
struct nvgpu_queue q = {0};
|
struct nvgpu_queue q = {0};
|
||||||
struct nvgpu_mutex lock;
|
struct nvgpu_mutex lock;
|
||||||
char buf[BUF_LEN];
|
char buf[BUF_LEN];
|
||||||
|
struct nvgpu_posix_fault_inj *queue_out_fi =
|
||||||
|
nvgpu_queue_out_get_fault_injection();
|
||||||
|
|
||||||
nvgpu_mutex_init(&lock);
|
nvgpu_mutex_init(&lock);
|
||||||
|
|
||||||
@@ -250,6 +252,20 @@ int test_nvgpu_queue_out(struct unit_module *m, struct gk20a *g, void *args)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Fault injection so that immediate call to nvgpu_queue_out_locked()
|
||||||
|
* API would return error.
|
||||||
|
*/
|
||||||
|
nvgpu_posix_enable_fault_injection(queue_out_fi, true, 0);
|
||||||
|
ret = nvgpu_queue_out_locked(&q, buf, BUF_LEN, &lock);
|
||||||
|
if (ret != -1) {
|
||||||
|
err = UNIT_FAIL;
|
||||||
|
nvgpu_posix_enable_fault_injection(queue_out_fi, false, 0);
|
||||||
|
unit_err(m, "%d. queue_out failed err=%d\n", __LINE__, ret);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
nvgpu_posix_enable_fault_injection(queue_out_fi, false, 0);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (q.data != NULL)
|
if (q.data != NULL)
|
||||||
free(q.data);
|
free(q.data);
|
||||||
|
|||||||
@@ -137,6 +137,10 @@ int test_nvgpu_queue_in(struct unit_module *m, struct gk20a *g, void *args);
|
|||||||
* - Update "in" and "out" indexes and dequeue message of length BUF_LEN such
|
* - Update "in" and "out" indexes and dequeue message of length BUF_LEN such
|
||||||
* that we wrap around the Queue while dequeuing the message using
|
* that we wrap around the Queue while dequeuing the message using
|
||||||
* nvgpu_queue_out() API. Check that the API returns "BUF_LEN".
|
* nvgpu_queue_out() API. Check that the API returns "BUF_LEN".
|
||||||
|
* - Do fault injection so that immediate call to nvgpu_queue_out_locked() API
|
||||||
|
* would return error.
|
||||||
|
* - Invoke nvgpu_queue_out_locked() API and check that API returns -1 error.
|
||||||
|
* - Remove the injected fault.
|
||||||
* - Uninitialize the allocated resources.
|
* - Uninitialize the allocated resources.
|
||||||
*
|
*
|
||||||
* Output: Returns PASS if the steps above were executed successfully. FAIL
|
* Output: Returns PASS if the steps above were executed successfully. FAIL
|
||||||
|
|||||||
Reference in New Issue
Block a user