From patchwork Tue Jan 13 11:27:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42991 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9DBF020DE8 for ; Tue, 13 Jan 2015 11:28:11 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id k14sf1369350wgh.2 for ; Tue, 13 Jan 2015 03:28:10 -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=p6SLqCvr5nl4dii8TtJ69hk8YhcExvfy163Hds+b3cs=; b=kaLEVPB7+VuophSYPjUcQ5/lbLpFz3COg9WTfYULzwczB0D6gt/k9PjpDFx1dh/A0q 1GKTTjIrSX/0d4cVA6XQt2ZXIOQ8bYTYZb14tou36gTSPoWQplUUpExyfSU6Dp7BpBMO l+Eydq5yw5FXtCMjJjS13vUt6OekUmzEP6Uk5hk+5+HcAa3gdmeiZ7fYBfEKL4hx4nA8 bSs0+aMODZlblOLEdpAfjxUzlxs8e01CDltrGUiwlY7VDjHu7gIDIPYbmu6hpLa1yobZ qMbnLc48Um064RMgxBW7X8fUDRm9GtQiN+ivC5MQPn843ypqhYLSJowI5AwlMJeSIrop zaPg== X-Gm-Message-State: ALoCoQkPzrlQc1eEzPiKmspQpphJi7rr6CiXjfznv49tLTnnFYP3EmZeIKl/TtutDoGOprxMYIYh X-Received: by 10.152.7.99 with SMTP id i3mr205425laa.9.1421148490868; Tue, 13 Jan 2015 03:28:10 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.132 with SMTP id ue4ls586071lac.58.gmail; Tue, 13 Jan 2015 03:28:10 -0800 (PST) X-Received: by 10.112.135.99 with SMTP id pr3mr41814076lbb.61.1421148490527; Tue, 13 Jan 2015 03:28:10 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id qz8si11339310lbc.116.2015.01.13.03.28.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 03:28:10 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id u10so1992763lbd.13 for ; Tue, 13 Jan 2015 03:28:10 -0800 (PST) X-Received: by 10.152.18.135 with SMTP id w7mr40686791lad.47.1421148490413; Tue, 13 Jan 2015 03:28:10 -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.9.200 with SMTP id c8csp1351728lbb; Tue, 13 Jan 2015 03:28:09 -0800 (PST) X-Received: by 10.224.166.71 with SMTP id l7mr34286993qay.50.1421148489210; Tue, 13 Jan 2015 03:28:09 -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 5si26391051qao.63.2015.01.13.03.28.08 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 13 Jan 2015 03:28:09 -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 1YAzdl-0003Il-Vt; Tue, 13 Jan 2015 11:28:06 +0000 Received: from mail-la0-f54.google.com ([209.85.215.54]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YAzdg-0003Ig-LS for lng-odp@lists.linaro.org; Tue, 13 Jan 2015 11:28:00 +0000 Received: by mail-la0-f54.google.com with SMTP id pv20so2033933lab.13 for ; Tue, 13 Jan 2015 03:27:55 -0800 (PST) X-Received: by 10.152.27.8 with SMTP id p8mr42127826lag.69.1421148474997; Tue, 13 Jan 2015 03:27:54 -0800 (PST) Received: from localhost.localdomain (broadband-46-188-125-104.2com.net. [46.188.125.104]) by mx.google.com with ESMTPSA id px2sm4901269lbb.27.2015.01.13.03.27.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 03:27:54 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 13 Jan 2015 14:27:48 +0300 Message-Id: <1421148468-6446-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] api: implement odp_pktio_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.182 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 | 11 +++++++++++ platform/linux-generic/odp_packet_io.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h index 0c34f29..7c4c19d 100644 --- a/platform/linux-generic/include/api/odp_packet_io.h +++ b/platform/linux-generic/include/api/odp_packet_io.h @@ -168,6 +168,17 @@ int odp_pktio_promisc_mode(odp_pktio_t id); size_t odp_pktio_mac_addr(odp_pktio_t id, void *mac_addr, size_t addr_size); +/* + * Return the interface name from a pktio handle. This is the + * name that was passed to the odp_pktio_open() call. + * + * @param id ODP Packet IO handle. + * + * @retval Pointer to the interface name. + * @retval NULL if packet handle is invalid. + */ +const char *odp_pktio_name(odp_pktio_t id); + /** * @} */ diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index cd109d2..7b08edf 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -746,3 +746,14 @@ size_t odp_pktio_mac_addr(odp_pktio_t id, void *mac_addr, return ETH_ALEN; } + +const char *odp_pktio_name(odp_pktio_t id) +{ + pktio_entry_t *entry; + + entry = get_pktio_entry(id); + if (entry == NULL) + return NULL; + + return entry->s.name; +}