From patchwork Wed Jan 24 21:00:18 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: 125712 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp663355ljf; Wed, 24 Jan 2018 13:00:35 -0800 (PST) X-Google-Smtp-Source: AH8x225vxz3qnjzYf+/bzBvz74MxU4UJEVP0yJ+YzysNaytvj+60MEn1cf1z/Kkd7Hg/iqRzF74P X-Received: by 10.200.19.74 with SMTP id f10mr4538198qtj.72.1516827634859; Wed, 24 Jan 2018 13:00:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516827634; cv=none; d=google.com; s=arc-20160816; b=jgTgtE26p35bbTfb1nZ6k3B8ViJEAmE1qhvTPQZcr+t2yAs/ud+J0PyGBQJBfxRXdO tL6MdwD6rWc8pPHuOsP0YofTY7j2ZAAMRANURDd0qQ3JXBHU7kJfiCY7fCwdoF/vumMP lYORtG8v9vUoz9aKt0WVExTvcVJsKh/92+vp0RFljKcQkjyp36bziiWRqM7FyUfSMXpy 9O8zrhMOQp66zplmjdOdWl6BdvsXyOMJMInmRYGOsi+qxgKGVt233C16hZmk7jB8aZTx FyXJ54EfHiK2j2QOqmbctHV6zgH3k9PbXOWm0zUksa1JHGHDj2YyvH82W0I27QN+2Wyj DIAg== 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=2h1KKsdJDiY/urbOpqqyP1TgVwzKcVa13FJDmnTsG18=; b=08+8+G67DlUhCyquMoMYYFN6/SmkhMjI46d6Yvfe+u7U83ySb8B/G68hWOLCZvIq2h KpKcZuKzkhV2Aev/LpY8Xfcv7zw62ADDtgJcVN+o5GUwbwcl+2Dw2r60fMBTU8Kyccwg sI96SnQ6nmesy/HN/LBilddZdkAmYaPAsJaHHyK/T/wPs6iTrLtb0t7hhYgfSLd2ud78 69Blv7DMgmVkTPcwh1XXudxxzkp+1elT4qft5WDPAo5cKh76RjQQL/m8KEgYXnEDpwpg 3OlDX7tzCQUjzZFprdOmPfaT0XIYTJohcTmu/5qMCRJMYapkln5LPOlkGUgAMIJCS9QK cofQ== 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 k2si3691687qtf.40.2018.01.24.13.00.34; Wed, 24 Jan 2018 13:00:34 -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 AFE396176F; Wed, 24 Jan 2018 21:00:33 +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_H3, RCVD_IN_MSPIKE_WL 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 3E1D060929; Wed, 24 Jan 2018 21:00: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 7BEB3609A8; Wed, 24 Jan 2018 21:00:25 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 1D7596062E for ; Wed, 24 Jan 2018 21:00:24 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 8CF3B184F05 for ; Thu, 25 Jan 2018 00:00:22 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 717qLwFNju-0Mm4MuAx; Thu, 25 Jan 2018 00:00:22 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id cBLphPGQu0-0LWq5JWd; Thu, 25 Jan 2018 00:00:21 +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 00:00:18 +0300 Message-Id: <1516827620-4105-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516827620-4105-1-git-send-email-odpbot@yandex.ru> References: <1516827620-4105-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 410 Subject: [lng-odp] [PATCH API-NEXT v5 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: 13b0f1705d8327e73979c073c91b9b72984873fb **/ 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 Wed Jan 24 21:00:19 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: 125713 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp663819ljf; Wed, 24 Jan 2018 13:01:07 -0800 (PST) X-Google-Smtp-Source: AH8x224Z7v6ZsGIqIsg9X/kQgIM+yEGYP4Xab6GPUGVxjX+J+eD7q/7ZpyAbCwYsT6+kbHHampT0 X-Received: by 10.200.45.109 with SMTP id o42mr11652478qta.263.1516827666905; Wed, 24 Jan 2018 13:01:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516827666; cv=none; d=google.com; s=arc-20160816; b=h0WizqxQLZkreC+eln3JGpFXsDOFV4J8ix9eMqPjJ2Gab5M1m9tvN3iTOIjZUU0OQx tVZpLqt87UcGtdfRsb/6A7W9/IkNBKDj2eCvUnrZ4xoRW2zk9WwuRUaRyZOmRPBPUbL+ wKGo88wHyNAh307A2nBRkRbby1eoabWJcTMAYeuLsSMJtGmC0QN0jQ9pVXwXCSj7puQX 0OiSllDKgWl6OfhBAc2m/Qg/3xhvtoa5S8XgjeSiZ+DMR3cKZBtgasqoL5rv7JHzR4wD x1pPmswnS+f6TI7vLOdCmRWMsyZPK8CSlgD0OE4AnBYGoqEAIfKOsP3xC3shKEgWy+NZ SwZg== 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=arA5kPXbSeGSEZPLdfEKktcnx5UqbIAiHb8fWTPuCmg=; b=vRjQh+p+fsoaLOtDc5sxpRQIB4LDtU23m6SDS7aCLwxuN5K5f2VdokR6deKyX+WRXZ b4CyngmGucJ04faTo3z4+Lclgh6r12bRHZNK1luetANQAX9+cNhRqsC6vifufgdbzOxO uT5Qz+t/MYpOgYk69ko/KOWbLK9zdEJQG8+eAVrvBNCALtGyRAS1d29YUiDxk8PrYu5X mozuED7pyjLsnXBdHjZszRVXTs7tPYVkBFDSzIlGIZLf86YaRPy/G5UVxA90h8c/y17z F9/HApdIJOxl04YbYzJ05k8Mho2u6zUGz0EXTO7S5Cfl9maD2s0PEsk1HlMULip3xjdv fIyA== 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 v185si1024476qkc.465.2018.01.24.13.01.06; Wed, 24 Jan 2018 13:01:06 -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 8A92661750; Wed, 24 Jan 2018 21:01:06 +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_H3, RCVD_IN_MSPIKE_WL 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 98CCB61753; Wed, 24 Jan 2018 21:00:30 +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 A0890609A8; Wed, 24 Jan 2018 21:00:26 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id B75E560929 for ; Wed, 24 Jan 2018 21:00:24 +0000 (UTC) Received: from mxback17j.mail.yandex.net (mxback17j.mail.yandex.net [IPv6:2a02:6b8:0:1619::93]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 6836E183528 for ; Thu, 25 Jan 2018 00:00:23 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback17j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mu0N9Vyxd9-0Nh4qU2I; Thu, 25 Jan 2018 00:00:23 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id cBLphPGQu0-0MWWDo56; Thu, 25 Jan 2018 00:00:22 +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 00:00:19 +0300 Message-Id: <1516827620-4105-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516827620-4105-1-git-send-email-odpbot@yandex.ru> References: <1516827620-4105-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 410 Subject: [lng-odp] [PATCH API-NEXT v5 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: 13b0f1705d8327e73979c073c91b9b72984873fb **/ include/odp/api/abi-default/packet_io.h | 1 - platform/linux-generic/odp_packet_io.c | 73 ++++++++++++++--------------- 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, 43 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..3ad366fbb 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1699,33 +1699,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 > odp_pktin_wait_time(UINT64_MAX / 2)) + wait /= 2; + 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 +1777,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 > odp_pktin_wait_time(UINT64_MAX / 2)) + wait /= 2; + 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 Wed Jan 24 21: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: 125714 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp664530ljf; Wed, 24 Jan 2018 13:01:57 -0800 (PST) X-Google-Smtp-Source: AH8x227mdYDaSR7zGCBDPopIqsBYeI3O4BXMyA5map1uC2WTpZdldW7HecpiLGeWYIN94pBXcXSb X-Received: by 10.200.81.199 with SMTP id d7mr12204654qtn.211.1516827717174; Wed, 24 Jan 2018 13:01:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516827717; cv=none; d=google.com; s=arc-20160816; b=xFVq5IzB2NwZH+W2U9MVDMCJWpbohXcmcrsx8Gew2BIjzdELia4fyodiXSbH5gVFsZ gokmD64GjGes++AB0JT/G5aD5KfEo9Bl6P2EfxJz1Jv829F68f1kNNI6I8DomI3dakFZ 6bZcIPpMSx6vZsEIPHEGROJjIljEd3So1fy0TfoWv4rjCysDiEGYqQizgEM3hOjf1xED hyInc/QgY7Fz/PDajrl13u3RkDMsx1Vwp4QMfrvz2NelQDvmtL5Ah0Bma489l+w99Fcg q56m3Dmya7dne5cwySbBnXZemdQcO4Bd1fIWZPoVEIbCUiPKrcDbOPxwgIIv99UQIBjZ W94A== 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=XrNoNaW7Bf67CtMwirHN8ZjcdH7IKIsMAwBNKVp4mMw=; b=Oz774yE7d3dLrSWYSZWYWanbNes7CeQ1G7tPaUCbEdbol/j0LWeqBzDTRR1xkEPIKB u4hj8DA1M7ZJGcs4entWopsiIJnZT4S27zDrUIQrvPctrYNaGyFm/pzA9psIcDiypjBY zF8ANB6JDfiV+KqeqMFIj+6npQ1A/n5445Y+AiEW43rROJUVJUYyInM2A4QuYR83Yfpe QHHIAdmM2BLQEnDbJ8a/Dq/a462nLhb1RoD709ECMaTkx1labCAr79Mnp3ooHAEVeYG4 6I0FyW3LJGtGqCELM35GePlPVphHxAYF0aAgkHVciN0vqmfuNEFzHsY/ydAbO5qwJTOD pBNA== 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 j128si1063694qkf.377.2018.01.24.13.01.56; Wed, 24 Jan 2018 13:01:57 -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 B881B6176C; Wed, 24 Jan 2018 21:01:56 +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 00F7B60929; Wed, 24 Jan 2018 21:00:34 +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 DD3CE60949; Wed, 24 Jan 2018 21:00:27 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id BBC6B6062E for ; Wed, 24 Jan 2018 21:00:25 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 019984304CD6 for ; Thu, 25 Jan 2018 00:00:24 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id L01sDb7ULv-0Nt0CF3b; Thu, 25 Jan 2018 00:00:23 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id cBLphPGQu0-0NW4rbY8; Thu, 25 Jan 2018 00: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 00:00:20 +0300 Message-Id: <1516827620-4105-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516827620-4105-1-git-send-email-odpbot@yandex.ru> References: <1516827620-4105-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 410 Subject: [lng-odp] [PATCH API-NEXT v5 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: 13b0f1705d8327e73979c073c91b9b72984873fb **/ 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