From patchwork Wed Oct 1 13:45:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Barbu X-Patchwork-Id: 38238 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4889B20549 for ; Wed, 1 Oct 2014 13:46:14 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id d1sf838063wiv.2 for ; Wed, 01 Oct 2014 06:46:13 -0700 (PDT) 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:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=PlVM1Fqg8qi9WiOdd2QiTslYmKu/YC4Eim/2nXtee18=; b=WTrG+cF3c1MW30jxbSM7pGv76xOmhjb0gm4Gd+ew/QDEd7nXzKmbDPHma5ecqZCpOX BPyw9K40q5wrX+kLU5kskZonWMqfuH8kUBR1PljZKu3+Ahh0Jebzwfu2PcBf7DuQPWSB gkpq9F80I9su02+qhTU9XfOJXoQlLGLZJeA9cHYiqcH4HvTL+7Qm3bd7d1Dm5ynyRgCl feYMB2ON9Ptth5bBa6Czys1rDAdMc0KF57UIksE9zqHwTO1DkzWqcgion5LKJbDHBgs0 Bg3J5bruBRgoWvCZv89fKEEFj9C7dOlLoxtmf/K3xVIzD8cyEEyBZ/2gqwqnHGZrZbfW 3BNw== X-Gm-Message-State: ALoCoQl6hQjxCJodrRK79iCn4gvSowFAaq/ZgCDakNqYwchTm79Y4zTwqebSpMcXThdTY1SkA/nn X-Received: by 10.180.188.145 with SMTP id ga17mr2177018wic.3.1412171173434; Wed, 01 Oct 2014 06:46:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.173 with SMTP id j13ls163769lab.82.gmail; Wed, 01 Oct 2014 06:46:13 -0700 (PDT) X-Received: by 10.152.9.37 with SMTP id w5mr55299614laa.28.1412171173173; Wed, 01 Oct 2014 06:46:13 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by mx.google.com with ESMTPS id r1si1775078lar.58.2014.10.01.06.46.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 06:46:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id gi9so387753lab.5 for ; Wed, 01 Oct 2014 06:46:13 -0700 (PDT) X-Received: by 10.112.62.200 with SMTP id a8mr51723194lbs.34.1412171172905; Wed, 01 Oct 2014 06:46:12 -0700 (PDT) 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.130.169 with SMTP id of9csp532242lbb; Wed, 1 Oct 2014 06:46:12 -0700 (PDT) X-Received: by 10.140.28.8 with SMTP id 8mr87453171qgy.19.1412171171483; Wed, 01 Oct 2014 06:46:11 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id g3si1715842qge.36.2014.10.01.06.46.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Oct 2014 06:46:11 -0700 (PDT) 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 1XZKEM-0003aH-1i; Wed, 01 Oct 2014 13:46:10 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XZKE7-0003Zc-4Q for lng-odp@lists.linaro.org; Wed, 01 Oct 2014 13:45:55 +0000 Received: by mail-la0-f43.google.com with SMTP id mc6so364411lab.30 for ; Wed, 01 Oct 2014 06:45:49 -0700 (PDT) X-Received: by 10.152.202.135 with SMTP id ki7mr50406568lac.16.1412171148881; Wed, 01 Oct 2014 06:45:48 -0700 (PDT) Received: from cipriantemp.enea.se (sestofw01.enea.se. [192.36.1.252]) by mx.google.com with ESMTPSA id d5sm431398lae.11.2014.10.01.06.45.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 06:45:48 -0700 (PDT) From: Ciprian Barbu To: lng-odp@lists.linaro.org Date: Wed, 1 Oct 2014 16:45:31 +0300 Message-Id: <1412171131-27410-3-git-send-email-ciprian.barbu@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1412171131-27410-1-git-send-email-ciprian.barbu@linaro.org> References: <1412171131-27410-1-git-send-email-ciprian.barbu@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/2] Removed unnecessary pktio type include files 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: ciprian.barbu@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.46 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: Ciprian Barbu --- platform/linux-generic/Makefile.am | 4 +- platform/linux-generic/include/api/odp_packet_io.h | 2 - .../linux-generic/include/api/odp_pktio_netmap.h | 39 --------------- .../linux-generic/include/api/odp_pktio_socket.h | 34 ------------- .../linux-generic/include/api/odp_pktio_types.h | 55 ---------------------- .../linux-generic/include/odp_packet_io_internal.h | 11 ++++- platform/linux-generic/include/odp_packet_socket.h | 1 + platform/linux-generic/odp_packet_io.c | 21 +++------ platform/linux-generic/odp_packet_socket.c | 1 + 9 files changed, 19 insertions(+), 149 deletions(-) delete mode 100644 platform/linux-generic/include/api/odp_pktio_netmap.h delete mode 100644 platform/linux-generic/include/api/odp_pktio_socket.h delete mode 100644 platform/linux-generic/include/api/odp_pktio_types.h diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 5b3c879..d076d50 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -35,9 +35,7 @@ include_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/api/odp_ticketlock.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_time.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_timer.h \ - $(top_srcdir)/platform/linux-generic/include/api/odp_version.h \ - $(top_srcdir)/platform/linux-generic/include/api/odp_pktio_types.h \ - $(top_srcdir)/platform/linux-generic/include/api/odp_pktio_socket.h + $(top_srcdir)/platform/linux-generic/include/api/odp_version.h subdirheadersdir = $(includedir)/helper subdirheaders_HEADERS = \ diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h index 9f9e754..29fd105 100644 --- a/platform/linux-generic/include/api/odp_packet_io.h +++ b/platform/linux-generic/include/api/odp_packet_io.h @@ -23,8 +23,6 @@ extern "C" { #include #include -#include - /** ODP packet IO handle */ typedef uint32_t odp_pktio_t; diff --git a/platform/linux-generic/include/api/odp_pktio_netmap.h b/platform/linux-generic/include/api/odp_pktio_netmap.h deleted file mode 100644 index 294a13d..0000000 --- a/platform/linux-generic/include/api/odp_pktio_netmap.h +++ /dev/null @@ -1,39 +0,0 @@ - -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/** - * @file - * - * ODP packet input/output netmap - */ - -#ifndef ODP_PKTIO_NETMAP_H -#define ODP_PKTIO_NETMAP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define ODP_NETMAP_MODE_HW 0 /**< Netmap mode in hardware */ -#define ODP_NETMAP_MODE_SW 1 /**< Netmap mode in software */ - -/** - * Netmap parameters - */ -typedef struct { - odp_pktio_type_t type; /**< Packet IO type */ - int netmap_mode; /**< Netmap Mode */ - uint16_t ringid; /**< Ring identifiers */ -} netmap_params_t; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/api/odp_pktio_socket.h b/platform/linux-generic/include/api/odp_pktio_socket.h deleted file mode 100644 index 6444cba..0000000 --- a/platform/linux-generic/include/api/odp_pktio_socket.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/** - * @file - * - * ODP packet input/output socket - */ - -#ifndef ODP_PKTIO_SOCKET_H -#define ODP_PKTIO_SOCKET_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** - * Socket Parameters - */ -typedef struct { - odp_pktio_type_t type; /**< Packet IO type */ - int fanout; /**< Fantout */ -} socket_params_t; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/api/odp_pktio_types.h b/platform/linux-generic/include/api/odp_pktio_types.h deleted file mode 100644 index 54ce459..0000000 --- a/platform/linux-generic/include/api/odp_pktio_types.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/** - * @file - * - * ODP packet input/output types - */ - -#ifndef ODP_PKTIO_TYPES_H -#define ODP_PKTIO_TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* We should ensure that future enum values will never overlap, otherwise - * applications that want netmap suport might get in trouble if the odp lib - * was not built with netmap support and there are more types define below - */ - -/** - * Packet IO types - */ -typedef enum { - ODP_PKTIO_TYPE_SOCKET_BASIC = 0x1, - ODP_PKTIO_TYPE_SOCKET_MMSG, - ODP_PKTIO_TYPE_SOCKET_MMAP, - ODP_PKTIO_TYPE_NETMAP, -} odp_pktio_type_t; - -#include -#ifdef ODP_HAVE_NETMAP -#include -#endif - -/** - * Packet IO parameters - */ -typedef union odp_pktio_params_t { - odp_pktio_type_t type; /**< Packet IO type */ - socket_params_t sock_params; /**< Socket parameter */ -#ifdef ODP_HAVE_NETMAP - netmap_params_t nm_params; -#endif -} odp_pktio_params_t; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 7ba72df..23633ed 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -21,12 +21,21 @@ extern "C" { #include #include +/** + * Packet IO types + */ +typedef enum { + ODP_PKTIO_TYPE_SOCKET_BASIC = 0x1, + ODP_PKTIO_TYPE_SOCKET_MMSG, + ODP_PKTIO_TYPE_SOCKET_MMAP, +} odp_pktio_type_t; + struct pktio_entry { odp_spinlock_t lock; /**< entry spinlock */ int taken; /**< is entry taken(1) or free(0) */ odp_queue_t inq_default; /**< default input queue, if set */ odp_queue_t outq_default; /**< default out queue */ - odp_pktio_params_t params; /**< pktio parameters */ + odp_pktio_type_t type; /**< pktio type */ pkt_sock_t pkt_sock; /**< using socket API for IO */ pkt_sock_mmap_t pkt_sock_mmap; /**< using socket mmap API for IO */ }; diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index f38f5b0..9c1bd78 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -81,6 +81,7 @@ typedef struct { unsigned mmap_len; unsigned char if_mac[ETH_ALEN]; struct sockaddr_ll ll; + int fanout; } pkt_sock_mmap_t; /** diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index a7b9d3b..79f1335 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -19,8 +19,6 @@ #include #include -#include - #include typedef struct { @@ -113,7 +111,6 @@ static void init_pktio_entry(pktio_entry_t *entry) { set_taken(entry); entry->s.inq_default = ODP_QUEUE_INVALID; - memset(&entry->s.params, 0, sizeof(entry->s.params)); memset(&entry->s.pkt_sock, 0, sizeof(entry->s.pkt_sock)); memset(&entry->s.pkt_sock_mmap, 0, sizeof(entry->s.pkt_sock_mmap)); } @@ -173,9 +170,7 @@ odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool) ODP_DBG("ODP_PKTIO_USE_FANOUT: %d\n", fanout); if (getenv("ODP_PKTIO_DISABLE_SOCKET_MMAP") == NULL) { - pktio_entry->s.params.sock_params.type = - ODP_PKTIO_TYPE_SOCKET_MMAP; - pktio_entry->s.params.sock_params.fanout = fanout; + pktio_entry->s.type = ODP_PKTIO_TYPE_SOCKET_MMAP; res = setup_pkt_sock_mmap(&pktio_entry->s.pkt_sock_mmap, dev, pool, fanout); if (res != -1) { @@ -186,9 +181,7 @@ odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool) } if (getenv("ODP_PKTIO_DISABLE_SOCKET_MMSG") == NULL) { - pktio_entry->s.params.sock_params.type = - ODP_PKTIO_TYPE_SOCKET_MMSG; - pktio_entry->s.params.sock_params.fanout = fanout; + pktio_entry->s.type = ODP_PKTIO_TYPE_SOCKET_MMSG; res = setup_pkt_sock(&pktio_entry->s.pkt_sock, dev, pool); if (res != -1) { ODP_DBG("IO type: ODP_PKTIO_TYPE_SOCKET_MMSG\n"); @@ -198,9 +191,7 @@ odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool) } if (getenv("ODP_PKTIO_DISABLE_SOCKET_BASIC") == NULL) { - pktio_entry->s.params.sock_params.type = - ODP_PKTIO_TYPE_SOCKET_BASIC; - pktio_entry->s.params.sock_params.fanout = fanout; + pktio_entry->s.type = ODP_PKTIO_TYPE_SOCKET_BASIC; res = setup_pkt_sock(&pktio_entry->s.pkt_sock, dev, pool); if (res != -1) { ODP_DBG("IO type: ODP_PKTIO_TYPE_SOCKET_BASIC\n"); @@ -230,7 +221,7 @@ int odp_pktio_close(odp_pktio_t id) lock_entry(entry); if (!is_free(entry)) { - switch (entry->s.params.type) { + switch (entry->s.type) { case ODP_PKTIO_TYPE_SOCKET_BASIC: case ODP_PKTIO_TYPE_SOCKET_MMSG: res = close_pkt_sock(&entry->s.pkt_sock); @@ -271,7 +262,7 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t pkt_table[], unsigned len) return -1; lock_entry(pktio_entry); - switch (pktio_entry->s.params.type) { + switch (pktio_entry->s.type) { case ODP_PKTIO_TYPE_SOCKET_BASIC: pkts = recv_pkt_sock_basic(&pktio_entry->s.pkt_sock, pkt_table, len); @@ -308,7 +299,7 @@ int odp_pktio_send(odp_pktio_t id, odp_packet_t pkt_table[], unsigned len) return -1; lock_entry(pktio_entry); - switch (pktio_entry->s.params.type) { + switch (pktio_entry->s.type) { case ODP_PKTIO_TYPE_SOCKET_BASIC: pkts = send_pkt_sock_basic(&pktio_entry->s.pkt_sock, pkt_table, len); diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 279a0cb..844f117 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -857,6 +857,7 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t *const pkt_sock, const char *netdev, return -1; } + pkt_sock->fanout = fanout; if (fanout) { ret = set_pkt_sock_fanout_mmap(pkt_sock, if_idx); if (ret != 0)