From patchwork Thu Oct 19 08:00:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116340 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp206685qgn; Thu, 19 Oct 2017 01:03:00 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Rt4EMyEVsWu0PudV5perx4J9dK0NHHzpcNZhqi3ZCGXZKiTG6PjPb6A9ddc/Ca1Kc3ctP6 X-Received: by 10.36.13.210 with SMTP id 201mr1360297itx.95.1508400180335; Thu, 19 Oct 2017 01:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508400180; cv=none; d=google.com; s=arc-20160816; b=WPvOO+4VxXnztV1XZjQPb2QazOlD4ZtuCMmarl1+pwFPxDwN4G0+sNGnGmyTresaPH tIPNsDoavZZYD5L0zBVeEwEP2pBTCZGs0gHt9XjTznaEK/0F9/ZcFknR3o4salveNgWI 3XyC3BDBN/wcr5BtjcGiZFghMTBEMNoa3P62ord/vFZHXD/J/yynlfCHJLeaKEk/JidA 633RF8mybxbZ9WKVZwmoeXCs949Y9Dt5VxIAdhwUiwhsQW1ztEn5seBNI6xCiPpGMN5c wOvkqknxWOVnwFzF40Oe5A1i81x1KsszQreeOlrWI7P9r7mjtNBtcxACOStDrWL5U0Pr tPFg== 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=UjMi0mpYxiLmoQGKGRSeI+f3/ZCLFFKGM45c8b+QOac=; b=htAak71pyXDypmNpAwL2eJ/JkYPGuLtKxpJDE+Q6Gn6PqJXnAB6flJ9gSqu2vsnKBz 3AT8A1dmNkDYqRxUrTS60ZCodwxrNqJdv/mwUk319FqIboO2XiH0JKXDOr1+rjr3XKSC odq/jlukkELGPufouCi6yw0kos4gRaR3mdTqP07JZpPddyLBoyDJR0/RTA6Wkd9bXjMf Q5afEZb3jNXbnJna9+cEtKjxtXHNWQPGXOXC4CgxNpEbWVGEAWDM8XRrxJ9LBfLRFthI FCghy+EMf403tQyaZGzcpXDqtS0OqTSG0q+FAAHYMa+wNX6LCphb/mKkhYjEYiewUTuc SE+w== 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 u65si805578itg.111.2017.10.19.01.03.00; Thu, 19 Oct 2017 01:03:00 -0700 (PDT) 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 D4F3962DEB; Thu, 19 Oct 2017 08:02:59 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED 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 4C59461042; Thu, 19 Oct 2017 08:01:06 +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 4B0E1629F1; Thu, 19 Oct 2017 08:00:42 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id E419061103 for ; Thu, 19 Oct 2017 08:00:19 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 6390734C307E for ; Thu, 19 Oct 2017 11:00:17 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id D51wc4eYAd-0HNePnqu; Thu, 19 Oct 2017 11:00:17 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id OmTGLJNgIE-0GcWFPRq; Thu, 19 Oct 2017 11:00:16 +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, 19 Oct 2017 11:00:11 +0300 Message-Id: <1508400012-1278-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508400012-1278-1-git-send-email-odpbot@yandex.ru> References: <1508400012-1278-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 232 Subject: [lng-odp] [PATCH API-NEXT v2 2/3] linux-gen: pktio: tap: implement link status operation 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: Bogdan Pricope Implement link status tap pktio operation. Signed-off-by: Bogdan Pricope --- /** Email created from pull request 232 (bogdanPricope:tap_set_mac_pr) ** https://github.com/Linaro/odp/pull/232 ** Patch: https://github.com/Linaro/odp/pull/232.patch ** Base sha: edca8cd1e55898826f79383b689c2c4bd2c28b3a ** Merge commit sha: 89f18d929052add128b4252f5b17907b9a354ccb **/ platform/linux-generic/pktio/tap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c index 8ddd757d9..2fda0b814 100644 --- a/platform/linux-generic/pktio/tap.c +++ b/platform/linux-generic/pktio/tap.c @@ -406,6 +406,12 @@ static int tap_mac_addr_get(pktio_entry_t *pktio_entry, void *mac_addr) return ETH_ALEN; } +static int tap_link_status(pktio_entry_t *pktio_entry) +{ + return link_status_fd(pktio_entry->s.pkt_tap.skfd, + pktio_entry->s.name + 4); +} + static int tap_capability(pktio_entry_t *pktio_entry ODP_UNUSED, odp_pktio_capability_t *capa) { @@ -438,6 +444,7 @@ const pktio_if_ops_t tap_pktio_ops = { .promisc_mode_get = tap_promisc_mode_get, .mac_get = tap_mac_addr_get, .mac_set = NULL, + .link_status = tap_link_status, .capability = tap_capability, .pktin_ts_res = NULL, .pktin_ts_from_ns = NULL,