From patchwork Wed Nov 8 09:00:08 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: 118219 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5027713qgn; Wed, 8 Nov 2017 01:01:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMZAoEzY5DRHc1f/IX28KheM5KEhTQQkkHUETC+4VQ0MIlunYXa8hC1UA+xkOPn9HTXLHQxA X-Received: by 10.55.16.80 with SMTP id a77mr2293327qkh.250.1510131697052; Wed, 08 Nov 2017 01:01:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510131696; cv=none; d=google.com; s=arc-20160816; b=K56s4ruP6IT19d+gBC+a5IR0RBuOp3nBktaSGpvqUSLvy+G2n1EKMD5cZ6gheJY1Ub KAZhhHusQAJ+sYKJmMXwWWwCRmULbZTKNfkjiQBjdBhCNXEdNmRCCySUipXYjVhil1zZ AaHrMHD8JyZ/N/WqQ1g+o/6t23JHprW4Ly/hU/wCS87tlm6Lr8XusKzTk7I7YF6JRJoW p+VQJOutb3TmUsdzyL7zXlPwQ9eY/Zid1u16Cgf1lIG5juh7mpe0WAastl0SCSUEf6wV keSvsgCYVGRijxiyFfIqCgfu4i/6RSPo15eGxyT6nozvOCpVL/Qfg7Fiv5u5p25Almow tjKQ== 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=Ea2iaGalqrfpMVBAdMX0t95ty/BTa5W7He6ZH6hxQ/8=; b=ioCP5I3A10uch5dCFKVAy8FpINZ8pz2IUpQfCXeuYqp0V9na6mldQXbMK0q7ElSFDV KzLzY420cg63V7SrHHDk1xbP3tN79dt6vffFuRWJdfgcbECRRbjM+h4BJCK9BVfSM8ba 0iCI2X7rrc4RA+IHy1plKnInc43pX8prG9aCeAVstkyQrHtsmw4MIqn8dy8yGJ+SmHxD QLUAcatU4AevXREUxifbsgjj+9B5ftTaX7+GTQL9Wo9AOOlLYfuakE294ZSC1lDolxiq a4uSrCoduVFFwBfLNlmjxeTBhwqIHrIRxs9LrN1eFAdeti/2oB63mqvaHRRfSPVclv8S AwbQ== 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 w31si3317434qtb.74.2017.11.08.01.01.36; Wed, 08 Nov 2017 01:01:36 -0800 (PST) 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 2C8CA60AF8; Wed, 8 Nov 2017 09:01:36 +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 EAF2B60628; Wed, 8 Nov 2017 09:00:28 +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 4D49C60592; Wed, 8 Nov 2017 09:00:18 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 18AB66038F for ; Wed, 8 Nov 2017 09:00:12 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward105p.mail.yandex.net (Yandex) with ESMTP id B3C2E40830A9 for ; Wed, 8 Nov 2017 12:00:10 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id n28UBk3a5k-0ACeuGh5; Wed, 08 Nov 2017 12:00:10 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id g2jiy9QYhK-097CVDke; Wed, 08 Nov 2017 12:00:10 +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, 8 Nov 2017 12:00:08 +0300 Message-Id: <1510131608-11606-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510131608-11606-1-git-send-email-odpbot@yandex.ru> References: <1510131608-11606-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 284 Subject: [lng-odp] [PATCH 2.0 v1 1/1] pktio: count padding bytes in pktio's ops_data 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: Josep Puigdemont By locating the odp_data array at the end of the pktio_entry struct, we can now account for any padding bytes added by the pktio_entry_u, and let pktios use them if necessary. Signed-off-by: Josep Puigdemont --- /** Email created from pull request 284 (joseppc:use-padding-bytes) ** https://github.com/Linaro/odp/pull/284 ** Patch: https://github.com/Linaro/odp/pull/284.patch ** Base sha: c0f99c441feadd1566b7e92789b11c30c6ee3f64 ** Merge commit sha: 10405656125e954b98106bda520a3bc2f43ab837 **/ platform/linux-generic/include/odp_packet_io_internal.h | 7 +++++-- platform/linux-generic/include/odp_pktio_ops_subsystem.h | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 7df11618e..69ed1f97a 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -43,8 +43,6 @@ typedef union pktio_entry_u pktio_entry_t; 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 */ @@ -97,6 +95,9 @@ struct pktio_entry { odp_queue_t queue; odp_pktout_queue_t pktout; } out_queue[PKTIO_MAX_QUEUES]; + + uint8_t ops_data[ODP_PKTIO_ODPS_DATA_MIN_SIZE]; /**< IO operation + specific data */ }; union pktio_entry_u { @@ -104,6 +105,8 @@ union pktio_entry_u { uint8_t pad[ROUNDUP_CACHE_LINE(sizeof(struct pktio_entry))]; }; +#define ODP_PKTIO_ODPS_DATA_MAX_SIZE (sizeof(pktio_entry_t) - offsetof(struct pktio_entry, ops_data)) + typedef struct { odp_spinlock_t lock; pktio_entry_t entries[ODP_CONFIG_PKTIO_ENTRIES]; diff --git a/platform/linux-generic/include/odp_pktio_ops_subsystem.h b/platform/linux-generic/include/odp_pktio_ops_subsystem.h index cb107fed2..998b2f7bf 100644 --- a/platform/linux-generic/include/odp_pktio_ops_subsystem.h +++ b/platform/linux-generic/include/odp_pktio_ops_subsystem.h @@ -85,8 +85,8 @@ typedef ODP_MODULE_CLASS(pktio_ops) { odp_api_proto(pktio_ops, print) print; } pktio_ops_module_t; -/* Maximum size of pktio specific ops data.*/ -#define ODP_PKTIO_ODPS_DATA_MAX_SIZE 80000 +/* Minimum size of pktio specific ops data.*/ +#define ODP_PKTIO_ODPS_DATA_MIN_SIZE 80000 /* Extract pktio ops data from pktio entry structure */ #define odp_ops_data(_p, _mod) \