Content-Type: multipart/mixed; boundary="===============7187642342953514179==" MIME-Version: 1.0 From: ramesh.thomas at intel.com Subject: [Accel-config] [PATCH 1/2] accel-config: Allow -1 wq->group-id Date: Thu, 11 Mar 2021 20:47:15 -0500 Message-ID: <20210312014716.312615-2-ramesh.thomas@intel.com> In-Reply-To: 20210312014716.312615-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============7187642342953514179== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas -1 is a special value passed in config-wq to dissasociate the wq from groups Signed-off-by: Ramesh Thomas --- accfg/config_attr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/accfg/config_attr.c b/accfg/config_attr.c index 52b9fa8..1f884fd 100644 --- a/accfg/config_attr.c +++ b/accfg/config_attr.c @@ -133,7 +133,8 @@ static int accel_config_parse_group_attribs(struct accf= g_group *group, static int accel_config_parse_wq_attribs(struct accfg_device *device, struct accfg_wq *wq, struct wq_parameters *wq_params) { - unsigned int max_groups, max_wq_size, max_batch_size; + int max_groups; + unsigned int max_wq_size, max_batch_size; uint64_t max_transfer_size; int rc =3D 0; = @@ -158,10 +159,11 @@ static int accel_config_parse_wq_attribs(struct accfg= _device *device, return -EINVAL; } = - if (((unsigned int)wq_params->group_id >=3D max_groups) - && (wq_params->group_id !=3D INT_MAX)) { + if ((wq_params->group_id >=3D max_groups) && + (wq_params->group_id !=3D INT_MAX)) { fprintf(stderr, - "valid group_id should be 0 to %d\n", max_groups-1); + "valid group id should be 0 to %d or -1 to dissociate the wq from group= s\n", + max_groups-1); return -EINVAL; } = -- = 2.26.2 --===============7187642342953514179==--