From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id CB5761B489 for ; Fri, 4 Jan 2019 14:27:23 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A87C1F8F2; Fri, 4 Jan 2019 13:27:23 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-13.ams2.redhat.com [10.36.117.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EEC45C1A1; Fri, 4 Jan 2019 13:27:18 +0000 (UTC) From: Kevin Traynor To: Anatoly Burakov Cc: Tiwei Bie , Maxime Coquelin , dpdk stable Date: Fri, 4 Jan 2019 13:24:16 +0000 Message-Id: <20190104132455.15170-34-ktraynor@redhat.com> In-Reply-To: <20190104132455.15170-1-ktraynor@redhat.com> References: <20190104132455.15170-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 04 Jan 2019 13:27:23 +0000 (UTC) Subject: [dpdk-stable] patch 'mem: fix segment fd API error code for external segment' has been queued to LTS release 18.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 13:27:24 -0000 Hi, FYI, your patch has been queued to LTS release 18.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/11/19. 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. Thanks. Kevin Traynor --- >>From 0cd9579b47cf06a7f3cccb346e4243d4c5973cf6 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Thu, 13 Dec 2018 11:43:15 +0000 Subject: [PATCH] mem: fix segment fd API error code for external segment [ upstream commit 525670756a566b3efa88eeae53755a770f0c14fe ] Segment fd API does not support getting segment fd's from externally allocated memory, so return proper error code on any attempts to do so. This changes API behavior, so document the change as well. Fixes: 5282bb1c3695 ("mem: allow memseg lists to be marked as external") Signed-off-by: Anatoly Burakov Acked-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- lib/librte_eal/common/eal_common_memory.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c index d47ea4938..999ba24b4 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c @@ -705,4 +705,10 @@ rte_memseg_get_fd_thread_unsafe(const struct rte_memseg *ms) } + /* segment fd API is not supported for external segments */ + if (msl->external) { + rte_errno = ENOTSUP; + return -1; + } + ret = eal_memalloc_get_seg_fd(msl_idx, seg_idx); if (ret < 0) { @@ -755,4 +761,10 @@ rte_memseg_get_fd_offset_thread_unsafe(const struct rte_memseg *ms, } + /* segment fd API is not supported for external segments */ + if (msl->external) { + rte_errno = ENOTSUP; + return -1; + } + ret = eal_memalloc_get_seg_fd_offset(msl_idx, seg_idx, offset); if (ret < 0) { -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-01-04 13:23:08.256571309 +0000 +++ 0034-mem-fix-segment-fd-API-error-code-for-external-segme.patch 2019-01-04 13:23:07.000000000 +0000 @@ -1,43 +1,29 @@ -From 525670756a566b3efa88eeae53755a770f0c14fe Mon Sep 17 00:00:00 2001 +From 0cd9579b47cf06a7f3cccb346e4243d4c5973cf6 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Thu, 13 Dec 2018 11:43:15 +0000 Subject: [PATCH] mem: fix segment fd API error code for external segment +[ upstream commit 525670756a566b3efa88eeae53755a770f0c14fe ] + Segment fd API does not support getting segment fd's from externally allocated memory, so return proper error code on any attempts to do so. This changes API behavior, so document the change as well. Fixes: 5282bb1c3695 ("mem: allow memseg lists to be marked as external") -Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov Acked-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- - doc/guides/rel_notes/release_19_02.rst | 5 +++++ lib/librte_eal/common/eal_common_memory.c | 12 ++++++++++++ - 2 files changed, 17 insertions(+) + 1 file changed, 12 insertions(+) -diff --git a/doc/guides/rel_notes/release_19_02.rst b/doc/guides/rel_notes/release_19_02.rst -index c1fa8843e..63e84fef7 100644 ---- a/doc/guides/rel_notes/release_19_02.rst -+++ b/doc/guides/rel_notes/release_19_02.rst -@@ -110,4 +110,9 @@ API Changes - ========================================================= - -+* eal: Segment fd API on Linux now sets error code to ``ENOTSUP`` in more cases -+ where segment fd API is not expected to be supported: -+ -+ - On attempt to get segment fd for an externally allocated memory segment -+ - * pdump: The ``rte_pdump_set_socket_dir()``, the parameter ``path`` of - ``rte_pdump_init()`` and enum ``rte_pdump_socktype`` were deprecated diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c -index 051159f80..c9da69b16 100644 +index d47ea4938..999ba24b4 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c -@@ -706,4 +706,10 @@ rte_memseg_get_fd_thread_unsafe(const struct rte_memseg *ms) +@@ -705,4 +705,10 @@ rte_memseg_get_fd_thread_unsafe(const struct rte_memseg *ms) } + /* segment fd API is not supported for external segments */ @@ -48,7 +34,7 @@ + ret = eal_memalloc_get_seg_fd(msl_idx, seg_idx); if (ret < 0) { -@@ -756,4 +762,10 @@ rte_memseg_get_fd_offset_thread_unsafe(const struct rte_memseg *ms, +@@ -755,4 +761,10 @@ rte_memseg_get_fd_offset_thread_unsafe(const struct rte_memseg *ms, } + /* segment fd API is not supported for external segments */