From patchwork Thu Jan 25 16:00:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 125867 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1209111ljf; Thu, 25 Jan 2018 08:02:18 -0800 (PST) X-Google-Smtp-Source: AH8x227UyxinLJbyqWUr3YtDYJ06PtqUcpYv0mzS+uXW0NEJTt4hdD5f+PZVtpiziEnJRDtyWJ4b X-Received: by 10.157.54.100 with SMTP id w91mr12589690otb.136.1516896138292; Thu, 25 Jan 2018 08:02:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516896138; cv=none; d=google.com; s=arc-20160816; b=jgtQZl6z9XcwhA19qQKpKpVNyxC2KSJ6Y1EioGLyZxMUi9cAVUstTnMguthjSGCosm GF/GrndFZVDSMIEceFHI/8NFWffv/21p34rj5c57wWlR/HCqx+eBjB+MwHPSOTTGlAF5 lvJOhzvIsBSjhobEGR+9vhun3ZnXq09mviNcD53tX6Yqr31ONJQT5rmFitZ4oGy9YYDF /+197afbrv3OtydpHuRLks456knfzwLitgYQuXSXfzgCI0OOUwOZcIiFzA+dDVCQgJkW 7LsTdRlrnlX6yZ4T57+sZiG4TOtnK1alc49osiN4J6Ilo/mPuubdocwPpZh7oUVe/Sfd oUnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=Ml9+N3oBsnSGIiJyeKmkSEPboSysAJZyX8hBxBq4bAk=; b=ZVahwhvcHdyIfTQ3Ya5M1BxQbve8WJORpNSj6tGf255AebGQCXWd6kzixsDx54M7VP X98lQxDXszP4Vk+EY/eUo6yw4qfhuGrj0TC5xLbCfDTn37KxZOpublEMtT8FiUOqLP+y 750Nrilpe2fSDR9uEUaf071c2z9fyaUVR8Z2QQlUTkNA4z2pdWf8IGM65OYU3ZhK6mhO dh7ex+R/+RCRvSMsQt/e2vIGAMeRg/ntvdnuMXLVrvjz1hHiVgRlhopX7+U5SAqwj+i6 7IGA+PeQBfKHs69zYP7I3u7W/2Cp7AfSWKFECh5g5J2FoaDtb+IAC3i2A2kxiDiJww2E DNaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id h1si463803qtb.168.2018.01.25.08.02.17; Thu, 25 Jan 2018 08:02:18 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id D2C97609D9; Thu, 25 Jan 2018 16:02:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 0746561749; Thu, 25 Jan 2018 16:01:21 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D987C617A3; Thu, 25 Jan 2018 16:01:12 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 2F096609D9 for ; Thu, 25 Jan 2018 16:00:26 +0000 (UTC) Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 7DB865101525 for ; Thu, 25 Jan 2018 19:00:24 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id pi1hXoTOFw-0OxuqV8F; Thu, 25 Jan 2018 19:00:24 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id B3CrggWySj-0N70hdE4; Thu, 25 Jan 2018 19:00:23 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 25 Jan 2018 19:00:20 +0300 Message-Id: <1516896022-8965-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516896022-8965-1-git-send-email-odpbot@yandex.ru> References: <1516896022-8965-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 410 Subject: [lng-odp] [PATCH API-NEXT v6 1/3] test: validation: drop use of indefinite wait in pktio test X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bill Fischofer Drop use of deprecated ODP_PKTIN_WAIT timeout option in pktio tests. Signed-off-by: Bill Fischofer --- /** Email created from pull request 410 (Bill-Fischofer-Linaro:pktio-dropwait) ** https://github.com/Linaro/odp/pull/410 ** Patch: https://github.com/Linaro/odp/pull/410.patch ** Base sha: 44974a09b01c79adb9637a5dff38539598a76737 ** Merge commit sha: 50db898f5d832f31dfc63c6fc1360a29e700bdb4 **/ test/validation/api/pktio/pktio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index c144294b5..6592b2600 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -554,10 +554,8 @@ static int recv_packets_tmo(odp_pktio_t pktio, odp_packet_t pkt_tbl[], CU_ASSERT(from_val < (unsigned)num_q); } while (num_rx < num); - if (tmo == ODP_PKTIN_WAIT) - CU_ASSERT(num_rx == num); if (num_rx < num) - CU_ASSERT(odp_time_to_ns(odp_time_diff(ts2, ts1)) >= ns); + CU_ASSERT(odp_time_diff_ns(ts2, ts1) >= ns); return num_rx; } @@ -981,7 +979,7 @@ static void test_recv_tmo(recv_tmo_mode_e mode) CU_ASSERT_FATAL(ret == test_pkt_count); ret = recv_packets_tmo(pktio_rx, &pkt_tbl[0], &pkt_seq[0], 1, mode, - ODP_PKTIN_WAIT, 0); + odp_pktin_wait_time(UINT64_MAX), 0); CU_ASSERT_FATAL(ret == 1); ret = recv_packets_tmo(pktio_rx, &pkt_tbl[1], &pkt_seq[1], 1, mode, From patchwork Thu Jan 25 16:00:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 125869 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1210529ljf; Thu, 25 Jan 2018 08:03:55 -0800 (PST) X-Google-Smtp-Source: AH8x2265Xmt5a9u0eIO1Z8PW2whPQ3evzN2k7BnKKssYtimzI6mFxmXwW8S/HhzTQr5T4riw5DJi X-Received: by 10.13.218.69 with SMTP id c66mr8686330ywe.212.1516896235707; Thu, 25 Jan 2018 08:03:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516896235; cv=none; d=google.com; s=arc-20160816; b=lfU8KtkCcQEvzNYTIUdm8mUwvOyEjgwvOqn9uBY9oklCbFxoYOdfT6f+b/K2RRlgu4 VrMqqktB59NTDG4QWmHSXJI1KaBFZsF1EB7P2zvO9pahY3avXZkDdT2hS6PBxAfpAkHa guRJsGdzH4LAVVM99MCsm2vf9vH0lrBOLzpeuQL30Kom6yurGGNi7BtX62TnZJ28i2Cn Z/hLIRKG/qrGZcZEeZU0rjeYnheuWo5UWeLiTjRucl8o0DgxYFET0OTjjbUlpxmEse8x dc7j89r80hETPsUYsLa1KU5rotiXpUYJUwINfmqmuerMOIBBfTm7coIpa5JZCsSpC5dc Wo4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=tqkAvnSwhqDkomFVdhaePfs26ve6EB8XZwlyQsguAoo=; b=hYXTWt6FX5E4CMiHJzBX4DzH5eAx3mkz9ntq9olFLqMoWZhtVUsyt+iviO5X9ReF+Q xekor0X27vCwz2jNkFCl+dMdPWMs106TphOdD6Zr4v/MdoDugs8d9aAHVU08nqnu2Y1Q R6g743LTfj4p6i+eAuj126tCxMG6Mb8AGAgodNOgIL4xpAvzhaeRkG9UDkIQmquqzMT9 ErCDeSpbic1hEMNELtQKYxg/OU4wHTuquXxwMPWnbQKyVT3bbuD0EJO712tOlO7a+Vin GDcAKx4a0evdyi53LhyGMUyrmr4VxUK+wo0DVSNR4s6g/egkXv9eviKMa9XjL0WbIf8b KmaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id t76si1063044qkt.274.2018.01.25.08.03.55; Thu, 25 Jan 2018 08:03:55 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 5432C617C3; Thu, 25 Jan 2018 16:03:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 73219617B5; Thu, 25 Jan 2018 16:01:28 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id CB3F7616E9; Thu, 25 Jan 2018 16:01:17 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id B8AEF61749 for ; Thu, 25 Jan 2018 16:00:26 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 4B5456A84FEC for ; Thu, 25 Jan 2018 19:00:25 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id UBHAUZcJxW-0PxC5o5A; Thu, 25 Jan 2018 19:00:25 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id B3CrggWySj-0O70NsZ8; Thu, 25 Jan 2018 19:00:24 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 25 Jan 2018 19:00:21 +0300 Message-Id: <1516896022-8965-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516896022-8965-1-git-send-email-odpbot@yandex.ru> References: <1516896022-8965-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 410 Subject: [lng-odp] [PATCH API-NEXT v6 2/3] linux-generic: pktio: drop support for indefinite waits in recv_tmo X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bill Fischofer Drop support for the deprecated ODP_PKTIN_WAIT option on odp_pktin_recv_tmo() and odp_pktin_recv_mq_tmo() Signed-off-by: Bill Fischofer --- /** Email created from pull request 410 (Bill-Fischofer-Linaro:pktio-dropwait) ** https://github.com/Linaro/odp/pull/410 ** Patch: https://github.com/Linaro/odp/pull/410.patch ** Base sha: 44974a09b01c79adb9637a5dff38539598a76737 ** Merge commit sha: 50db898f5d832f31dfc63c6fc1360a29e700bdb4 **/ include/odp/api/abi-default/packet_io.h | 1 - platform/linux-generic/odp_packet_io.c | 76 +++++++++++++++-------------- platform/linux-generic/pktio/netmap.c | 6 +-- platform/linux-generic/pktio/pktio_common.c | 3 +- platform/linux-generic/pktio/socket.c | 6 +-- platform/linux-generic/pktio/socket_mmap.c | 6 +-- 6 files changed, 46 insertions(+), 52 deletions(-) diff --git a/include/odp/api/abi-default/packet_io.h b/include/odp/api/abi-default/packet_io.h index 4795f8fc3..7cd3edd75 100644 --- a/include/odp/api/abi-default/packet_io.h +++ b/include/odp/api/abi-default/packet_io.h @@ -46,7 +46,6 @@ typedef struct odp_pktout_queue_t { #define ODP_PKTIO_MACADDR_MAXSIZE 16 #define ODP_PKTIN_NO_WAIT 0 -#define ODP_PKTIN_WAIT UINT64_MAX /** * @} diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 095f6be12..21236f799 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -40,6 +40,9 @@ * Must be power of two. */ #define SLEEP_CHECK 32 +/* Max wait time supported to avoid potential overflow */ +#define MAX_WAIT_TIME (UINT64_MAX / 1024) + static pktio_table_t *pktio_tbl; /* pktio pointer entries ( for inlines) */ @@ -1699,33 +1702,31 @@ int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[], int num, while (1) { ret = entry->s.ops->recv(entry, queue.index, packets, num); - if (ret != 0) + if (ret != 0 || wait == 0) return ret; - if (wait == 0) - return 0; - - if (wait != ODP_PKTIN_WAIT) { - /* Avoid unnecessary system calls. Record the start time - * only when needed and after the first call to recv. */ - if (odp_unlikely(!started)) { - odp_time_t t; - - t = odp_time_local_from_ns(wait * 1000); - started = 1; - t1 = odp_time_sum(odp_time_local(), t); - } + /* Avoid unnecessary system calls. Record the start time + * only when needed and after the first call to recv. */ + if (odp_unlikely(!started)) { + odp_time_t t; + + /* Avoid overflow issues for large wait times */ + if (wait > MAX_WAIT_TIME) + wait = MAX_WAIT_TIME; + t = odp_time_local_from_ns(wait * 1000); + started = 1; + t1 = odp_time_sum(odp_time_local(), t); + } - /* Check every SLEEP_CHECK rounds if total wait time - * has been exceeded. */ - if ((++sleep_round & (SLEEP_CHECK - 1)) == 0) { - t2 = odp_time_local(); + /* Check every SLEEP_CHECK rounds if total wait time + * has been exceeded. */ + if ((++sleep_round & (SLEEP_CHECK - 1)) == 0) { + t2 = odp_time_local(); - if (odp_time_cmp(t2, t1) > 0) - return 0; - } - wait = wait > SLEEP_USEC ? wait - SLEEP_USEC : 0; + if (odp_time_cmp(t2, t1) > 0) + return 0; } + wait = wait > SLEEP_USEC ? wait - SLEEP_USEC : 0; nanosleep(&ts, NULL); } @@ -1779,25 +1780,26 @@ int odp_pktin_recv_mq_tmo(const odp_pktin_queue_t queues[], unsigned num_q, if (wait == 0) return 0; - if (wait != ODP_PKTIN_WAIT) { - if (odp_unlikely(!started)) { - odp_time_t t; + if (odp_unlikely(!started)) { + odp_time_t t; - t = odp_time_local_from_ns(wait * 1000); - started = 1; - t1 = odp_time_sum(odp_time_local(), t); - } + /* Avoid overflow issues for large wait times */ + if (wait > MAX_WAIT_TIME) + wait = MAX_WAIT_TIME; + t = odp_time_local_from_ns(wait * 1000); + started = 1; + t1 = odp_time_sum(odp_time_local(), t); + } - /* Check every SLEEP_CHECK rounds if total wait time - * has been exceeded. */ - if ((++sleep_round & (SLEEP_CHECK - 1)) == 0) { - t2 = odp_time_local(); + /* Check every SLEEP_CHECK rounds if total wait time + * has been exceeded. */ + if ((++sleep_round & (SLEEP_CHECK - 1)) == 0) { + t2 = odp_time_local(); - if (odp_time_cmp(t2, t1) > 0) - return 0; - } - wait = wait > SLEEP_USEC ? wait - SLEEP_USEC : 0; + if (odp_time_cmp(t2, t1) > 0) + return 0; } + wait = wait > SLEEP_USEC ? wait - SLEEP_USEC : 0; nanosleep(&ts, NULL); } diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 7200ceea8..bbd0d6cdf 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -834,8 +834,7 @@ static int netmap_recv_tmo(pktio_entry_t *pktio_entry, int index, FD_ZERO(&readfds); maxfd = netmap_fd_set(pktio_entry, index, &readfds); - if (select(maxfd + 1, &readfds, NULL, NULL, - usecs == ODP_PKTIN_WAIT ? NULL : &timeout) == 0) + if (select(maxfd + 1, &readfds, NULL, NULL, &timeout) == 0) return 0; return netmap_recv(pktio_entry, index, pkt_table, num); @@ -872,8 +871,7 @@ static int netmap_recv_mq_tmo(pktio_entry_t *pktio_entry[], int index[], timeout.tv_sec = usecs / (1000 * 1000); timeout.tv_usec = usecs - timeout.tv_sec * (1000ULL * 1000ULL); - if (select(maxfd + 1, &readfds, NULL, NULL, - usecs == ODP_PKTIN_WAIT ? NULL : &timeout) == 0) + if (select(maxfd + 1, &readfds, NULL, NULL, &timeout) == 0) return 0; for (i = 0; i < num_q; i++) { diff --git a/platform/linux-generic/pktio/pktio_common.c b/platform/linux-generic/pktio/pktio_common.c index f6fb4a73d..c7a1c3ab9 100644 --- a/platform/linux-generic/pktio/pktio_common.c +++ b/platform/linux-generic/pktio/pktio_common.c @@ -107,8 +107,7 @@ static int sock_recv_mq_tmo_select(pktio_entry_t * const *entry, timeout.tv_sec = usecs / (1000 * 1000); timeout.tv_usec = usecs - timeout.tv_sec * (1000ULL * 1000ULL); - if (select(maxfd + 1, readfds, NULL, NULL, - usecs == ODP_PKTIN_WAIT ? NULL : &timeout) == 0) + if (select(maxfd + 1, readfds, NULL, NULL, &timeout) == 0) return 0; for (i = 0; i < num_q; i++) { diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 2d0296b8a..5abf05e34 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -726,8 +726,7 @@ static int sock_recv_tmo(pktio_entry_t *pktio_entry, int index, FD_ZERO(&readfds); maxfd = sock_fd_set(pktio_entry, index, &readfds); - if (select(maxfd + 1, &readfds, NULL, NULL, - usecs == ODP_PKTIN_WAIT ? NULL : &timeout) == 0) + if (select(maxfd + 1, &readfds, NULL, NULL, &timeout) == 0) return 0; return sock_mmsg_recv(pktio_entry, index, pkt_table, num); @@ -764,8 +763,7 @@ static int sock_recv_mq_tmo(pktio_entry_t *pktio_entry[], int index[], maxfd = maxfd2; } - if (select(maxfd + 1, &readfds, NULL, NULL, - usecs == ODP_PKTIN_WAIT ? NULL : &timeout) == 0) + if (select(maxfd + 1, &readfds, NULL, NULL, &timeout) == 0) return 0; for (i = 0; i < num_q; i++) { diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index f16670960..04c44bc85 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -692,8 +692,7 @@ static int sock_mmap_recv_tmo(pktio_entry_t *pktio_entry, int index, FD_ZERO(&readfds); maxfd = sock_mmap_fd_set(pktio_entry, index, &readfds); - if (select(maxfd + 1, &readfds, NULL, NULL, - usecs == ODP_PKTIN_WAIT ? NULL : &timeout) == 0) + if (select(maxfd + 1, &readfds, NULL, NULL, &timeout) == 0) return 0; return sock_mmap_recv(pktio_entry, index, pkt_table, num); @@ -730,8 +729,7 @@ static int sock_mmap_recv_mq_tmo(pktio_entry_t *pktio_entry[], int index[], timeout.tv_sec = usecs / (1000 * 1000); timeout.tv_usec = usecs - timeout.tv_sec * (1000ULL * 1000ULL); - if (select(maxfd + 1, &readfds, NULL, NULL, - usecs == ODP_PKTIN_WAIT ? NULL : &timeout) == 0) + if (select(maxfd + 1, &readfds, NULL, NULL, &timeout) == 0) return 0; for (i = 0; i < num_q; i++) { From patchwork Thu Jan 25 16:00:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 125868 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1209845ljf; Thu, 25 Jan 2018 08:03:05 -0800 (PST) X-Google-Smtp-Source: AH8x22522G5O1YGPkBWIaHcX7DjpDYZi7Zq3RFZCGqyPEeCLLldfM0wFqgbtd7fvmh5J+INPX7M+ X-Received: by 10.55.156.143 with SMTP id f137mr14892551qke.324.1516896185626; Thu, 25 Jan 2018 08:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516896185; cv=none; d=google.com; s=arc-20160816; b=z3FvOxsryvdqqOq7uZFMSI+4RGh4XtwLK7yC846zPgBcf1u0RKSjR77LEANncyAO+8 dTwMQMJJRZdnpdryoVBL/rbRvwSc11o2EgPfRqk7FSIpPjwNivlSlYGiVssIJd/qk4fK XHM036X6l7i8OB30khow3yWlr2l6+2FltNmYI0f4P8fptyoTtr8x5a+qctMoK0g/2EMY E3qwgIKVSsy0sulHfR25LkqkgsZXlOJBDvANjmarLUBCvJFao7HQ2gloJP+Cg+nD/sK+ +3Sq3r1C+VveqmGBXocS6AhOvOW5gkqhWG2pQ6OtkVE6kdqgJrf+W1e+rKP3SJ/8339s k83w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=LLtiiz/ZAa2S8YqX4W8rimo3JGn0Gk8c7gf6WSEPqRc=; b=lM/Va/EJFKvZyTdBr8rWhzDRHG5aRN5s7Aj5fMBAs10emJBjKkazNNR04rFLew+uI1 iK/e3e7TM7m5Y6KY86ejM06IGV4PZBkEPOlsoIqVYXf3BbtLqGhEPNHO3xFGhr7nBYxD HzPzVBCDA64O728JLVQipAXk8N1/Xo3RssXQZU26rB7D08+O4bHTwJYQXMt9GAPxtVAJ nZC6F6xl4RUHrQzhyhHuJ1nLMfal+jZH0zGLIxr/HMoQ5RQIGZbT7h+fOo1QTwJLTWZL udWPmQRl4iNv0C4eymKHMtiG8Mxt5241SHRzi/s/RySRFfakF8EdXDzlkE9So+nuM+0Z fchQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id h79si3108179qkh.2.2018.01.25.08.03.04; Thu, 25 Jan 2018 08:03:05 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 78573617A3; Thu, 25 Jan 2018 16:03:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 3E36A617AF; Thu, 25 Jan 2018 16:01:22 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 166F3617AF; Thu, 25 Jan 2018 16:01:16 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 442FB61782 for ; Thu, 25 Jan 2018 16:00:27 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 0F4AC6A84FCF for ; Thu, 25 Jan 2018 19:00:26 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id r4eTAr1zek-0PMuN60P; Thu, 25 Jan 2018 19:00:26 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id B3CrggWySj-0P7edQdG; Thu, 25 Jan 2018 19:00:25 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 25 Jan 2018 19:00:22 +0300 Message-Id: <1516896022-8965-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516896022-8965-1-git-send-email-odpbot@yandex.ru> References: <1516896022-8965-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 410 Subject: [lng-odp] [PATCH API-NEXT v6 3/3] api: pktio: drop support for indefinite waits on recv_tmo calls X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bill Fischofer The ODP_PKTIN_WAIT option on odp_pktin_recv_tmo() and odp_pktin_recv_mq_tmo() is deprecated and removed. Signed-off-by: Bill Fischofer --- /** Email created from pull request 410 (Bill-Fischofer-Linaro:pktio-dropwait) ** https://github.com/Linaro/odp/pull/410 ** Patch: https://github.com/Linaro/odp/pull/410.patch ** Base sha: 44974a09b01c79adb9637a5dff38539598a76737 ** Merge commit sha: 50db898f5d832f31dfc63c6fc1360a29e700bdb4 **/ include/odp/api/spec/packet_io.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index ad9b29fda..a55c2678f 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -72,11 +72,6 @@ extern "C" { * Do not wait on packet input */ -/** - * @def ODP_PKTIN_WAIT - * Wait infinitely on packet input - */ - /** * Packet input mode */ @@ -884,7 +879,6 @@ int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t packets[], int num); * @param num Maximum number of packets to receive * @param wait Wait time specified as as follows: * * ODP_PKTIN_NO_WAIT: Do not wait - * * ODP_PKTIN_WAIT: Wait infinitely * * Other values specify the minimum time to wait. * Use odp_pktin_wait_time() to convert nanoseconds * to a valid parameter value. Wait time may be @@ -923,7 +917,6 @@ int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[], * @param num Maximum number of packets to receive * @param wait Wait time specified as as follows: * * ODP_PKTIN_NO_WAIT: Do not wait - * * ODP_PKTIN_WAIT: Wait infinitely * * Other values specify the minimum time to wait. * Use odp_pktin_wait_time() to convert nanoseconds * to a valid parameter value. Wait time may be