From patchwork Mon Oct 16 12:00:06 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: 115906 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3600216qgn; Mon, 16 Oct 2017 05:04:30 -0700 (PDT) X-Google-Smtp-Source: AOwi7QC0THLgZBgyomAmXgM93csILyTpf3Hg/Gyl78yB1yrcJmjCtGvVgNF2aNqG8bxCYfj0Obku X-Received: by 10.55.75.15 with SMTP id y15mr12145007qka.321.1508155470085; Mon, 16 Oct 2017 05:04:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508155470; cv=none; d=google.com; s=arc-20160816; b=i6Q1GmVULh4UQIWcIAb5MdBZVSquKBCYSpcFi2Co4kU3CS7KSYJMbvkGGFXPpJU02E D4+kcT807LR+M4dhNi5BS/INWBN5zY9uupKZEPWibOi14z/wCJjNN+vrIzMajXwBkmqr RTUoev+e+wL+jYTSasrXaudoWX5nUsBeBu0MZcPB0oowjG7MTSO91OBheNniy8C6KPmH MhvGOVvu8874OsdTI8OrZCDlab20Yi29KgVzK+j89zy3I1iIQvpBxbcaS/jb4fIVHLce ijD0DYi/XUxnxDokxMkPFw7gxzHvYj4Q3+oV2FH4u8BE1YVqlMhKDrcUF6gcBZIlicRA 1fOg== 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=CypDXDar0G6ojw8M7+BngNHe/2yMS+9UVlCLRw6DacY=; b=kKEmG7/ryUl60/kqP48eXqGBxqqdRFaU3+gaK6rmWyGPWUtcfe9738ow2slnCFr45U kQPY4THa6Wu9LXXzb5Tepw2p/eQOGWf0v2wYDhbEcWGqRvHr+UD8Pl+UZFRTt3HacZKR bcBcJpoZWl3Svj0aJhqK2Km2PXdLO+ekiecU8Lf05FOx1X0NZNk3jgf1khjaD/yvwmOb M01AkpP31I85Wk1R2UxtMhdMwn5PKOHWrfgGte26k9QpQ1Gbn5oBgatVSv/xCynNtfN2 fcUrQBDVa6zrMDs8uE0NV903rojlA6CfSuRvPr2BafFUiUYouhfAi2tmQxfKtbiyIuEe K5rw== 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 q203si6060742qke.319.2017.10.16.05.04.29; Mon, 16 Oct 2017 05:04:30 -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 B492860B50; Mon, 16 Oct 2017 12:04:29 +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,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 59BC360AC8; Mon, 16 Oct 2017 12:02:40 +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 D8E89609DB; Mon, 16 Oct 2017 12:02:13 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 3FE0260A4F for ; Mon, 16 Oct 2017 12:00:16 +0000 (UTC) Received: from mxback8g.mail.yandex.net (mxback8g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:169]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 68B62218214C for ; Mon, 16 Oct 2017 15:00:14 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback8g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id waW2mH0ntd-0Er0iCRA; Mon, 16 Oct 2017 15:00:14 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id KcD5G1a8yg-0D18xsJl; Mon, 16 Oct 2017 15:00:14 +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: Mon, 16 Oct 2017 15:00:06 +0300 Message-Id: <1508155207-5041-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508155207-5041-1-git-send-email-odpbot@yandex.ru> References: <1508155207-5041-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 232 Subject: [lng-odp] [PATCH API-NEXT v1 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: afeda4d14bb6f449cb269680cdbd56b26726eedf ** Merge commit sha: 8726d6c7a814c3380aacd18250194eae85ababb3 **/ 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,