From patchwork Mon Nov 16 17:37:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 56665 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1451853lbb; Mon, 16 Nov 2015 09:37:44 -0800 (PST) X-Received: by 10.140.226.8 with SMTP id w8mr39279054qhb.83.1447695464611; Mon, 16 Nov 2015 09:37:44 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e66si26784736qge.100.2015.11.16.09.37.43; Mon, 16 Nov 2015 09:37:44 -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 9902A6195F; Mon, 16 Nov 2015 17:37:43 +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 3B67261945; Mon, 16 Nov 2015 17:37:38 +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 0E58F61946; Mon, 16 Nov 2015 17:37:37 +0000 (UTC) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by lists.linaro.org (Postfix) with ESMTPS id DD1FF61941 for ; Mon, 16 Nov 2015 17:37:35 +0000 (UTC) Received: by wmdw130 with SMTP id w130so121530764wmd.0 for ; Mon, 16 Nov 2015 09:37:35 -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=k87Aw6V5c5f05uPdaMKmVPLvHhWes6DxFZ3kCyp0XkQ=; b=dYX3vqkn/v2Babp/hh9JzfMEpyelDuJY2W3qJbic4mzfirHuRAf1xM59MKgRcmzlUo ArDyvWK5KAHrZtajHjOlj24kWQZnJazK1U4d5VrhmO9VC89ds3KEEPqJXOuVc9Tc+NMZ bntetIXMSEV21Gh0ZoCFRhsDjBszVnWvipGP+YqBHF60Y4bUMkRHAxYfon/GCDAV1fo+ 7NWAgXuGC83pkTWpuKqxNVbPLrMSRvfC/aG//f2zbJCiwSI5L18FC/T2ANLqSEdB7hC5 beLSm0cp0hKvpGlsbzh5ylSdwsRcKejt4+l9CWTEcnV1A0Bl/uW6AS85Xbi8JbC5cC40 YBbg== 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=k87Aw6V5c5f05uPdaMKmVPLvHhWes6DxFZ3kCyp0XkQ=; b=an1ZOuPXFipASpE8nTPvKW5XtBAUb+kppHVoTjesp9r3v8ck2ypfICFkDccqFnczSk uRjnOQ75f9rw7zS+fLZTz6/37dX1dDpXv32nx/90wU/21VIGBvlA7rYcizp2uEWr5jnz oU+sUP5qePeYr0tTXO6Y+EZeVWbQqZFeFBKgLHIt564O6ygHrQlwLWndP4xRTAT2m3Mj 5lZghWLaKq65KKmv8FTtWtTtTJxf3D8iHON5pudwvnIsGLdsqiNs4y39M5RdgSXeK8T9 ohDgK8IftLaMFL0VYAw8CoZt1ZQHo6UU2v1M9BODvqR7cp8bO4wW2cdrxaUw2jSg30Uf CGYg== X-Gm-Message-State: ALoCoQn3QDByJgOZ5/nuGZxnMtPp6FDA46WPy4AukOK1zusq5Abuxy74QZmhZ4Cgo9l1nkc8n+Q2 X-Received: by 10.194.205.162 with SMTP id lh2mr36998501wjc.61.1447695455122; Mon, 16 Nov 2015 09:37:35 -0800 (PST) Received: from localhost.localdomain ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id bk7sm35570192wjb.25.2015.11.16.09.37.34 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Nov 2015 09:37:34 -0800 (PST) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Mon, 16 Nov 2015 17:37:07 +0000 Message-Id: <1447695427-12391-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH v3] 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 Reviewed-by: Stuart Haslam --- v2: - change the string for loopback and socket interfaces - also add it to odp_pktio_print() v3: change back ODP_ERR to ODP_DBG 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..402e64d 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_DBG("%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,