From patchwork Wed Nov 1 14:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 117695 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp925751qgn; Wed, 1 Nov 2017 07:03:59 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Rq+sdF42PmGz4Jk24TGHHsUsUYQ4nhcPwKp59RsZjVwAWCU2FYWpVnnGrO0u3PVjGH3b1f X-Received: by 10.107.11.73 with SMTP id v70mr7346326ioi.260.1509545039661; Wed, 01 Nov 2017 07:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509545039; cv=none; d=google.com; s=arc-20160816; b=qrUhDDkwFi649P1YAo9cIeSw5DkBMQiLPX9ELqCVZcVrLVawPTGl0+rWt76YvIeEjf CoAX5FeNR8WfNo80or5PGVHN+H4E3Mwm8Nn1tyAGfHrr7ORlhxtOhhsy6hy7lZU1zvxg P0b4+0MNbQ54ekubsOP8VN/+I4Z2eU9EU/fTCkGFGcNHnGi3tQfNSWp2dtcO7K35aPNZ SHCuXWpO5qUEAlnupEZJIDKceSL4Dx2KOO4SHPPo1PWKzzqkdEbQLmLXG7nWt9wtqBtZ RbBQbsVXkisb+UwI5eevM5HEPebnDCxeFYTQLp5kgjdcmeX4JfyEQviq9kWk0ek0uwEt J21A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=yms7tkDKjhORGC5mf7DEdgerCYtn8a2OJehaTkcSbGY=; b=dsZNBKqgUXwnVYXGQlSXwLPZCNIDKLkc8lhH336PMruwwCkYg844P64H+UkOlvZeWR bzhUZYvoDbDghgpwU7ofyZF3ZM2dfZffPIXCbadSnBICpntpRzkEP3qzi7mdez9bcRnW Ug2xNTts9Y2e/8zCcsZrw2eiFTILqqWrkPTypic2Colnw//T9TOTXqQxpkYKgPORIUFu NuTd02LM5/kM1AZ0zT6Ka0pZFTYc6Kt5tiUuRBauOFgx8Nl1waOudX+mqABNPnPq5vRJ otzVz4c5iiwFX+lnGZyk8MoAA6xQc8qcgzXRi4p7ZgmefMR1qHaPG/LYo41w7fuC7jvC fPbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id a39si1018331itj.136.2017.11.01.07.03.59; Wed, 01 Nov 2017 07:03:59 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 317156100C; Wed, 1 Nov 2017 14:03:59 +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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 AFECA60FFF; Wed, 1 Nov 2017 14:00:43 +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 57B4560A56; Wed, 1 Nov 2017 14:00:23 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 18AD960A0B for ; Wed, 1 Nov 2017 14:00:16 +0000 (UTC) Received: from mxback6o.mail.yandex.net (mxback6o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::20]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 890E75D81C89 for ; Wed, 1 Nov 2017 17:00:14 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback6o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id K9PIWhB6Rb-0Ei8V88Q; Wed, 01 Nov 2017 17:00:14 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id aFzVa8u6W9-0Dm0g11E; Wed, 01 Nov 2017 17:00:13 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 1 Nov 2017 17:00:07 +0300 Message-Id: <1509544807-5034-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509544807-5034-1-git-send-email-odpbot@yandex.ru> References: <1509544807-5034-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 267 Subject: [lng-odp] [PATCH 2.0 v2 4/4] linux-gen: pktio: remove duplicate odp_packet_io_internal.h 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bogdan Pricope Enable utilization of linux-generic version of odp_packet_io_internal.h for linux-dpdk platform. Subsequently, linux-dpdk version of odp_packet_io_internal.h is removed. This is part of an attempt to reduce the delta between linux-dpdk and linux-generic platforms to permit integration of linux-dpdk pktios in linux-generic. Signed-off-by: Bogdan Pricope --- /** Email created from pull request 267 (bogdanPricope:2_0_pktio_internal_pr) ** https://github.com/Linaro/odp/pull/267 ** Patch: https://github.com/Linaro/odp/pull/267.patch ** Base sha: ca1be967bd4f6aec7dc99b72de643718cb8a32b8 ** Merge commit sha: 29fab9a6071107a8bb565ceee1837755d3ca1eee **/ platform/linux-dpdk/Makefile.am | 2 +- .../linux-dpdk/include/odp_packet_io_internal.h | 157 --------------------- .../linux-generic/include/odp_packet_io_internal.h | 1 - platform/linux-generic/odp_packet_io.c | 1 + 4 files changed, 2 insertions(+), 159 deletions(-) delete mode 100644 platform/linux-dpdk/include/odp_packet_io_internal.h diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index e2a0249df..596c7b784 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -199,7 +199,7 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_pktio_ops_socket.h \ ${top_srcdir}/platform/linux-generic/include/odp_pktio_ops_loopback.h \ ${top_srcdir}/platform/linux-generic/include/odp_name_table_internal.h \ - ${srcdir}/include/odp_packet_io_internal.h \ + ${top_srcdir}/platform/linux-generic/include/odp_packet_io_internal.h \ ${srcdir}/include/odp_errno_define.h \ ${top_srcdir}/platform/linux-generic/include/odp_packet_io_ring_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_pkt_queue_internal.h \ diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h deleted file mode 100644 index 089ad38c5..000000000 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ /dev/null @@ -1,157 +0,0 @@ -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/** - * @file - * - * ODP packet IO - implementation internal - */ - -#ifndef ODP_PACKET_IO_INTERNAL_H_ -#define ODP_PACKET_IO_INTERNAL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include - -#define PKTIO_MAX_QUEUES 64 -#include - -/* Forward declaration */ -typedef union pktio_entry_u pktio_entry_t; -#include - -#define PKTIO_NAME_LEN 256 - -#define PKTIN_INVALID ((odp_pktin_queue_t) {ODP_PKTIO_INVALID, 0}) -#define PKTOUT_INVALID ((odp_pktout_queue_t) {ODP_PKTIO_INVALID, 0}) - -struct pktio_entry { - const pktio_ops_module_t *ops; /**< Implementation specific methods */ - uint8_t ops_data[ODP_PKTIO_ODPS_DATA_MAX_SIZE]; /**< IO operation - specific data */ - /* These two locks together lock the whole pktio device */ - odp_ticketlock_t rxl; /**< RX ticketlock */ - odp_ticketlock_t txl; /**< TX ticketlock */ - int cls_enabled; /**< is classifier enabled */ - odp_pktio_t handle; /**< pktio handle */ - enum { - /* Not allocated */ - PKTIO_STATE_FREE = 0, - /* Close pending on scheduler response. Next state after this - * is PKTIO_STATE_FREE. */ - PKTIO_STATE_CLOSE_PENDING, - /* Open in progress. - Marker for all active states following under. */ - PKTIO_STATE_ACTIVE, - /* Open completed */ - PKTIO_STATE_OPENED, - /* Start completed */ - PKTIO_STATE_STARTED, - /* Stop pending on scheduler response */ - PKTIO_STATE_STOP_PENDING, - /* Stop completed */ - PKTIO_STATE_STOPPED - } state; - odp_pktio_config_t config; /**< Device configuration */ - classifier_t cls; /**< classifier linked with this pktio*/ - odp_pktio_stats_t stats; /**< statistic counters for pktio */ - char name[PKTIO_NAME_LEN]; /**< name of pktio provided to - pktio_open() */ - odp_pool_t pool; - odp_pktio_param_t param; - - /* Storage for queue handles - * Multi-queue support is pktio driver specific */ - unsigned num_in_queue; - unsigned num_out_queue; - - struct { - odp_queue_t queue; - queue_t queue_int; - odp_pktin_queue_t pktin; - } in_queue[PKTIO_MAX_QUEUES]; - - struct { - odp_queue_t queue; - odp_pktout_queue_t pktout; - } out_queue[PKTIO_MAX_QUEUES]; -}; - -union pktio_entry_u { - struct pktio_entry s; - uint8_t pad[ROUNDUP_CACHE_LINE(sizeof(struct pktio_entry))]; -}; - -typedef struct { - odp_spinlock_t lock; - pktio_entry_t entries[ODP_CONFIG_PKTIO_ENTRIES]; -} pktio_table_t; - -extern void *pktio_entry_ptr[]; - -static inline int pktio_to_id(odp_pktio_t pktio) -{ - return _odp_typeval(pktio) - 1; -} - -static inline pktio_entry_t *get_pktio_entry(odp_pktio_t pktio) -{ - if (odp_unlikely(pktio == ODP_PKTIO_INVALID)) - return NULL; - - if (odp_unlikely(_odp_typeval(pktio) > ODP_CONFIG_PKTIO_ENTRIES)) { - ODP_DBG("pktio limit %d/%d exceed\n", - _odp_typeval(pktio), ODP_CONFIG_PKTIO_ENTRIES); - return NULL; - } - - return pktio_entry_ptr[pktio_to_id(pktio)]; -} - -static inline int pktio_cls_enabled(pktio_entry_t *entry) -{ - return entry->s.cls_enabled; -} - -static inline void pktio_cls_enabled_set(pktio_entry_t *entry, int ena) -{ - entry->s.cls_enabled = ena; -} - -/* - * Dummy single queue implementations of multi-queue API - */ -int single_input_queues_config(pktio_entry_t *entry, - const odp_pktin_queue_param_t *param); -int single_output_queues_config(pktio_entry_t *entry, - const odp_pktout_queue_param_t *param); -int single_recv_queue(pktio_entry_t *entry, int index, odp_packet_t packets[], - int num); -int single_send_queue(pktio_entry_t *entry, int index, - const odp_packet_t packets[], int num); - -int pktin_poll_one(int pktio_index, - int rx_queue, - odp_event_t evt_tbl[]); -int pktin_poll(int pktio_index, int num_queue, int index[]); -void pktio_stop_finalize(int pktio_index); - -#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 a2e1fdd9c..7df11618e 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -25,7 +25,6 @@ extern "C" { #include #include #include -#include #include #include diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index beeb9c6b3..d5f8d5de0 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -186,6 +186,7 @@ static odp_pktio_t setup_pktio_entry(const char *name, odp_pool_t pool, pktio_entry->s.pool = pool; memcpy(&pktio_entry->s.param, param, sizeof(odp_pktio_param_t)); pktio_entry->s.handle = hdl; + pktio_entry->s.stats_type = STATS_UNSUPPORTED; odp_pktio_config_init(&pktio_entry->s.config);