From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1CB13A0B0A for ; Tue, 14 May 2019 16:44:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC62C5F36; Tue, 14 May 2019 16:44:49 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 3607E5B2A for ; Tue, 14 May 2019 16:44:48 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C48E7883C2; Tue, 14 May 2019 14:44:36 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-124.ams2.redhat.com [10.36.116.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id E289E60C1B; Tue, 14 May 2019 14:44:34 +0000 (UTC) From: Kevin Traynor To: Anatoly Burakov Cc: dpdk stable Date: Tue, 14 May 2019 15:43:51 +0100 Message-Id: <20190514144406.7526-7-ktraynor@redhat.com> In-Reply-To: <20190514144406.7526-1-ktraynor@redhat.com> References: <20190514144406.7526-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 14 May 2019 14:44:42 +0000 (UTC) Subject: [dpdk-stable] patch 'ipc: add warnings about correct API usage' has been queued to LTS release 18.11.2 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/20/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/8807801ca323864f45fc8d1cabb0b836c2b0b1cc Thanks. Kevin Traynor --- >From 8807801ca323864f45fc8d1cabb0b836c2b0b1cc Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Fri, 3 May 2019 12:50:50 +0100 Subject: [PATCH] ipc: add warnings about correct API usage [ upstream commit bfbc3a50416419d79c9cbe7868d1e9901919c346 ] When handling synchronous or asynchronous requests, the reply must be sent explicitly even if the result of the operation is an error, to avoid the other side timing out. Make note of this in documentation explicitly. Signed-off-by: Anatoly Burakov --- doc/guides/prog_guide/multi_proc_support.rst | 7 +++++++ lib/librte_eal/common/include/rte_eal.h | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/doc/guides/prog_guide/multi_proc_support.rst b/doc/guides/prog_guide/multi_proc_support.rst index 63d08b609..a84083b96 100644 --- a/doc/guides/prog_guide/multi_proc_support.rst +++ b/doc/guides/prog_guide/multi_proc_support.rst @@ -310,4 +310,11 @@ constructed and sent via ``rte_mp_reply()`` function, along with ``peer`` pointer. The resulting response will then be delivered to the correct requestor. +.. warning:: + Simply returning a value when processing a request callback will not send a + response to the request - it must always be explicitly sent even in case + of errors. Implementation of error signalling rests with the application, + there is no built-in way to indicate success or error for a request. Failing + to do so will cause the requestor to time out while waiting on a response. + Misc considerations ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 1d3553cea..9951228e0 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -230,4 +230,9 @@ struct rte_mp_reply { * this function typedef to register action for coming messages. * + * @note When handling IPC request callbacks, the reply must be sent even in + * cases of error handling. Simply returning success or failure will *not* + * send a response to the requestor. + * Implementation of error signalling mechanism is up to the application. + * * @note No memory allocations should take place inside the callback. */ @@ -241,4 +246,9 @@ typedef int (*rte_mp_t)(const struct rte_mp_msg *msg, const void *peer); * requests. * + * @note When handling IPC request callbacks, the reply must be sent even in + * cases of error handling. Simply returning success or failure will *not* + * send a response to the requestor. + * Implementation of error signalling mechanism is up to the application. + * * @note No memory allocations should take place inside the callback. */ @@ -372,4 +382,9 @@ rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts, * received previously. * + * @note When handling IPC request callbacks, the reply must be sent even in + * cases of error handling. Simply returning success or failure will *not* + * send a response to the requestor. + * Implementation of error signalling mechanism is up to the application. + * * @param msg * The msg argument contains the customized message. -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-05-14 15:39:07.647717944 +0100 +++ 0007-ipc-add-warnings-about-correct-API-usage.patch 2019-05-14 15:39:07.304558991 +0100 @@ -1 +1 @@ -From bfbc3a50416419d79c9cbe7868d1e9901919c346 Mon Sep 17 00:00:00 2001 +From 8807801ca323864f45fc8d1cabb0b836c2b0b1cc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit bfbc3a50416419d79c9cbe7868d1e9901919c346 ] + @@ -11,2 +12,0 @@ -Cc: stable@dpdk.org - @@ -36 +36 @@ -index 7db022532..73754aaf2 100644 +index 1d3553cea..9951228e0 100644 @@ -39 +39 @@ -@@ -227,4 +227,9 @@ struct rte_mp_reply { +@@ -230,4 +230,9 @@ struct rte_mp_reply { @@ -49 +49 @@ -@@ -238,4 +243,9 @@ typedef int (*rte_mp_t)(const struct rte_mp_msg *msg, const void *peer); +@@ -241,4 +246,9 @@ typedef int (*rte_mp_t)(const struct rte_mp_msg *msg, const void *peer); @@ -59 +59 @@ -@@ -369,4 +379,9 @@ rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts, +@@ -372,4 +382,9 @@ rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts,