Content-Type: multipart/mixed; boundary="===============4639214798452525529==" MIME-Version: 1.0 From: Ramesh Thomas Subject: [Accel-config] [PATCH 3/6] accel-config: Add driver_name to json configuration data Date: Mon, 31 Jan 2022 18:53:16 -0800 Message-ID: <20220201025319.16393-4-ramesh.thomas@intel.com> In-Reply-To: 20220201025319.16393-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============4639214798452525529== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Update json load, save and list configuration data with driver_name attribute. Signed-off-by: Ramesh Thomas --- accfg/config.c | 1 + util/json.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/accfg/config.c b/accfg/config.c index 1038b80..3e7d48b 100644 --- a/accfg/config.c +++ b/accfg/config.c @@ -115,6 +115,7 @@ static const struct wq_set_table wq_table[] =3D { { "block_on_fault", accfg_wq_set_block_on_fault, NULL, NULL, NULL }, { "type", NULL, NULL, accfg_wq_set_str_type, NULL }, { "name", NULL, NULL, accfg_wq_set_str_name, NULL }, + { "driver_name", NULL, NULL, accfg_wq_set_str_driver_name, NULL }, { "mode", NULL, NULL, accfg_wq_set_str_mode, NULL }, { "max_batch_size", accfg_wq_set_max_batch_size, NULL, NULL, NULL }, { "max_transfer_size", NULL, accfg_wq_set_max_transfer_size, NULL, NULL }, diff --git a/util/json.c b/util/json.c index 1a768bc..e99ca31 100644 --- a/util/json.c +++ b/util/json.c @@ -453,6 +453,12 @@ struct json_object *util_wq_to_json(struct accfg_wq *w= q, if (jobj) json_object_object_add(jaccfg, "name", jobj); = + if (accfg_wq_get_driver_name(wq)) { + jobj =3D json_object_new_string(accfg_wq_get_driver_name(wq)); + if (jobj) + json_object_object_add(jaccfg, "driver_name", jobj); + } + jobj =3D json_object_new_int(accfg_wq_get_threshold(wq)); if (jobj) json_object_object_add(jaccfg, "threshold", jobj); -- = 2.31.1 --===============4639214798452525529==--