From patchwork Tue Jan 13 13:17:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42993 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 071AE26CFB for ; Tue, 13 Jan 2015 13:17:47 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf1886447eek.1 for ; Tue, 13 Jan 2015 05:17:46 -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=2E3k/l/16+436mMzoo+67XT7oxDvDZ15YcBMA6K08xQ=; b=Prdi3BC7JY25NQbpM4C0bm/N6jzDgXdWdlAxEalW6o+rOmZb8AMrcWzcZKcyTv8cjx y+DyPJHJTc46HpKGpNksPzh2LIJ+FCn1FJpzt5lvfgsNfd4BDLt0MswErgkXZHgtUS7u KraR1gJUKCyW3fWnucbabEaw2p8w3f1NTJ3Ko1fK4JENIi6qXnjaeJzB+mzR7k+moBaR uvniNoMerzzR90V2ytL3v+h8uov6Y06PekXVmyXLdL9bRa7sO6YARoD0G671fEQFAzdR dWLY+aTaeGdVPOExgiFMR0CLFEInk8QXgDR/pzlJ06J0Rw6WMpOW0xfOAZhq/LPb/6O6 5J7Q== X-Gm-Message-State: ALoCoQki9qTDqkYaOeRRWE0Cgc7oUNmwk10S0YKTsPpOaaE9gT+8Ixg1GZBP/SrNOwrSo+ZnDo+3 X-Received: by 10.152.8.67 with SMTP id p3mr364347laa.4.1421155066134; Tue, 13 Jan 2015 05:17:46 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.34 with SMTP id cr2ls777527lad.30.gmail; Tue, 13 Jan 2015 05:17:45 -0800 (PST) X-Received: by 10.112.84.225 with SMTP id c1mr41985779lbz.22.1421155065911; Tue, 13 Jan 2015 05:17:45 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id un3si24288313lbb.21.2015.01.13.05.17.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 05:17:45 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id pn19so2505803lab.9 for ; Tue, 13 Jan 2015 05:17:45 -0800 (PST) X-Received: by 10.112.98.99 with SMTP id eh3mr41756405lbb.32.1421155065815; Tue, 13 Jan 2015 05:17:45 -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 c8csp1379902lbb; Tue, 13 Jan 2015 05:17:45 -0800 (PST) X-Received: by 10.224.165.84 with SMTP id h20mr5939953qay.73.1421155064379; Tue, 13 Jan 2015 05:17:44 -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 o11si26656164qga.118.2015.01.13.05.17.43 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 13 Jan 2015 05:17:44 -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 1YB1Lo-0000Ay-Tk; Tue, 13 Jan 2015 13:17:40 +0000 Received: from mail-lb0-f179.google.com ([209.85.217.179]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YB1Lj-00009r-W1 for lng-odp@lists.linaro.org; Tue, 13 Jan 2015 13:17:36 +0000 Received: by mail-lb0-f179.google.com with SMTP id z11so2471267lbi.10 for ; Tue, 13 Jan 2015 05:17:30 -0800 (PST) X-Received: by 10.152.36.100 with SMTP id p4mr42178240laj.11.1421155050288; Tue, 13 Jan 2015 05:17:30 -0800 (PST) Received: from localhost.localdomain (broadband-46-188-125-104.2com.net. [46.188.125.104]) by mx.google.com with ESMTPSA id r3sm834596lal.37.2015.01.13.05.17.28 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 05:17:29 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 13 Jan 2015 16:17:23 +0300 Message-Id: <1421155043-7257-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] [PATCHv2] 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.215.50 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 --- v2: fix doxygen header platform/linux-generic/include/api/odp_packet_io.h | 13 +++++++++++++ platform/linux-generic/odp_packet_io.c | 11 +++++++++++ 2 files changed, 24 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..c0ced4f 100644 --- a/platform/linux-generic/include/api/odp_packet_io.h +++ b/platform/linux-generic/include/api/odp_packet_io.h @@ -169,6 +169,19 @@ size_t odp_pktio_mac_addr(odp_pktio_t id, void *mac_addr, size_t addr_size); /** + * Packet IO interface name + * + * 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; +}