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 2E6CC46104; Sat, 25 Jan 2025 03:14:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F8704067A; Sat, 25 Jan 2025 03:14:04 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 997E540651 for ; Sat, 25 Jan 2025 03:13:30 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-216395e151bso36471385ad.0 for ; Fri, 24 Jan 2025 18:13:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737771210; x=1738376010; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+oQ2P8a47fCd0TJPqICbX62+VhXo899XJEdh7Y0/IPo=; b=yKN7aT0cRFmKrERaPrVNeruEngC2VyD1Xb2YUzChJA/hGzhm2bKVpwWZFxh+LC/qbu Vd0sIAnp34M0hbkbi6ad6//g9zHDSXWVLmjQ4vZhAZbZmcYUAcmzrRDx1HemPVoEqBIn MKRfM/gFQDAf7kVxw91Sud6wIZ9JHvVVaK06fqc0Su63rXxejgk6NwOaWnyiLx0Uh03y YvZ8qZyLUJ8cxXJRL5qxJd8bIn0bpmwhH3F+Ud5toYRxbnRvohc1hYW9JmTHPl5L7+Pq rAOlemORQEpQaXfMOAK05KSM8auGHg/CtZfNUxgmfYPdckWGyDFu1o3d0rWLrsKZI5HP P8Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737771210; x=1738376010; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+oQ2P8a47fCd0TJPqICbX62+VhXo899XJEdh7Y0/IPo=; b=Jis0BQ8gXkey1UHOQD3fEQRcQMOAa2SfTVhCNUEgskTm1HImOPSLFhJ104NPpXcuXu sgTGLIXkkvOlCphcyhebSnqV32lRY3t9oKMs1Yop//pLN/Ha4NkEpT0rouBu15PeP9cF DrlfsiqqMR/onXkFp40apTXsyq2/ybGaDEUIHGztI+5WrlSjclUch5SxizWzSHigD7vD cIsswQ7VKcE8ifgsVaSQ7NcQA04p03HFPp4qV3M6inkB01+Ft5VdHmmj3oq0+Fcws8L9 eyuEO9HyAnOKsVAlx6pduSIfbDlfIe+M6axFauo9LOiWfiCTG25rv31qWKp+mdxqDD+V BthQ== X-Gm-Message-State: AOJu0YzpWuGKiSpttKmS+7zbdKOTmiFlFQeaoP58QShgHOy/dGoRgplq PghneuxBP2UIWhHcr6i+PWITyQ1qjZHiYmmB5zngapFJslEtAcuglvYEDZaVi1S6vuC8tRBioE9 m X-Gm-Gg: ASbGncsBmKmoGauHDxFT3SmOqzmWxrVX1al3QTWjNPaEW6dg1HBHXJ5QkMjRQLkhy1v T3+F0Ob3kyzsVDSwHepUPIk6D+Nw8wNnxbgxpWDmrJJlSY5dObBn5S+LiHGNt+w1DAsj+IaBFh0 kxiVoQ8DKai4zV20/YF9dASiYHUxkcgrEkOJC6x7mpsuzNqrHZLr+dtfvzU8qQygJjr1QyfyotK VQhYlb1eh8MlzKKzXSzXa5nz1zOb56BYC7VPdI+rVIyFfo9PnZxUpF6kI8f/W7DL48E49QFKNns JpZ2hF+gUIsKHAjg92kyr/oMsKGsu/8D2rXOTFHlrtYqhWLjpIjcPnhlbg== X-Google-Smtp-Source: AGHT+IFo0h1Svu55MqKVIcQ3zo7+cIZVtzDlwDdCPmpsVh6sJszUeB3OIO5oji2RdbaMqBzdj1wvWQ== X-Received: by 2002:a17:902:a502:b0:216:11cf:790 with SMTP id d9443c01a7336-21da4a9d400mr66968495ad.16.1737771209873; Fri, 24 Jan 2025 18:13:29 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-ac48e84e199sm2345256a12.11.2025.01.24.18.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 18:13:29 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v5 15/16] sched: add allocation function attributes Date: Fri, 24 Jan 2025 18:11:28 -0800 Message-ID: <20250125021305.76485-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250125021305.76485-1-stephen@networkplumber.org> References: <20250110170603.538756-1-stephen@networkplumber.org> <20250125021305.76485-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Use function attributes to catch cases where sched port config is allocated but not freed correctly. Signed-off-by: Stephen Hemminger --- lib/sched/rte_sched.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/sched/rte_sched.h b/lib/sched/rte_sched.h index 222e6b3583..e98f43072d 100644 --- a/lib/sched/rte_sched.h +++ b/lib/sched/rte_sched.h @@ -51,6 +51,7 @@ * queues within same pipe lowest priority traffic class (best-effort). */ +#include #include #include @@ -310,16 +311,7 @@ struct rte_sched_port_params { * Configuration */ -/** - * Hierarchical scheduler port configuration - * - * @param params - * Port scheduler configuration parameter structure - * @return - * Handle to port scheduler instance upon success or NULL otherwise. - */ -struct rte_sched_port * -rte_sched_port_config(struct rte_sched_port_params *params); +struct rte_sched_port; /** * Hierarchical scheduler port free @@ -331,6 +323,18 @@ rte_sched_port_config(struct rte_sched_port_params *params); void rte_sched_port_free(struct rte_sched_port *port); +/** + * Hierarchical scheduler port configuration + * + * @param params + * Port scheduler configuration parameter structure + * @return + * Handle to port scheduler instance upon success or NULL otherwise. + */ +struct rte_sched_port * +rte_sched_port_config(struct rte_sched_port_params *params) + __rte_malloc __rte_dealloc(rte_sched_port_free, 1); + /** * Hierarchical scheduler pipe profile add * -- 2.45.2