DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jianfeng Tan <jianfeng.tan@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Jianfeng Tan <jianfeng.tan@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>
Subject: [dpdk-dev] [PATCH v2 2/2] ipc: fix timeout not properly handled in async
Date: Fri, 20 Apr 2018 15:20:12 +0000	[thread overview]
Message-ID: <1524237612-130629-3-git-send-email-jianfeng.tan@intel.com> (raw)
In-Reply-To: <1524237612-130629-1-git-send-email-jianfeng.tan@intel.com>

In original implementation, timeout event for an async request
will be ignored. As a result, an async request will never
trigger the action if it cannot receive any reply any more.

We fix this by counting timeout as a processed reply.

Fixes: f05e26051c15 ("eal: add IPC asynchronous request")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_proc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
index f8cb0e8..9136fb0 100644
--- a/lib/librte_eal/common/eal_common_proc.c
+++ b/lib/librte_eal/common/eal_common_proc.c
@@ -419,7 +419,13 @@ process_async_request(struct pending_request *sr, const struct timespec *now)
 	} else if (sr->reply_received == -1) {
 		/* we were asked to ignore this process */
 		reply->nb_sent--;
+	} else if (timeout) {
+		/* count it as processed response, but don't increment
+		 * nb_received.
+		 */
+		param->n_responses_processed++;
 	}
+
 	free(sr->reply);
 
 	last_msg = param->n_responses_processed == reply->nb_sent;
-- 
2.7.4

  parent reply	other threads:[~2018-04-20 15:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20  1:21 [dpdk-dev] [PATCH 0/2] code clean up and fix in ipc Jianfeng Tan
2018-04-20  1:21 ` [dpdk-dev] [PATCH 1/2] ipc: clearn up code Jianfeng Tan
2018-04-20  7:55   ` Burakov, Anatoly
2018-04-20 14:41     ` Tan, Jianfeng
2018-04-20  1:21 ` [dpdk-dev] [PATCH 2/2] ipc: fix timeout not properly handled in async Jianfeng Tan
2018-04-20  1:22   ` Tan, Jianfeng
2018-04-20  7:56   ` Burakov, Anatoly
2018-04-20 15:20 ` [dpdk-dev] [PATCH v2 0/2] code clean up and fix in ipc Jianfeng Tan
2018-04-20 15:20   ` [dpdk-dev] [PATCH v2 1/2] ipc: clearn up code Jianfeng Tan
2018-04-20 15:20   ` Jianfeng Tan [this message]
2018-04-23 20:48   ` [dpdk-dev] [PATCH v2 0/2] code clean up and fix in ipc Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1524237612-130629-3-git-send-email-jianfeng.tan@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).