From patchwork Tue Sep 26 06:00:00 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: 114213 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3451142qgf; Mon, 25 Sep 2017 23:01:14 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBkEsZ/JO4GdZ8J5583uLIscTnTltz15duru9eovjP10r0q68rha7nzYm/HxEjUCTWsmfMD X-Received: by 10.107.183.213 with SMTP id h204mr13866150iof.61.1506405673910; Mon, 25 Sep 2017 23:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506405673; cv=none; d=google.com; s=arc-20160816; b=tRIrLtKdTBD/MP3+LmcNXRBBVMpLUsamqjhnY1FTNyUGoQywiUoBBaFUJUbvQxf/+h FzaHA/ZsZ7odXu09YwVXJ7qW2OZY+OUp4FFdNljScTkMptIEu1Jnzo6U7gvc1FW4lCtO 8qsR4+fTnFZg7vLsFVImxWY6ka2HDqdxoAGpQm9DtVV8V8+qg75WJf41tsTidpzUw2WR uuvnC9MM4UuGJic3pUtnXm9qXZSyDu2WG0B3Pp4t4oqnKWSw5hFnD5OrtLfvuEn/ALzD EnyymXrSU1X+FS1muaMVMhj11qMlapa7Ntrt6+zI7u9eHOqq88SM7o8BXBGtkPbQXvX1 qNfA== 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=+mnG0+wXMN58IhGQyr3rkvpYfs2/Mej8+YTP0Nq2H40=; b=t4Bom4fXeiWPHYxQ55l77LApf+w9b7Mz8glLHQathZ48chWG7/pMlZCYFluoGnDQc/ EgCG1rQOHVftJ4bXPHlGGnwX6hIRS8TY6dU4rsbAogww2F3hlJ5b3RJeg+tgCmNvefrw 5F5SZKMfmtZ3hpq1Fiyq6y4sgAZCoPkXnMI5vHmajWFJcCBS2Sca3FtU9oc5gox2gEr0 nY4FKSt3e+/0pgzg3wcvFv0coLk6upO1HNKs4TqRTrVlZO1v9e4ioC91zT9L8+ChbTlF RXr7idCM4S15jzkmbtA4ZMZ/ZNf7R9TAFNRCeZ7nZlM4x/maiFVurxlbwkJkVYucZYu+ GDXA== ARC-Authentication-Results: i=1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 206si6605567ioc.276.2017.09.25.23.01.13; Mon, 25 Sep 2017 23:01:13 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 7758460D6A; Tue, 26 Sep 2017 06:01:13 +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 92B3360BFB; Tue, 26 Sep 2017 06:00:27 +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 A612B60CD1; Tue, 26 Sep 2017 06:00:18 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 15E1260A54 for ; Tue, 26 Sep 2017 06:00:12 +0000 (UTC) Received: from mxback17j.mail.yandex.net (mxback17j.mail.yandex.net [IPv6:2a02:6b8:0:1619::93]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 5FF9D5882BCD for ; Tue, 26 Sep 2017 09:00:10 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback17j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id CWU7O1uPT7-0AH0w6gE; Tue, 26 Sep 2017 09:00:10 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 72uMtCPv0h-09mmbAIt; Tue, 26 Sep 2017 09:00:09 +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: Tue, 26 Sep 2017 09:00:00 +0300 Message-Id: <1506405608-3507-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506405608-3507-1-git-send-email-odpbot@yandex.ru> References: <1506405608-3507-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 196 Subject: [lng-odp] [PATCH CLOUD-DEV v1 1/9] linux-gen: pktio: introduce generic pktio_ops data storage 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 Signed-off-by: Bogdan Pricope --- /** Email created from pull request 196 (bogdanPricope:cloud_dev_pktio_ops_data_pr) ** https://github.com/Linaro/odp/pull/196 ** Patch: https://github.com/Linaro/odp/pull/196.patch ** Base sha: e89a0ed9c4cd6d7dc947b978ad1dcabc6d5a21a2 ** Merge commit sha: 160ad8615ce66c98231aa400863c82e89045d491 **/ platform/linux-dpdk/include/odp_packet_io_internal.h | 5 ++++- platform/linux-generic/include/odp_packet_io_internal.h | 5 ++++- platform/linux-generic/include/odp_pktio_ops_subsystem.h | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h index ec1d0c213..07db8cab0 100644 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ b/platform/linux-dpdk/include/odp_packet_io_internal.h @@ -42,7 +42,10 @@ typedef union pktio_entry_u pktio_entry_t; struct pktio_entry { const pktio_ops_module_t *ops; /**< Implementation specific methods */ - pktio_ops_data_t ops_data; + union { + pktio_ops_data_t ops_data; + uint8_t _ops_data[ODP_PKTIO_ODPS_DATA_MAX_SIZE]; + }; /* These two locks together lock the whole pktio device */ odp_ticketlock_t rxl; /**< RX ticketlock */ odp_ticketlock_t txl; /**< TX ticketlock */ diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 9fe9aeaa7..0201a47fa 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -48,7 +48,10 @@ typedef union pktio_entry_u pktio_entry_t; struct pktio_entry { const pktio_ops_module_t *ops; /**< Implementation specific methods */ - pktio_ops_data_t ops_data; /**< IO operation specific data */ + union { + pktio_ops_data_t ops_data; /**< IO operation specific data */ + uint8_t _ops_data[ODP_PKTIO_ODPS_DATA_MAX_SIZE]; + }; /* These two locks together lock the whole pktio device */ odp_ticketlock_t rxl; /**< RX ticketlock */ odp_ticketlock_t txl; /**< TX ticketlock */ diff --git a/platform/linux-generic/include/odp_pktio_ops_subsystem.h b/platform/linux-generic/include/odp_pktio_ops_subsystem.h index 7a915b82c..a8da6197b 100644 --- a/platform/linux-generic/include/odp_pktio_ops_subsystem.h +++ b/platform/linux-generic/include/odp_pktio_ops_subsystem.h @@ -103,4 +103,11 @@ typedef union { /* Extract pktio ops data from pktio entry structure */ #define ops_data(mod) s.ops_data.mod +/* Maximum size of pktio specific ops data.*/ +#define ODP_PKTIO_ODPS_DATA_MAX_SIZE 80000 + +/* Extract pktio ops data from pktio entry structure */ +#define odp_ops_data(_p, _mod) \ + ((pktio_ops_ ## _mod ## _data_t *)(uintptr_t)_p->s._ops_data) + #endif