From patchwork Mon Nov 24 11:54:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 41403 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 697D424524 for ; Mon, 24 Nov 2014 11:54:34 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id u10sf3035758lbd.2 for ; Mon, 24 Nov 2014 03:54:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Pn7HH5kNdUM5Ne7YZhwTgNROyXrUqgAmHDQfPsL7clo=; b=Qs8y5nBnYVvWFc6a26gyQhArQSb7pSdxrOibx220j4rDDH6RwEO8XGldZaoCqDPW0B ue6s3FpXV6O69GbPyEJGRw4VwpYQiUmcGVcK2HOXS563jEZzsZAfFwBzQWen/+cVxVlx V6AATUPUhw993QIGHY6/rt4dKhrmgb/K734+FfR8Avxog7s1fATvK+eNK4b2LD/nxDu/ IOLIqs9xiF4YtWpqVqEUQ4+XNtqtzf2LajJNPenT9dCFjAWELYQhu8kZRiMHkYmDlizo aAJBuL5CDFGnK7tTx7JKMZ7OOBmXUVCrxfcCV6nHQKkYorcipP0M2pfdG1zklIyENQ1P jTUw== X-Gm-Message-State: ALoCoQlg71Pb+511zbznIz135xq4WTdVJH7kP48BP3g5TNstY4gSmbCgM6Ro89zpZH3u1dw0//yf X-Received: by 10.180.101.170 with SMTP id fh10mr3960090wib.4.1416830073358; Mon, 24 Nov 2014 03:54:33 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.102 with SMTP id ln6ls399998lac.95.gmail; Mon, 24 Nov 2014 03:54:33 -0800 (PST) X-Received: by 10.112.17.1 with SMTP id k1mr19631640lbd.39.1416830073198; Mon, 24 Nov 2014 03:54:33 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id df8si14448980lac.23.2014.11.24.03.54.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Nov 2014 03:54:33 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so7285137lbi.15 for ; Mon, 24 Nov 2014 03:54:33 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr19591645lbr.74.1416830073123; Mon, 24 Nov 2014 03:54:33 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp238351lbc; Mon, 24 Nov 2014 03:54:32 -0800 (PST) X-Received: by 10.224.12.145 with SMTP id x17mr29156722qax.23.1416830071853; Mon, 24 Nov 2014 03:54:31 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 7si15240876qap.65.2014.11.24.03.54.30 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 24 Nov 2014 03:54:31 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XssDt-0003lQ-09; Mon, 24 Nov 2014 11:54:29 +0000 Received: from mail-la0-f45.google.com ([209.85.215.45]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XssDm-0003lL-Et for lng-odp@lists.linaro.org; Mon, 24 Nov 2014 11:54:22 +0000 Received: by mail-la0-f45.google.com with SMTP id gq15so7513810lab.18 for ; Mon, 24 Nov 2014 03:54:16 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr19590460lbr.74.1416830056479; Mon, 24 Nov 2014 03:54:16 -0800 (PST) Received: from localhost.localdomain (ppp91-76-163-205.pppoe.mtu-net.ru. [91.76.163.205]) by mx.google.com with ESMTPSA id b4sm3491946lbp.17.2014.11.24.03.54.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Nov 2014 03:54:15 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 24 Nov 2014 14:54:09 +0300 Message-Id: <1416830049-21773-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCH] pktio: implement odp_pktio_get_name X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Maxim Uvarov --- platform/linux-generic/include/api/odp_packet_io.h | 10 ++++++++++ platform/linux-generic/odp_packet_io.c | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h index 667395c..b3b7ea6 100644 --- a/platform/linux-generic/include/api/odp_packet_io.h +++ b/platform/linux-generic/include/api/odp_packet_io.h @@ -148,6 +148,16 @@ int odp_pktio_set_mtu(odp_pktio_t id, int mtu); */ int odp_pktio_mtu(odp_pktio_t id); +/* + * Return the interface name from a pktio handle. This is the + * name that was passed to the odp_pktio_open() call. + * + * @param[in] id ODP Packet IO handle. + * + * @return pointer to the iface name or NULL. + */ +const char *odp_pktio_get_name(odp_pktio_t id); + /** * @} */ diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index c523350..9ceb989 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -542,3 +542,14 @@ int odp_pktio_mtu(odp_pktio_t id) return ifr.ifr_mtu; } + +const char *odp_pktio_get_name(odp_pktio_t id) +{ + pktio_entry_t *entry; + + entry = get_entry(id); + if (entry == NULL) + return NULL; + + return entry->s.name; +}