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 C600F43745 for ; Tue, 19 Dec 2023 13:04:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B254542DF9; Tue, 19 Dec 2023 13:04:01 +0100 (CET) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 0C6E140283; Tue, 19 Dec 2023 13:03:58 +0100 (CET) Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Svb1g1m7qz6H6pf; Tue, 19 Dec 2023 20:03:19 +0800 (CST) Received: from frapeml500005.china.huawei.com (unknown [7.182.85.13]) by mail.maildlp.com (Postfix) with ESMTPS id A1256140F8D; Tue, 19 Dec 2023 20:03:37 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml500005.china.huawei.com (7.182.85.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 19 Dec 2023 13:03:34 +0100 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.035; Tue, 19 Dec 2023 13:03:34 +0100 From: Konstantin Ananyev To: Sivaprasad Tummala , "david.hunt@intel.com" , "anatoly.burakov@intel.com" , "jerinj@marvell.com" , "radu.nicolau@intel.com" , "gakhil@marvell.com" , "cristian.dumitrescu@intel.com" , "ferruh.yigit@amd.com" CC: "dev@dpdk.org" , "sergio.gonzalez.monroy@intel.com" , "stable@dpdk.org" Subject: RE: [PATCH v2 4/6] examples/ipsec-secgw: fix lcore ID restriction Thread-Topic: [PATCH v2 4/6] examples/ipsec-secgw: fix lcore ID restriction Thread-Index: AQHaMiuoe/Ih/qgHTEKLBFEWY4ThirCwgi+g Date: Tue, 19 Dec 2023 12:03:33 +0000 Message-ID: <68594dd4065b401f877c8a5adc66a726@huawei.com> References: <20231218074905.42749-1-sivaprasad.tummala@amd.com> <20231219032826.4814-1-sivaprasad.tummala@amd.com> <20231219032826.4814-5-sivaprasad.tummala@amd.com> In-Reply-To: <20231219032826.4814-5-sivaprasad.tummala@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.206.138.42] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > Currently the config option allows lcore IDs up to 255, > irrespective of RTE_MAX_LCORES and needs to be fixed. >=20 > The patch allows config options based on DPDK config. >=20 > Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application"= ) > Cc: sergio.gonzalez.monroy@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Sivaprasad Tummala > --- > examples/ipsec-secgw/event_helper.h | 2 +- > examples/ipsec-secgw/ipsec-secgw.c | 16 +++++++++------- > examples/ipsec-secgw/ipsec.c | 2 +- > 3 files changed, 11 insertions(+), 9 deletions(-) >=20 > diff --git a/examples/ipsec-secgw/event_helper.h b/examples/ipsec-secgw/e= vent_helper.h > index dfb81bfcf1..9923700f03 100644 > --- a/examples/ipsec-secgw/event_helper.h > +++ b/examples/ipsec-secgw/event_helper.h > @@ -102,7 +102,7 @@ struct eh_event_link_info { > /**< Event port ID */ > uint8_t eventq_id; > /**< Event queue to be linked to the port */ > - uint8_t lcore_id; > + uint16_t lcore_id; > /**< Lcore to be polling on this port */ > }; >=20 > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ip= sec-secgw.c > index bf98d2618b..6f550db05c 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -221,7 +221,7 @@ static const char *cfgfile; > struct lcore_params { > uint16_t port_id; > uint8_t queue_id; > - uint8_t lcore_id; > + uint16_t lcore_id; > } __rte_cache_aligned; >=20 > static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS]; > @@ -810,7 +810,7 @@ check_flow_params(uint16_t fdir_portid, uint8_t fdir_= qid) > static int32_t > check_poll_mode_params(struct eh_conf *eh_conf) > { > - uint8_t lcore; > + uint16_t lcore; > uint16_t portid; > uint16_t i; > int32_t socket_id; > @@ -829,13 +829,13 @@ check_poll_mode_params(struct eh_conf *eh_conf) > for (i =3D 0; i < nb_lcore_params; ++i) { > lcore =3D lcore_params[i].lcore_id; > if (!rte_lcore_is_enabled(lcore)) { > - printf("error: lcore %hhu is not enabled in " > + printf("error: lcore %hu is not enabled in " > "lcore mask\n", lcore); > return -1; > } > socket_id =3D rte_lcore_to_socket_id(lcore); > if (socket_id !=3D 0 && numa_on =3D=3D 0) { > - printf("warning: lcore %hhu is on socket %d " > + printf("warning: lcore %hu is on socket %d " > "with numa off\n", > lcore, socket_id); > } > @@ -870,7 +870,7 @@ static int32_t > init_lcore_rx_queues(void) > { > uint16_t i, nb_rx_queue; > - uint8_t lcore; > + uint16_t lcore; >=20 > for (i =3D 0; i < nb_lcore_params; ++i) { > lcore =3D lcore_params[i].lcore_id; > @@ -1051,6 +1051,8 @@ parse_config(const char *q_arg) > char *str_fld[_NUM_FLD]; > int32_t i; > uint32_t size; > + unsigned int max_fld[_NUM_FLD] =3D {RTE_MAX_ETHPORTS, > + 255, RTE_MAX_LCORE}; >=20 > nb_lcore_params =3D 0; >=20 > @@ -1071,7 +1073,7 @@ parse_config(const char *q_arg) > for (i =3D 0; i < _NUM_FLD; i++) { > errno =3D 0; > int_fld[i] =3D strtoul(str_fld[i], &end, 0); > - if (errno !=3D 0 || end =3D=3D str_fld[i] || int_fld[i] > 255) > + if (errno !=3D 0 || end =3D=3D str_fld[i] || int_fld[i] > max_fld[i]) > return -1; > } > if (nb_lcore_params >=3D MAX_LCORE_PARAMS) { > @@ -1084,7 +1086,7 @@ parse_config(const char *q_arg) > lcore_params_array[nb_lcore_params].queue_id =3D > (uint8_t)int_fld[FLD_QUEUE]; > lcore_params_array[nb_lcore_params].lcore_id =3D > - (uint8_t)int_fld[FLD_LCORE]; > + (uint16_t)int_fld[FLD_LCORE]; > ++nb_lcore_params; > } > lcore_params =3D lcore_params_array; > diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c > index f5cec4a928..5ebb71bb9a 100644 > --- a/examples/ipsec-secgw/ipsec.c > +++ b/examples/ipsec-secgw/ipsec.c > @@ -259,7 +259,7 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_= lcore[], > continue; >=20 > /* Looking for cryptodev, which can handle this SA */ > - key.lcore_id =3D (uint8_t)lcore_id; > + key.lcore_id =3D (uint16_t)lcore_id; > key.cipher_algo =3D (uint8_t)sa->cipher_algo; > key.auth_algo =3D (uint8_t)sa->auth_algo; > key.aead_algo =3D (uint8_t)sa->aead_algo; > -- Acked-by: Konstantin Ananyev =20 > 2.25.1