From patchwork Fri Oct 30 18:38:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 55843 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp21719lbr; Fri, 30 Oct 2015 11:38:30 -0700 (PDT) X-Received: by 10.50.124.98 with SMTP id mh2mr3891468igb.25.1446230310073; Fri, 30 Oct 2015 11:38:30 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l103si8763308iod.154.2015.10.30.11.38.28; Fri, 30 Oct 2015 11:38:30 -0700 (PDT) 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 93DE362C5D; Fri, 30 Oct 2015 18:38:28 +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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 388A761988; Fri, 30 Oct 2015 18:38:24 +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 D1EF461A3C; Fri, 30 Oct 2015 18:38:21 +0000 (UTC) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by lists.linaro.org (Postfix) with ESMTPS id 9D784617FC for ; Fri, 30 Oct 2015 18:38:20 +0000 (UTC) Received: by wmff134 with SMTP id f134so18207356wmf.1 for ; Fri, 30 Oct 2015 11:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=OCFsi5F9BJz1BTdNgV87hBqoBrseVBPK09eUxB+PME8=; b=BNLvUAqxbbEgTLiL4QggdIjqUrkxi5QBKGr1uLo484QHzP9YgviQmN1RnA6XiyNaWl M1POXqfZs/8BcUldRpxPp79W8czArGI+TGUdXzZDA1ejwszTcw79LlJ20VksV97rhamF 7T2WGLP8/JPxR94T7pgvsVMGNLJ622UKVM2yGkF+IphhLwgU8z9vg+NWV1RnW6aVs2YZ 52of+XTFvy857gIUwb1RNEpixitkPuwzNkUgChEIiqD6e7+4QRnJozNhOmCvBFcDj+xn BrwsttRioyzfvr5kfJ9LX2zOGXrf2pa+quwG5kD2GhVzj7CG1oa5OoUCClUmkhjtdRDQ rhHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=OCFsi5F9BJz1BTdNgV87hBqoBrseVBPK09eUxB+PME8=; b=QeIXK2dNg8y/sywYkrSEJMXuCq2UeflmoZWNHypvDOC/e5KpAW+RU4Rlclp/B0xegN v14+BsDWF9Uae/IrJEtmawMvQpDyDOK7SJZVSPRgwCV2r0l30mIcYKjgsCIbRzHH5zuy gK6h7ZGsvFn3LLdmuKUdPxww0D1tBDUfZHW4RtyhspYwp/yUrh1aayCXc0hWQOKAYlpy eymdQkTF9lsW2VdV1exbL63l6VjL1oVW7av23vWpBDr8oTXhyMAaZZZmFrYDFYi1dqBo 7Roz5FWi1cAIsOYsCLF6/sn2m4jxeimYzzBeI9/UI43j74EUBqRBAOdy0KuY/7LDOxqC +oNw== X-Gm-Message-State: ALoCoQlonNzaIK+xoiyGvLnc3Qzny1V4IxAZlAZmroQPSkH2b5HgKeNtrf/eoDQGqyNPBYbrpVLL X-Received: by 10.28.212.70 with SMTP id l67mr5415925wmg.66.1446230299619; Fri, 30 Oct 2015 11:38:19 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id e79sm4144492wmd.16.2015.10.30.11.38.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Oct 2015 11:38:19 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 30 Oct 2015 18:38:14 +0000 Message-Id: <1446230294-10534-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] 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 diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 4745bd5..4432cfc 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -94,6 +94,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 1246bff..a4b1533 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; } } diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index 0d8dadd..8efa611 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -109,6 +109,7 @@ static int loopback_promisc_mode_get(pktio_entry_t *pktio_entry) } const pktio_if_ops_t loopback_pktio_ops = { + .name = "loopback", .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 7e30027..66fd9ca 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -463,6 +463,7 @@ static int sock_promisc_mode_get(pktio_entry_t *pktio_entry) } const pktio_if_ops_t sock_mmsg_pktio_ops = { + .name = "sock_mmsg", .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 35d24c6..cdf221e 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -516,6 +516,7 @@ static int sock_mmap_promisc_mode_get(pktio_entry_t *pktio_entry) } const pktio_if_ops_t sock_mmap_pktio_ops = { + .name = "sock_mmap", .init = NULL, .term = NULL, .open = sock_mmap_open,