From patchwork Tue Oct 10 12: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: 115391 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3667944qgn; Tue, 10 Oct 2017 05:04:05 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBtnAbt5r1O3IUzM3mB3UUEhZYgRrHkht28r4tXZrdt2Jd1GDy5MrgOo3pkNjAFcP+nfooK X-Received: by 10.36.43.13 with SMTP id h13mr9598083ita.8.1507637045725; Tue, 10 Oct 2017 05:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507637045; cv=none; d=google.com; s=arc-20160816; b=QzRBIHWAIiTNv+ZnF7nTkT1GISGg0KeSO9ACQvYzdSjCRgUKV9+E4MkNv5uQNE83ci Q3oPDIdSD7H7N/MxnNEUNy4tlAy3vI8Zo9Sq3eCW28Ln5tFJQwGcrzFUmH4DJZUG7d6H WqWyuA6K9Tja66qfxQ9ELyemkWz1tCmPqOehaw2z93IhOG4ZhWqh2F6hOy08gYYHKq42 pB28iyE7tTSfJiEEMnHBKO4XDHBQhX4edmbzosEu/YBLnoH1mSuHAHAbhsXQfcCvyQ63 G5ge9wHDLVNPCPHUGu0b7waM4NmPnrTzxQEplLvIynBNF4Wn1hZuZKLxihbJbikFHEhb ivGQ== 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=8uYEpkGZgdMY8ytbQTFUxbQdHerNDsNoL61bUDDQzqI=; b=uD/Hsu1G9mD6KJsjFhic9OC9o3FdJrXAcCQOc+8PgdGdgAYnvPkHnSGuobtzdw8YDO ZeYwzNoRDV8doNg3mTthO/B4c29dRGy9fwjheQK8UbjCgD/GUycGLeSvlabGNytSkBp9 h2BxAlUF3ukRvKjHiQrvcklSET/j0I4vlBfG6ywcCEI7HJGU1eRSaFIGcC9suqoTpI8d rYnSob11wk43ZFJLl3Gg/kN2kHfwQ8aI0Mj7Akbn19pgdPLV4Wh1kvscvrors8RkA3zA tGGzJPGex4JvfzUFOYsveNXbCY44WwVcOvBavc/MPqvnkJFcdutfHM5z/WzkuDYKf8Aw +1Rg== 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 r38si8405372ioi.299.2017.10.10.05.04.04; Tue, 10 Oct 2017 05:04:05 -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 1AAC460C42; Tue, 10 Oct 2017 12:04:04 +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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 24E5D60C63; Tue, 10 Oct 2017 12:02:36 +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 0AC1A609FB; Tue, 10 Oct 2017 12:02:17 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 00BD660C8B for ; Tue, 10 Oct 2017 12:00:52 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 3B71934C3989 for ; Tue, 10 Oct 2017 15:00:50 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id H8hpVN5WGE-0n9GO9ng; Tue, 10 Oct 2017 15:00:49 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id NWf2cc9w7t-0mem9tUj; Tue, 10 Oct 2017 15:00:48 +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, 10 Oct 2017 15:00:07 +0300 Message-Id: <1507636815-18816-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507636815-18816-1-git-send-email-odpbot@yandex.ru> References: <1507636815-18816-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 196 Subject: [lng-odp] [PATCH CLOUD-DEV v3 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: 3d3c8f71f39ff139695d6f4b8e5ea17502c5f7cf ** Merge commit sha: 2bae88983ff377d83fcf9c99bf5c380275454327 **/ 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 10760ca47..d31c449e2 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 dacea47c9..79f5b1082 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -50,7 +50,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