From patchwork Wed Nov 11 17:51:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 56389 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1494820lbb; Wed, 11 Nov 2015 09:51:37 -0800 (PST) X-Received: by 10.50.107.3 with SMTP id gy3mr10415886igb.48.1447264294961; Wed, 11 Nov 2015 09:51:34 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 21si12635956iod.72.2015.11.11.09.51.34; Wed, 11 Nov 2015 09:51:34 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id 10C6F61FBB; Wed, 11 Nov 2015 17:51:34 +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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 C3BA561E84; Wed, 11 Nov 2015 17:51:29 +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 E4BCB61D3B; Wed, 11 Nov 2015 17:51:27 +0000 (UTC) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by lists.linaro.org (Postfix) with ESMTPS id 425AA61D3B for ; Wed, 11 Nov 2015 17:51:26 +0000 (UTC) Received: by wmec201 with SMTP id c201so193063433wme.0 for ; Wed, 11 Nov 2015 09:51:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=hePQbmN5DQDcqOvDJFk4gzu4tMT4b/dmpa7BD4xVxTU=; b=Jsja/yv6Ke17g2D9ZmO/eyiuSH7PWyycmW1Di3F3L+iJ5wepBBJs8L/39S/wfMvoVe 1rKVYPRXMUpfnIFlcRWpK3VsfHUAcuJCeG/JYuK7YmuSw31KPBp5OVpZnK3WYLbnt8kS Ff6zICdwH6/ab6sUb4s0sCtuShJx3cboarNQ459+8VyBKuWxZ/5oTe6tXIKf5uQspOoC i7lRz9Xtzav6GZPygxULzCDUbFyIQwm1A2tDTyJpuCD7t7uwPzf/qGZuypGimvqfk8IK KW1kWqIVKXgDcfmaKAn6CAvnlKO2LyRAocm3teo+b9zYCk57UnP2mpVLsllPL3oIHl18 kAEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hePQbmN5DQDcqOvDJFk4gzu4tMT4b/dmpa7BD4xVxTU=; b=VO5BQ80YP8hOmLgl4ECr73FSeSLCmkHuSLtJi5fyOM7o+mtYbyiQVQY/QJy2QVJd+F mnpVwdq2EVd0v92JXsP/YQ8H/0BFpr7zoVoGHUOESaHl62i5iq0sg3Jr79cCOg/uceXP UP7WfdqYJHbojd/7YiP0aI+aJrTGFLJQDYghlMwMjOryBNRHNMOB9bj1aotHn3PxKb+v eylVtqmoiZcVFYty+QnLACZGy0cKBa8H8RcE/PoRfmPn/hVJhA6W4EVCVVMchgIzf3Fo c+iqWtsup4EbALLUlFPzgQGr2DUoVUXUEFlsiz0gKyDrGgO2SSnsK6/40t94HWbICpWU WDjA== X-Gm-Message-State: ALoCoQlCStxTlzJF2fpm2RCG9vCd75sF0yp1mW7SsKVphhblq/i8QKCg4wNsdTm+/816Wb9IE24o X-Received: by 10.28.19.78 with SMTP id 75mr13354714wmt.101.1447264285400; Wed, 11 Nov 2015 09:51:25 -0800 (PST) Received: from localhost.localdomain ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id l186sm26369382wmg.19.2015.11.11.09.51.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Nov 2015 09:51:24 -0800 (PST) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Wed, 11 Nov 2015 17:51:18 +0000 Message-Id: <1447264278-3536-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH v2] linux-generic: pktio: print out the name of pktio used 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" For debug purposes, otherwise it's not trivial to figure out which pktio was successful. Signed-off-by: Zoltan Kiss --- v2: - change the string for loopback and socket interfaces - also add it to odp_pktio_print() diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 1a1118c..a46c6fe 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -100,6 +100,7 @@ typedef struct { } pktio_table_t; typedef struct pktio_if_ops { + const char *name; int (*init)(void); int (*term)(void); int (*open)(odp_pktio_t pktio, pktio_entry_t *pktio_entry, diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 3ef400f..e542af3 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -229,6 +229,8 @@ static odp_pktio_t setup_pktio_entry(const char *dev, odp_pool_t pool, if (!ret) { pktio_entry->s.ops = pktio_if_ops[pktio_if]; + ODP_ERR("%s uses %s\n", + dev, pktio_if_ops[pktio_if]->name); break; } } @@ -845,6 +847,8 @@ void odp_pktio_print(odp_pktio_t id) len += snprintf(&str[len], n - len, " name %s\n", entry->s.name); len += snprintf(&str[len], n - len, + " type %s\n", entry->s.ops->name); + len += snprintf(&str[len], n - len, " state %s\n", entry->s.state == STATE_START ? "start" : (entry->s.state == STATE_STOP ? "stop" : "unknown")); diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index ce19add..44da917 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -108,6 +108,7 @@ static int loopback_promisc_mode_get(pktio_entry_t *pktio_entry) } const pktio_if_ops_t loopback_pktio_ops = { + .name = "loop", .init = NULL, .term = NULL, .open = loopback_open, diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 794c82e..bc4ab1c 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -307,6 +307,7 @@ static int netmap_promisc_mode_get(pktio_entry_t *pktio_entry) } const pktio_if_ops_t netmap_pktio_ops = { + .name = "netmap", .init = NULL, .term = NULL, .open = netmap_open, diff --git a/platform/linux-generic/pktio/pcap.c b/platform/linux-generic/pktio/pcap.c index 0817bf5..94b506d 100644 --- a/platform/linux-generic/pktio/pcap.c +++ b/platform/linux-generic/pktio/pcap.c @@ -370,6 +370,7 @@ static int pcapif_promisc_mode_get(pktio_entry_t *pktio_entry) } const pktio_if_ops_t pcap_pktio_ops = { + .name = "pcap", .open = pcapif_init, .close = pcapif_close, .recv = pcapif_recv_pkt, diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 5f5e0ae..56b0a8b 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -468,6 +468,7 @@ static int sock_promisc_mode_get(pktio_entry_t *pktio_entry) } const pktio_if_ops_t sock_mmsg_pktio_ops = { + .name = "socket", .init = NULL, .term = NULL, .open = sock_mmsg_open, diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index 79ff82d..3a51179 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -519,6 +519,7 @@ static int sock_mmap_promisc_mode_get(pktio_entry_t *pktio_entry) } const pktio_if_ops_t sock_mmap_pktio_ops = { + .name = "socket_mmap", .init = NULL, .term = NULL, .open = sock_mmap_open,