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 3E240A034C for ; Fri, 25 Feb 2022 18:17:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38D234114A; Fri, 25 Feb 2022 18:17:30 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 9B29B41148 for ; Fri, 25 Feb 2022 18:17:28 +0100 (CET) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 803803F1F3 for ; Fri, 25 Feb 2022 17:17:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645809448; bh=36o2oOSSIb6wXiMq0BvE2BIm6Y9Hv85DetFe5+9RuCo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dBK5GAh3hx56W4eKs2AdsTBw+uKmTEZewmIFsDYhN2B2g9Ua/Sn6km+YuFhQD2xsF mgSI27FCjlxrvnLVjL6Ci4l6B7IGswL+Y+MexQjEp43NS74mevoRqodrNn1ZdgQ5MA BfHkpDaJEkpoXgBxTbWP5GocbodR/z8dAsUE4R26/swy6aGNEB8iRzJOZu+S96eF5B lQkMtmtyuu4kbzgSFBdcramB4f+gFYUkxObT0f2V5o1WiMhSdjI3m/4n7WNOIMkfJ9 UY/T412ea92eqIrx0gPpXY9YFuk+Rr5Vz14lqgcKda58LHHwByMd14M3yXIxqHOZme NGhdQOFpz7XBQ== Received: by mail-wr1-f70.google.com with SMTP id q12-20020adfbb8c000000b001ea938f79e9so1075734wrg.23 for ; Fri, 25 Feb 2022 09:17:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=36o2oOSSIb6wXiMq0BvE2BIm6Y9Hv85DetFe5+9RuCo=; b=FFm1Bm0YuEeF4TCu2whLqY43v3fAJVevjrbKUZWTnH0gZUqpnnP5CxF4iGpJ9G+xpw IcwdItB6o7j+RlfhINFUdx1qKvNgP5MsLJjUb0zKeMEh6FGmiatENJ0xSo4mAqwLDvST dxszKQ3/6Gc7SrA0bJryrIuGDDfeg4CYz4t+kmL+9KrLE24+C28XnfSpvCSb5akDqSOU /C3a74pmlP+e4OC7fuhJgKsz6gliM2lTys9zRx/gW/eU3A4I8SVi9coPTjS0MRXeJvCi Kcuqi8omu1O/F4ZlyR4Sw93FddtIJZOWBXiDqNVGqGtiJs4qkHvZp89tvCoeiQKwPZh6 o3+g== X-Gm-Message-State: AOAM532pxIiTGXmxtlmknNHYW2XmWsqpnpRpS7zE9Ju+miWM1MY/zEFC Qdj832UL0fg1/AmYtxL4fhUBNNMyvL3PW8OoOQTKMYUSmb12q9UtJ3DXGtrLDRfd2QVUDZOsXaE yCPi0qwFhNcWilk1CIsGHdj9o X-Received: by 2002:a05:600c:8a9:b0:380:da47:a911 with SMTP id l41-20020a05600c08a900b00380da47a911mr3606920wmp.102.1645809447272; Fri, 25 Feb 2022 09:17:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwvcuR/t5H+rIkNuJ+1nZnjEi3HFy4zqpMMOi0DyvYW9vv39pXE4NrozeGPXTZvIyFMJfXAA== X-Received: by 2002:a05:600c:8a9:b0:380:da47:a911 with SMTP id l41-20020a05600c08a900b00380da47a911mr3606906wmp.102.1645809447019; Fri, 25 Feb 2022 09:17:27 -0800 (PST) Received: from Keschdeichel.fritz.box (068-133-067-156.ip-addr.inexio.net. [156.67.133.68]) by smtp.gmail.com with ESMTPSA id o9-20020adfeac9000000b001e68d090023sm2895646wrn.68.2022.02.25.09.17.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 09:17:26 -0800 (PST) From: christian.ehrhardt@canonical.com To: Yunjian Wang Cc: Nan Zhou , Konstantin Ananyev , dpdk stable Subject: patch 'ring: fix error code when creating ring' has been queued to stable release 19.11.12 Date: Fri, 25 Feb 2022 18:15:26 +0100 Message-Id: <20220225171550.3499040-33-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> References: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 19.11.12 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/27/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/b737263daeb4bf22b44b73ef4375a4931c6b142f Thanks. Christian Ehrhardt --- >From b737263daeb4bf22b44b73ef4375a4931c6b142f Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Mon, 10 Jan 2022 17:23:03 +0800 Subject: [PATCH] ring: fix error code when creating ring [ upstream commit 074717be3ef9e7a8868b5af078b0ca7b61bcc44b ] The error value returned by rte_ring_create_elem() should be positive integers. However, if the rte_ring_get_memsize_elem() function fails, a negative number is returned and is directly used as the return value. As a result, this will cause the external call to check the return value to fail(like called by rte_mempool_create()). Fixes: a182620042aa ("ring: get size in memory") Reported-by: Nan Zhou Signed-off-by: Yunjian Wang Acked-by: Konstantin Ananyev --- lib/librte_ring/rte_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c index d9b308036c..6e740e8f9e 100644 --- a/lib/librte_ring/rte_ring.c +++ b/lib/librte_ring/rte_ring.c @@ -137,7 +137,7 @@ rte_ring_create(const char *name, unsigned count, int socket_id, ring_size = rte_ring_get_memsize(count); if (ring_size < 0) { - rte_errno = ring_size; + rte_errno = -ring_size; return NULL; } -- 2.35.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-25 16:58:45.535788823 +0100 +++ 0033-ring-fix-error-code-when-creating-ring.patch 2022-02-25 16:58:44.248990421 +0100 @@ -1 +1 @@ -From 074717be3ef9e7a8868b5af078b0ca7b61bcc44b Mon Sep 17 00:00:00 2001 +From b737263daeb4bf22b44b73ef4375a4931c6b142f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 074717be3ef9e7a8868b5af078b0ca7b61bcc44b ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ - lib/ring/rte_ring.c | 2 +- + lib/librte_ring/rte_ring.c | 2 +- @@ -22,5 +23,5 @@ -diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c -index f17bd966be..185f9be798 100644 ---- a/lib/ring/rte_ring.c -+++ b/lib/ring/rte_ring.c -@@ -267,7 +267,7 @@ rte_ring_create_elem(const char *name, unsigned int esize, unsigned int count, +diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c +index d9b308036c..6e740e8f9e 100644 +--- a/lib/librte_ring/rte_ring.c ++++ b/lib/librte_ring/rte_ring.c +@@ -137,7 +137,7 @@ rte_ring_create(const char *name, unsigned count, int socket_id, @@ -28 +29 @@ - ring_size = rte_ring_get_memsize_elem(esize, count); + ring_size = rte_ring_get_memsize(count);