mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: Update unit test for posix queue unit
Update unit test for posix queue unit to cover a missing branch. Also add posix queue SWUTS file path in "SWUTS.sources". Jira NVGPU-4478 Change-Id: Ib32969bc358d76686a03708f120da7da113c9533 Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2282988 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
f46c3064ed
commit
61b14b226f
@@ -141,7 +141,7 @@ int test_nvgpu_queue_in(struct unit_module *m, struct gk20a *g, void *args)
|
||||
}
|
||||
|
||||
/*
|
||||
* Reset "in" and "out" indexes and enueue message of length BUF_LEN
|
||||
* Reset "in" and "out" indexes and enqueue message of length BUF_LEN
|
||||
* with the lock.
|
||||
*/
|
||||
q.in = 0;
|
||||
@@ -153,7 +153,7 @@ int test_nvgpu_queue_in(struct unit_module *m, struct gk20a *g, void *args)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Enueue message of length BUF_LEN again and expect memory full */
|
||||
/* Enqueue message of length BUF_LEN again and expect memory full */
|
||||
ret = nvgpu_queue_in_locked(&q, buf, BUF_LEN, &lock);
|
||||
if (ret != -ENOMEM) {
|
||||
err = UNIT_FAIL;
|
||||
@@ -161,6 +161,16 @@ int test_nvgpu_queue_in(struct unit_module *m, struct gk20a *g, void *args)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Enqueue message of length BUF_LEN again (without lock) and expect
|
||||
* memory full.
|
||||
*/
|
||||
ret = nvgpu_queue_in(&q, buf, BUF_LEN);
|
||||
if (ret != -ENOMEM) {
|
||||
err = UNIT_FAIL;
|
||||
unit_err(m, "%d. queue_in failed err=%d\n", __LINE__, ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
fail:
|
||||
if (q.data != NULL)
|
||||
free(q.data);
|
||||
@@ -203,7 +213,7 @@ int test_nvgpu_queue_out(struct unit_module *m, struct gk20a *g, void *args)
|
||||
}
|
||||
|
||||
/*
|
||||
* Advance "in" index by "BUF_LEN" and deueue message of length BUF_LEN.
|
||||
* Advance "in" index by "BUF_LEN" and dequeue message of length BUF_LEN
|
||||
*/
|
||||
q.in = BUF_LEN;
|
||||
q.out = 0;
|
||||
@@ -215,7 +225,7 @@ int test_nvgpu_queue_out(struct unit_module *m, struct gk20a *g, void *args)
|
||||
}
|
||||
|
||||
/*
|
||||
* Advance "in" index by "BUF_LEN" and deueue message of length BUF_LEN
|
||||
* Advance "in" index by "BUF_LEN" and dequeue message of length BUF_LEN
|
||||
* with the lock.
|
||||
*/
|
||||
q.in = BUF_LEN;
|
||||
|
||||
Reference in New Issue
Block a user