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 847FF46037; Sun, 19 Jan 2025 18:47:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D9AD402EF; Sun, 19 Jan 2025 18:46:55 +0100 (CET) Received: from mail-wm1-f97.google.com (mail-wm1-f97.google.com [209.85.128.97]) by mails.dpdk.org (Postfix) with ESMTP id 0A0F3402DF for ; Sun, 19 Jan 2025 18:46:54 +0100 (CET) Received: by mail-wm1-f97.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so36764755e9.3 for ; Sun, 19 Jan 2025 09:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1737308813; x=1737913613; 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=ycowYCifnywqURK5STxRxpW5z887rWVxCctWcm/5RzU=; b=Hyki/lF1FtEbkfZtYjsqskpwRu9ZXs48Qw/Sp2tVVyQRE5JyPFO8dJufBCHZdkQOMu A3CpLR338OLhgyexcTzdvI9KLwDCwtgaZssP5DfDYCigyifwwsHLiaMcwRzgmmjosySX xwbu/d2LsnJLxT0II6464CFCFdMLn5Zba1b6nh7B33qEwZHU8geeYTZx2aVIi0of5W2G 9w02QhOdj14tYGo9ADFpno7WswFEIP0XBeeZ6R5zO39om9RFCTFbBTbgmkIYAwdwd2AT 1LPT/t2gNk5sLbXeyVIqLUowhOaccy55uEH7IfwqL0n5rPuUdsFhdeU3wTcxm5v2CQxL EtTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737308813; x=1737913613; 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=ycowYCifnywqURK5STxRxpW5z887rWVxCctWcm/5RzU=; b=QsAF1pmt0A83PnVtTCS48Co4QhYkosO2pvUs1k9dMBCIznj+BwptFLy1eb2zuwH6hR s2EP1KizmVXj4Vm8vIuoESipUau/qXIIe+msAJF4f4dq+jikKABAQRx2R1Ig3ix/tP2H wGslvzMzJFZpscfpf8DPuAeoGFu5dKbz5UldgLxXN2uVzfGus0XA60FNsVVhajxmI3UB oGG+HK2QQ5P34ZdjRoNHdltG3n6IO1Y3rwsQ3oVLnCJz1TNw4MXxAZOPV7aFseu38A1r iXK/kZVpqsZp729YIWzUiK4HhyV1H+z22x1az2RZFr5WFhaB6+cDPuVGPjWsooGhMRMb 2YTA== X-Gm-Message-State: AOJu0YzOzYSB9HVKu0ZTMcvIbN7Ox+OeWxdTyrYhz7s06aRab5Usnw/N 7YO8Uyiz11nNQl8dQ9MbZvn0X2qgzeZgHlrdSwa7djsdo2iWVUBQzIJ+LQi+cvzMONe7T9i9EQ2 vMmqcJuMRoBT9YaxJE2Nit9EjBjFnJwWTgqdhaqo0 X-Gm-Gg: ASbGnctY9ICGcF6Y+ZNioFYr6EWmKzlXjSSrO+GO3b3qeppngVAazPz6VvcZjiu+UJs FXOpbQe4y9ptfaRzbGKpLolzWMsRd6b0ICUlkEtjbXi2RD2Hbj5slMrqcWdEC7UCqdklebDKixT 8p6mTnUhHxgOktYnMl6MPJZeaPLlDOE+cR1r644ECc2eN1+qc4V79QsDwCu8QzNwF3KnjSN6JU7 Y0XwnKDUcVpQrkxHbrDFEcSxr9OqwobixgfFv/PWsoGYv3ACxpu+W3Dezv/31DcRPJDQhDMP8xR dAljh8+68T8kqFH/Aem7n0ArFmdpbDlxV3iyERA= X-Google-Smtp-Source: AGHT+IGmEELxy0OSUhem7W8mqBho6GJzKjEyoMfdLWjHExmUEkAkJxLQKlsKpctb6tgdFBwZbsRdEysh0daR X-Received: by 2002:a5d:6d82:0:b0:388:c61d:43e0 with SMTP id ffacd0b85a97d-38bf59ef478mr10748752f8f.48.1737308813687; Sun, 19 Jan 2025 09:46:53 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id ffacd0b85a97d-38bf2fc5f99sm325213f8f.0.2025.01.19.09.46.53; Sun, 19 Jan 2025 09:46:53 -0800 (PST) X-Relaying-Domain: 6wind.com Received: from localhost (rainbow.dev.6wind.com [10.17.1.165]) by smtpservice.6wind.com (Postfix) with ESMTP id 922C1131C5; Sun, 19 Jan 2025 18:46:53 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: stable@dpdk.org, Thomas Monjalon , David Marchand , Ariel Otilibili , Andrew Rybchenko , =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH 1/2] mempool: add rte_errno in rte_mempool_set_ops_byname Date: Sun, 19 Jan 2025 18:46:42 +0100 Message-Id: <20250119174643.2162110-2-ariel.otilibili@6wind.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250119174643.2162110-1-ariel.otilibili@6wind.com> References: <20250119174643.2162110-1-ariel.otilibili@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 rte_errno is not set for error exits. For the scenario described in BugZilla ID 1559, rte_mempool_create_empty() calls rte_mempool_set_ops_byname(), but does not set as well the proper rte_errno. rte_errno is now set in rte_mempool_set_ops_byname(); from there it cascades down to the calling function. Bugzilla ID: 1559 Signed-off-by: Ariel Otilibili --- lib/mempool/rte_mempool_ops.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/mempool/rte_mempool_ops.c b/lib/mempool/rte_mempool_ops.c index 1b33380259b3..b5c68ac61b67 100644 --- a/lib/mempool/rte_mempool_ops.c +++ b/lib/mempool/rte_mempool_ops.c @@ -169,8 +169,10 @@ rte_mempool_set_ops_byname(struct rte_mempool *mp, const char *name, unsigned i; /* too late, the mempool is already populated. */ - if (mp->flags & RTE_MEMPOOL_F_POOL_CREATED) - return -EEXIST; + if (mp->flags & RTE_MEMPOOL_F_POOL_CREATED) { + rte_errno = EEXIST; + return -rte_errno; + } for (i = 0; i < rte_mempool_ops_table.num_ops; i++) { if (!strcmp(name, @@ -180,8 +182,10 @@ rte_mempool_set_ops_byname(struct rte_mempool *mp, const char *name, } } - if (ops == NULL) - return -EINVAL; + if (ops == NULL) { + rte_errno = EINVAL; + return -rte_errno; + } mp->ops_index = i; mp->pool_config = pool_config; -- 2.30.2