From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF51F42B2C; Wed, 17 May 2023 17:10:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8826F406B7; Wed, 17 May 2023 17:10:33 +0200 (CEST) Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.52]) by mails.dpdk.org (Postfix) with ESMTP id 084CF40041; Wed, 17 May 2023 17:10:33 +0200 (CEST) Received: by mail-ua1-f52.google.com with SMTP id a1e0cc1a2514c-783e4666738so329815241.2; Wed, 17 May 2023 08:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684336232; x=1686928232; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=a7jbUCVForticXtVecueh6NdfXckTGJ4CaYu85y2X+8=; b=XKEvz0r79JYfw6CrBwVNSZY8PDS/Tahc1NifTH/+NjV2gnKCtSEP3A7AtwF+CdwpTz 8cZnA+WfDpRSq2VPbC7w2CxFZz8N9sgnuDASWJJuaTCOG1Xr3mSzmd7uTt+0dxhN2zjQ D5AUx554bitACsu+jh99KiL7SJ2kx7a3SPSh+1sm3QSB1V5n5/Eox2UvbJ9Am/KfoEJR kctcB0ymxHa42P06YGcIZChahn3XOeVAoLvfDPBXC+n5LA3bto6deqqzim+hdu2iyZHR zT3TC9TMpXscxUIQbonsPG6bAO793dnV8DhKkEK/+jCUGnL7BhKl1rqRnkHyawQggJ2g W6uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684336232; x=1686928232; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a7jbUCVForticXtVecueh6NdfXckTGJ4CaYu85y2X+8=; b=OgkGarsGWhHHS+ex/PAv3S4Yy6yRAPd4QQTVkvMq3ZAKNsc5sR3mbn3pmUfjL5aNs0 xc8OqsrUlD7wZMibS9DTenv2dUXwxXf61IexiW+c7EiMy2RS7JyOC6fspYECeQCqdkjY JHRUm0oxiYQ4wvXuFQri+efnWRnFB26jROHfXYp9btubm9oCdwSfhAMkYFdCdSy54NiP h7P4OlkSdWzjtxo45p91Nh4pr7xzKQTvuLe9MLPXpCsOaC0zHGakYozFYg1U+mDWQoRP QfcHLWrKvUXxTv92B5ZADcx55eF/pXfrAYAvICpWQ+SYlQhWlZKtKAKvYrpVW/VIGeoT 675g== X-Gm-Message-State: AC+VfDzg/aQa9pKnaGs5XgbiMEtvplC1OSZQLlx4R1/A9sP2cC6tmwOw UAY4L9j5dmaomYFvpM4WmUlrpR/PVwzIY+XfFOs= X-Google-Smtp-Source: ACHHUZ4aLwIhZ521XODEgM9CLMJqk2O/MHr2HoL4vKBKaXvqpbGDvx7kb843LTyHK3zq1SnYqu1b47EclNhsVQTKfdo= X-Received: by 2002:a67:f5cf:0:b0:436:2b75:995e with SMTP id t15-20020a67f5cf000000b004362b75995emr10098519vso.12.1684336232004; Wed, 17 May 2023 08:10:32 -0700 (PDT) MIME-Version: 1.0 References: <20230502055711.1133134-1-s.v.naga.harish.k@intel.com> <20230517103551.3334611-1-s.v.naga.harish.k@intel.com> In-Reply-To: <20230517103551.3334611-1-s.v.naga.harish.k@intel.com> From: Jerin Jacob Date: Wed, 17 May 2023 20:40:05 +0530 Message-ID: Subject: Re: [PATCH v3] eventdev/eth_tx: fix runtime parameter test To: Naga Harish K S V Cc: jerinj@marvell.com, dev@dpdk.org, jay.jayatheerthan@intel.com, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, May 17, 2023 at 4:06=E2=80=AFPM Naga Harish K S V wrote: > > TX adapter capability check logic is simplified. > The UT has been updated to skip the test, if the API > to set runtime parameters is not supported. > > Fixes: 1d176c7add08 ("eventdev/eth_tx: support runtime set/get parameters= ") > Cc: stable@dpdk.org > > Signed-off-by: Naga Harish K S V > --- > v3: > * address review comments in commit message Applied to dpdk-next-net-eventdev/for-main. Thanks > v2: > * update tx_adapter unit test > --- > app/test/test_event_eth_tx_adapter.c | 11 ++++++--- > lib/eventdev/rte_event_eth_tx_adapter.c | 33 +++++-------------------- > 2 files changed, 14 insertions(+), 30 deletions(-) > > diff --git a/app/test/test_event_eth_tx_adapter.c b/app/test/test_event_e= th_tx_adapter.c > index 4e1d821bf9..616c972ac0 100644 > --- a/app/test/test_event_eth_tx_adapter.c > +++ b/app/test/test_event_eth_tx_adapter.c > @@ -800,13 +800,17 @@ tx_adapter_queue_start_stop(void) > static int > tx_adapter_set_get_params(void) > { > - int err; > + int err, rc; > struct rte_event_eth_tx_adapter_runtime_params in_params; > struct rte_event_eth_tx_adapter_runtime_params out_params; > > err =3D rte_event_eth_tx_adapter_queue_add(TEST_INST_ID, > TEST_ETHDEV_ID, > 0); > + if (err =3D=3D -ENOTSUP) { > + rc =3D TEST_SKIPPED; > + goto skip; > + } > TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > > err =3D rte_event_eth_tx_adapter_runtime_params_init(&in_params); > @@ -916,13 +920,14 @@ tx_adapter_set_get_params(void) > TEST_ASSERT(in_params.flush_threshold =3D=3D out_params.flush_thr= eshold, > "Expected %u got %u", > in_params.flush_threshold, out_params.flush_threshold= ); > - > + rc =3D TEST_SUCCESS; > +skip: > err =3D rte_event_eth_tx_adapter_queue_del(TEST_INST_ID, > TEST_ETHDEV_ID, > 0); > TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > > - return TEST_SUCCESS; > + return rc; > } > > static int > diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_e= vent_eth_tx_adapter.c > index 131e11e01d..360d5caf6a 100644 > --- a/lib/eventdev/rte_event_eth_tx_adapter.c > +++ b/lib/eventdev/rte_event_eth_tx_adapter.c > @@ -1310,36 +1310,15 @@ rte_event_eth_tx_adapter_runtime_params_init( > } > > static int > -txa_caps_check(uint8_t id, struct txa_service_data *txa) > +txa_caps_check(struct txa_service_data *txa) > { > - uint32_t caps =3D 0; > - struct rte_eth_dev *eth_dev =3D NULL; > - struct txa_service_ethdev *tdi; > - int i; > - > if (!txa->dev_count) > return -EINVAL; > > - /* The eth_dev used is always the same type. > - * Hence first valid eth_dev is taken. > - */ > - for (i =3D 0; i < txa->dev_count; i++) { > - tdi =3D &txa->txa_ethdev[i]; > - if (tdi->nb_queues) { > - eth_dev =3D tdi->dev; > - break; > - } > - } > - if (eth_dev =3D=3D NULL) > - return -EINVAL; > - > - if (txa_dev_caps_get(id)) > - txa_dev_caps_get(id)(txa_evdev(id), eth_dev, &caps); > - > - if (caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT) > - return -ENOTSUP; > + if (txa->service_id !=3D TXA_INVALID_SERVICE_ID) > + return 0; > > - return 0; > + return -ENOTSUP; > } > > int > @@ -1361,7 +1340,7 @@ rte_event_eth_tx_adapter_runtime_params_set(uint8_t= id, > if (txa =3D=3D NULL) > return -EINVAL; > > - ret =3D txa_caps_check(id, txa); > + ret =3D txa_caps_check(txa); > if (ret) > return ret; > > @@ -1392,7 +1371,7 @@ rte_event_eth_tx_adapter_runtime_params_get(uint8_t= id, > if (txa =3D=3D NULL) > return -EINVAL; > > - ret =3D txa_caps_check(id, txa); > + ret =3D txa_caps_check(txa); > if (ret) > return ret; > > -- > 2.23.0 >