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 57E79A0C47; Tue, 12 Oct 2021 17:25:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D72834113A; Tue, 12 Oct 2021 17:25:21 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 76DBE410EF for ; Tue, 12 Oct 2021 17:25:20 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="290674684" X-IronPort-AV: E=Sophos;i="5.85,368,1624345200"; d="scan'208";a="290674684" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 08:25:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,368,1624345200"; d="scan'208";a="570478395" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga002.fm.intel.com with ESMTP; 12 Oct 2021 08:25:18 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 08:25:18 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 12 Oct 2021 08:25:18 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 12 Oct 2021 08:25:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gT3NgjceqzX91Gz22PwB0dr7JERQIzrC8OBaZEyqC+3hBKu6BxhqpIYTbGOo5Dcp4Mw4EKpp02q6gefT3M8bTSfg0bBPQBn4qaNByOYhaFDeNod+Z/l24ooLr7BJ3sAKFhclBWn8k5n4nX467cQnLqE0wfpmj5/fySo6EJNdRGtNxyyvisQKY7x5sLYuuNyzefdQVdtWhCw+IjvufiR9pHEbh5MRLkResAl+yI6b3YEoQY5lCMemN7ULWvlsc6Rb22t4DZL94cv41af1+SFsdQOSUEOEIidwKp68eab59QNlGWA6tQ3jepSowfhazmYnwTyLvcNZ/otJ2QpQ1Brcpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FZVs2mBKCTssQmXG0w7uD8vwr34z0gUWlcZ06q3Qc7Y=; b=bjmVMP724z3YAZzTwQdeNeCOBsJ1vaQRqFisI3ZebEIfmCiSWXoFoWY8HJdq1KVRnxBGNtIH44Pek/CFzLoU1V8yOEirFqtViPiUUOIPnHHu/GJP2cV/yeFf2z0kHrkMX/sH1gmQ7Z0fierd6Y5YhkBaszdmGI+F4iJBz3cfgkNqayZ3BM/fLw3UePwE7LI2rOssjcfL+nVAEgi/u6lsmF13H5igpaWyk869+UP2RlH7PUdxPb4fmReu5cwxyrOtA789/dyJvbqyo7Y31g1htn0mBs+ksw0fivsSxZanG3kQlY0fKCVQJrZWcboz8sy5reWvxwi2t72YDtdl3Ehqlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FZVs2mBKCTssQmXG0w7uD8vwr34z0gUWlcZ06q3Qc7Y=; b=LxNhEIHZBeE12QkN+R+a2WyUqBqdt1QlU1rzQNacdBoXp0w8RZf7tUwK369TwugmWnH493MPy5G0FNwLAJTp5yJi4VtQJE2Y3vjah2SQONFOs3OAmGSZk/Q+6A1QO2VC/G48X4GmECXI2gDYN9AwIIRHVXacwk9kNtWGcjOhvVY= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM5PR11MB1529.namprd11.prod.outlook.com (2603:10b6:4:b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Tue, 12 Oct 2021 15:25:15 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4587.026; Tue, 12 Oct 2021 15:25:15 +0000 From: "Ananyev, Konstantin" To: "Nicolau, Radu" , "Iremonger, Bernard" , "Medvedkin, Vladimir" , Ray Kinsella CC: "dev@dpdk.org" , "Richardson, Bruce" , "Zhang, Roy Fan" , "hemant.agrawal@nxp.com" , "gakhil@marvell.com" , "anoobj@marvell.com" , "Doherty, Declan" , "Sinha, Abhijit" , "Buckley, Daniel M" , "marchana@marvell.com" , "ktejasree@marvell.com" , "matan@nvidia.com" Thread-Topic: [PATCH v8 07/10] ipsec: add support for SA telemetry Thread-Index: AQHXvpT8GkppjS5bo06U/pGaJgNdP6vPeFzw Date: Tue, 12 Oct 2021 15:25:14 +0000 Message-ID: References: <20210713133542.3550525-1-radu.nicolau@intel.com> <20211011112945.2876-1-radu.nicolau@intel.com> <20211011112945.2876-8-radu.nicolau@intel.com> In-Reply-To: <20211011112945.2876-8-radu.nicolau@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 850aa6d1-ed51-426a-597d-08d98d947d89 x-ms-traffictypediagnostic: DM5PR11MB1529: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wnzO0ViJ3ixkKH0Mhrqzl3RJcJV6vMOwq1aVW/jcg4FaCrbxJ1EC4K8/Wb7LG60qZmEr4yl7hgbQ5B0BoBi8Jca8aZGp1CMlHPB8Kp0M1FzAIb6774qMXFq41S8J43jcVHERZfebUgMJ/8xvrckUevCs+rklI6CeNXFqpf2Pqhq89tg8kPXGiwJtwthaI6iZpWzswT5KIJMmSMIuCLIIDZ3SFLtHPPtrtyf43uyWEuZj7cTdlFptQQa+ZJI3LUOXzWlR3R+Xsb302JryOzKsOkJg/rPkIO+33FFWYtKmen6buEJTdAxqw66i9QFJF0v0PU99715EGQ9xusDQBtWWvI2TvrGCHVQ+3vQneabn9qO9+GHMsQnIcLuzaI8fuuZZW+KEfmO0ERpKWm8hTVXoGGTKxirE9LhJv7/x7whVIjlJxATXhN4uhoiUg29dm4HOTkZ/j8yWMrzSXRk7lvyaRMOA7kY74VauIrcQtZUj0LNSNL7yqjYNgX09auM8uubNff7moyy74ZmRYC9MVhU3zdfzUEogDa1JwlhczWn89WQ1vkyaZlDLAWJ9dlIzWaOkJ2hueuOYsgzMBKamY+Faamla8w4DSRzbL9jOL7gUrFmY1WOEDd3ZMtUZeqGXVdIzniXRzXzgUogkZcfcjox/R4b0vcByZxuBxftQdyMiPrkv+kb9pL+UBUiwjuKlh+4ukmknhcQN3F9dv/FGmEafag== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(83380400001)(76116006)(6506007)(38100700002)(8936002)(7696005)(186003)(26005)(55236004)(122000001)(52536014)(5660300002)(38070700005)(8676002)(66476007)(66556008)(2906002)(66446008)(64756008)(33656002)(55016002)(9686003)(86362001)(110136005)(508600001)(71200400001)(316002)(54906003)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Ie2FVIcAH5KdetH2ogzfNd7XQE87vEqVul0UdPjSmsvIbox1XLK/lkiqDmII?= =?us-ascii?Q?EqmzPnMlukB27mB78EiFbHlg8TDloT45t7V95CinRoM6NDYVUCIYCV0RRNl+?= =?us-ascii?Q?KAaFEbed5MscrU1c0JkFYRryamNFHmb4k73f71XEfUYHcUIoD6EJYeJeR4OQ?= =?us-ascii?Q?p5UWGklvXwDADLgWMbK9qRGmW1HYvveCh2xtp67Rv+DvleNfW4ewXphjTTfS?= =?us-ascii?Q?8/SSHtBi5xVmD6pItJS9+cnhOmyexosOVQchMqOqOTldU1F9lSw4UpA4CJ0P?= =?us-ascii?Q?+kDEqFxTDBXl2E/Bb6RnmjqzPWk/Kg+VLeE+q43oeh9yH5J33qffd8ZF0MfZ?= =?us-ascii?Q?zP1IOlQXFIxNamLyjvp3Jb2U9QuBX+8stVKGXH5FNIWqd5ykifttoPC1yQyM?= =?us-ascii?Q?u4NjZrIlsjJHhXJ/uNkxZT9FRoEZEOccMeySycviwfvYj0oKoa+tgRgCk5jn?= =?us-ascii?Q?vvOAEKIJ4ZxkqHUeR9/2W8sr3bRAcaVn4y+W6Q92qPx3amjM8Rl95LGfzv0/?= =?us-ascii?Q?frzSScmBlLC7s/Jg5rS4cqU/g1c80ImugWaarXJAlLlTfnRwIRdXx6TSZN2g?= =?us-ascii?Q?AfQWowC85D4oLkhNgRrk7okpohcMkJbe9d+t/BzJzpwbPQznpiLnO6slP4VB?= =?us-ascii?Q?E/bca5wRzHT1zNehyz6Y4u2Nt/1wxW506fKJiT8m73IiSku73hLATdnF2J0P?= =?us-ascii?Q?WdgLirhHBsD/W3akpjLpZSxITBjE82IHl4Odzyih1SnmcfOKtq9Ml5MJRp5/?= =?us-ascii?Q?ITJpFJyaLjILmlqqKRNT2wXplxI5ep2+yNjYOlpiKAKOQl2BdCYheo3Bqi+/?= =?us-ascii?Q?60NpTdLXltPobfiPY5eUPqrSrDFHPgwBz//HE0lvBkTrsjMj3ENSWSueIzI+?= =?us-ascii?Q?yJceOfu54ko2SHNAh2aVSmGsA9Q60Vzm8jKCCKMa+EigT711lEQLjBj6CNmq?= =?us-ascii?Q?IaqPJDyZ/ImyINCrCUTNbrFIggZViUfmQOLHdXAei6yZtxD68qb9Cl8eUo59?= =?us-ascii?Q?OUZSYGahDGkOnqDVUPs0oI0g/SHP17ArfziLc2P0SbTNtOAXMmwqfO5tZR2w?= =?us-ascii?Q?lpUDlaZ+OefthtdxEjCNe6Qzm000DpWq0bjJlq2JbsIR2X7uS/VwQfQmOGMs?= =?us-ascii?Q?9AsnMZ/lEggZoEQkTgkSP84BTnwEaGPYQo2YUApVoFHZlDZBxPDxsLbSMZes?= =?us-ascii?Q?dID5vAxLwAl6dH/DQMDtEaoFhvrRujXK2c9ytCiMivnlZzbISNiaK0X4o8q9?= =?us-ascii?Q?HG+0xudnKAkIBAqO7SqAOpggd0DHMGbyhPC/p3myhseB3lhIA/6dHQfn8RaP?= =?us-ascii?Q?DjLxA+c2aEqIRBfUjMzsYS20?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 850aa6d1-ed51-426a-597d-08d98d947d89 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2021 15:25:14.8966 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: b4X4QKEUGj77sQGs7zOvdkm6sdC9qGxjAW90EtzILj/z1ZWaBUInDMxNA9S2u15aTbgSIeJmHcnyn+4fEEaor6Z0MMS1XvlRxsOEp0yzZ+8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1529 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v8 07/10] ipsec: add support for SA telemetry 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 Sender: "dev" >=20 > Add telemetry support for ipsec SAs >=20 > Signed-off-by: Declan Doherty > Signed-off-by: Radu Nicolau > Signed-off-by: Abhijit Sinha > Signed-off-by: Daniel Martin Buckley > Acked-by: Fan Zhang > --- > /* check if packet will exceed MSS and segmentation is required */ > diff --git a/lib/ipsec/ipsec_telemetry.c b/lib/ipsec/ipsec_telemetry.c > new file mode 100644 > index 0000000000..f963d062a8 > --- /dev/null > +++ b/lib/ipsec/ipsec_telemetry.c > @@ -0,0 +1,237 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2021 Intel Corporation > + */ > + > +#include > +#include > +#include > +#include "sa.h" > + > + > +struct ipsec_telemetry_entry { > + LIST_ENTRY(ipsec_telemetry_entry) next; > + struct rte_ipsec_sa *sa; As a nit, might be const struct rte_ipsec_sa *sa? > +}; > +static LIST_HEAD(ipsec_telemetry_head, ipsec_telemetry_entry) > + ipsec_telemetry_list =3D LIST_HEAD_INITIALIZER(); > + > +static int > +handle_telemetry_cmd_ipsec_sa_list(const char *cmd __rte_unused, > + const char *params __rte_unused, > + struct rte_tel_data *data) > +{ > + struct ipsec_telemetry_entry *entry; > + rte_tel_data_start_array(data, RTE_TEL_U64_VAL); > + > + LIST_FOREACH(entry, &ipsec_telemetry_list, next) { > + struct rte_ipsec_sa *sa =3D entry->sa; > + rte_tel_data_add_array_u64(data, rte_be_to_cpu_32(sa->spi)); > + } > + > + return 0; > +} > + > +/** > + * Handle IPsec SA statistics telemetry request > + * > + * Return dict of SA's with dict of key/value counters > + * > + * { > + * "SA_SPI_XX": {"count": 0, "bytes": 0, "errors": 0}, > + * "SA_SPI_YY": {"count": 0, "bytes": 0, "errors": 0} > + * } > + * > + */ > +static int > +handle_telemetry_cmd_ipsec_sa_stats(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *data) > +{ > + struct ipsec_telemetry_entry *entry; > + struct rte_ipsec_sa *sa; > + uint32_t sa_spi =3D 0; > + > + if (params) > + sa_spi =3D rte_cpu_to_be_32((uint32_t)strtoul(params, NULL, 10)); As a nit - probably worth to check that strtoul didn't return any errors. Also, I don't know should be limit users to decimal input only. > + > + rte_tel_data_start_dict(data); > + > + LIST_FOREACH(entry, &ipsec_telemetry_list, next) { > + char sa_name[64]; > + sa =3D entry->sa; > + static const char *name_pkt_cnt =3D "count"; > + static const char *name_byte_cnt =3D "bytes"; > + static const char *name_error_cnt =3D "errors"; > + struct rte_tel_data *sa_data; > + > + /* If user provided SPI only get telemetry for that SA */ > + if (sa_spi && (sa_spi !=3D sa->spi)) > + continue; > + > + /* allocate telemetry data struct for SA telemetry */ > + sa_data =3D rte_tel_data_alloc(); > + if (!sa_data) > + return -ENOMEM; > + > + rte_tel_data_start_dict(sa_data); > + > + /* add telemetry key/values pairs */ > + rte_tel_data_add_dict_u64(sa_data, name_pkt_cnt, > + sa->statistics.count); > + > + rte_tel_data_add_dict_u64(sa_data, name_byte_cnt, > + sa->statistics.bytes - > + (sa->statistics.count * sa->hdr_len)); > + > + rte_tel_data_add_dict_u64(sa_data, name_error_cnt, > + sa->statistics.errors.count); > + > + /* generate telemetry label */ > + snprintf(sa_name, sizeof(sa_name), "SA_SPI_%i", > + rte_be_to_cpu_32(sa->spi)); > + > + /* add SA telemetry to dictionary container */ > + rte_tel_data_add_dict_container(data, sa_name, sa_data, 0); > + } > + > + return 0; > +} > + > +static int > +handle_telemetry_cmd_ipsec_sa_details(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *data) > +{ > + struct ipsec_telemetry_entry *entry; > + struct rte_ipsec_sa *sa; > + uint32_t sa_spi; > + > + if (params) > + sa_spi =3D rte_cpu_to_be_32((uint32_t)strtoul(params, NULL, 10)); > + else > + return -EINVAL; > + > + rte_tel_data_start_dict(data); > + > + LIST_FOREACH(entry, &ipsec_telemetry_list, next) { > + uint64_t mode; > + sa =3D entry->sa; > + if (sa_spi !=3D sa->spi) > + continue; > + > + /* add SA configuration key/values pairs */ > + rte_tel_data_add_dict_string(data, "Type", > + (sa->type & RTE_IPSEC_SATP_PROTO_MASK) =3D=3D > + RTE_IPSEC_SATP_PROTO_AH ? "AH" : "ESP"); > + > + rte_tel_data_add_dict_string(data, "Direction", > + (sa->type & RTE_IPSEC_SATP_DIR_MASK) =3D=3D > + RTE_IPSEC_SATP_DIR_IB ? "Inbound" : "Outbound"); > + > + mode =3D sa->type & RTE_IPSEC_SATP_MODE_MASK; > + > + if (mode =3D=3D RTE_IPSEC_SATP_MODE_TRANS) { > + rte_tel_data_add_dict_string(data, "Mode", "Transport"); > + } else { > + rte_tel_data_add_dict_string(data, "Mode", "Tunnel"); > + > + if ((sa->type & RTE_IPSEC_SATP_NATT_MASK) =3D=3D > + RTE_IPSEC_SATP_NATT_ENABLE) { > + if (sa->type & RTE_IPSEC_SATP_MODE_TUNLV4) { > + rte_tel_data_add_dict_string(data, > + "Tunnel-Type", > + "IPv4-UDP"); > + } else if (sa->type & > + RTE_IPSEC_SATP_MODE_TUNLV6) { > + rte_tel_data_add_dict_string(data, > + "Tunnel-Type", > + "IPv4-UDP"); > + } > + } else { > + if (sa->type & RTE_IPSEC_SATP_MODE_TUNLV4) { > + rte_tel_data_add_dict_string(data, > + "Tunnel-Type", > + "IPv4-UDP"); > + } else if (sa->type & > + RTE_IPSEC_SATP_MODE_TUNLV6) { > + rte_tel_data_add_dict_string(data, > + "Tunnel-Type", > + "IPv4-UDP"); > + } > + } > + } > + > + rte_tel_data_add_dict_string(data, > + "extended-sequence-number", > + (sa->type & RTE_IPSEC_SATP_ESN_MASK) =3D=3D > + RTE_IPSEC_SATP_ESN_ENABLE ? > + "enabled" : "disabled"); > + > + if ((sa->type & RTE_IPSEC_SATP_DIR_MASK) =3D=3D > + RTE_IPSEC_SATP_DIR_IB) > + > + if (sa->sqn.inb.rsn[sa->sqn.inb.rdidx]) > + rte_tel_data_add_dict_u64(data, > + "sequence-number", > + sa->sqn.inb.rsn[sa->sqn.inb.rdidx]->sqn); > + else > + rte_tel_data_add_dict_u64(data, > + "sequence-number", 0); > + else > + rte_tel_data_add_dict_u64(data, "sequence-number", > + sa->sqn.outb); > + > + rte_tel_data_add_dict_string(data, > + "explicit-congestion-notification", > + (sa->type & RTE_IPSEC_SATP_ECN_MASK) =3D=3D > + RTE_IPSEC_SATP_ECN_ENABLE ? > + "enabled" : "disabled"); > + > + rte_tel_data_add_dict_string(data, > + "copy-DSCP", > + (sa->type & RTE_IPSEC_SATP_DSCP_MASK) =3D=3D > + RTE_IPSEC_SATP_DSCP_ENABLE ? > + "enabled" : "disabled"); > + } > + > + return 0; > +} > + > + > +int > +rte_ipsec_telemetry_sa_add(struct rte_ipsec_sa *sa) Just as a nit, here and in _del: it probably could be const struct rte_ipsec_sa *sa > +{ > + struct ipsec_telemetry_entry *entry =3D rte_zmalloc(NULL, > + sizeof(struct ipsec_telemetry_entry), 0); Need to check malloc() return value. Can't assume it is always successful. With that fixed: Acked-by: Konstantin Ananyev > + entry->sa =3D sa; > + LIST_INSERT_HEAD(&ipsec_telemetry_list, entry, next); > + return 0; > +} > + > +void > +rte_ipsec_telemetry_sa_del(struct rte_ipsec_sa *sa) > +{ > + struct ipsec_telemetry_entry *entry; > + LIST_FOREACH(entry, &ipsec_telemetry_list, next) { > + if (sa =3D=3D entry->sa) { > + LIST_REMOVE(entry, next); > + rte_free(entry); > + return; > + } > + } > +} > + > +