From patchwork Thu Oct 19 12: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: 116383 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp410575qgn; Thu, 19 Oct 2017 05:04:01 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RZX68xoAkVXDo0KRxzsTO7eMZ825wtSoQ+CNbafQSeBzY9K3UfJgIrSZct8LpKBZivCDbh X-Received: by 10.55.18.223 with SMTP id 92mr1445954qks.303.1508414641215; Thu, 19 Oct 2017 05:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508414641; cv=none; d=google.com; s=arc-20160816; b=IdhyBJCbq1swB9KEPRBdkN4eLA5Vtcb7t9Sfodl42i7VDDRyBuBegLyx1zLHjDPNhZ Y4PVozJAjFDMzCCg38DxAHHIluUax38sWAfrCP9keStpstQk09BV6JRXK8cv9nc4IlOA +rOENYpCt2kehQnMXQIXTKil8XUvBN2Q3V86NUbVDoVRU5c+ubV9wCF6imn9dUGfgdxi nx5FdU8NahlHDMl4FJlKWHgVdEOUl8+UTLTzBpHlZLR/CBcGl4xoXuEwtUS7Km3raaXT FBDQbXmPPBcgtPQXB5/fCDTZJmyy7b8O3Exa9WHAP5Xcyfj+DGiu4AlqCHg0/IwoYKLg VH/A== 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=9+jgliH+1hf8tpnOt8zPXwl3yHX+LcyqIAAiot00BDU=; b=sCvHPazjiYz2Ktl2OuTBkzHVTTtC3GEDbvDg5nZEBTyPS6mhx1flAbdgRIjJ6NbIAz iAfoglrvy5xLsItueyJ1nvgPt5+NF4qbHCeWhtYkSuYvPYaOUr0gbPDW4Ao+EN2bpLIG 7PL128l2QSimv5qpip6CIEitVnPU9iJ3Ux2/e57e9exQ3Jj+bWqT65SPOy6efoP9BzfV QlGsjJclYYg2FgyAeO/xewtbGRYL06n1yA+PzUMYn6bEikEGIB4OU5+o49HK/2LderSB SWGO4Ut0cSPSrW4fPEluG6ESy0NG7RDRogkVy78+h/HbipGBXVf+U4xp/fcFxZxLcW60 KzNw== 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 n198si2175634qke.115.2017.10.19.05.04.00; Thu, 19 Oct 2017 05:04:01 -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 DAD8562ADC; Thu, 19 Oct 2017 12:04:00 +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,RCVD_IN_MSPIKE_H3,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 547B662A96; Thu, 19 Oct 2017 12:02:32 +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 98C4D62A74; Thu, 19 Oct 2017 12:02:20 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 081DF62A9E for ; Thu, 19 Oct 2017 12:00:15 +0000 (UTC) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 75834408502F for ; Thu, 19 Oct 2017 15:00:13 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback5o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id hKC742O8St-0DhG2YHX; Thu, 19 Oct 2017 15:00:13 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lZE2bfHgVf-0CIGrQBW; Thu, 19 Oct 2017 15:00:12 +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: Thu, 19 Oct 2017 15:00:00 +0300 Message-Id: <1508414408-10456-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508414408-10456-1-git-send-email-odpbot@yandex.ru> References: <1508414408-10456-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 241 Subject: [lng-odp] [PATCH 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 241 (bogdanPricope:2_0_pktio_ops_pr) ** https://github.com/Linaro/odp/pull/241 ** Patch: https://github.com/Linaro/odp/pull/241.patch ** Base sha: 76f82972ecb51aa64215c97cb3d7f94e5de980f9 ** Merge commit sha: 24c411a2875cbcd686833666d481a0197cc82e90 **/ 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 3843ac709..07c5dbee7 100644 --- a/platform/linux-generic/include/odp_pktio_ops_subsystem.h +++ b/platform/linux-generic/include/odp_pktio_ops_subsystem.h @@ -105,4 +105,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