Content-Type: multipart/mixed; boundary="===============1863007135756491713==" MIME-Version: 1.0 From: ramesh.thomas at intel.com Subject: [Accel-config] [PATCH 5/5] accel-config/test: Remove load/unload of kernel modules in test Date: Mon, 05 Apr 2021 23:34:11 -0400 Message-ID: <20210406033411.464362-6-ramesh.thomas@intel.com> In-Reply-To: 20210406033411.464362-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============1863007135756491713== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas Loading and unloading of kernel modules in test is unreliable due to dependencies across multiple modules. It is also not necessary because the test should be run only after necessary idxd kernel modules are loaded. Signed-off-by: Ramesh Thomas --- test/libaccfg.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/test/libaccfg.c b/test/libaccfg.c index 951985d..ce21fb3 100644 --- a/test/libaccfg.c +++ b/test/libaccfg.c @@ -1074,18 +1074,12 @@ static int idxd_kmod_init(struct kmod_ctx **ctx, st= ruct kmod_module **mod, return rc; } rc =3D kmod_module_get_initstate(*mdev_mod); - if (rc =3D=3D -ENOENT) - rc =3D kmod_module_probe_insert_module(*mdev_mod, 0, NULL, NULL, NULL, - NULL); if (rc < 0) { kmod_module_unref(*mdev_mod); *mdev_mod =3D NULL; mdev_disabled =3D true; } rc =3D kmod_module_get_initstate(*mod); - if (rc =3D=3D -ENOENT) - rc =3D kmod_module_probe_insert_module(*mod, 0, NULL, NULL, NULL, - NULL); if (rc < 0) { kmod_module_unref(*mod); kmod_unref(*ctx); @@ -1165,12 +1159,9 @@ int test_libaccfg(int loglevel, struct accfg_test *t= est, = test_cleanup(ctx); = - if (mdev_mod) { - kmod_module_remove_module(mdev_mod, 0); + if (mdev_mod) kmod_module_unref(mdev_mod); - } - kmod_module_remove_module(mod, 0); - kmod_module_probe_insert_module(mod, 0, NULL, NULL, NULL, NULL); + kmod_module_unref(mod); kmod_unref(kmod_ctx); = -- = 2.26.3 --===============1863007135756491713==--