From patchwork Tue Oct 10 10:00:06 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: 115373 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3561270qgn; Tue, 10 Oct 2017 03:03:23 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBeUz2V69OM/n8uYA5zZlcDAMgNVl8lXQLgjkKaXK+YI6TIzjY6ipoKjHpF2Od6Cd5zKzx4 X-Received: by 10.36.20.81 with SMTP id 78mr16566714itg.127.1507629803729; Tue, 10 Oct 2017 03:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507629803; cv=none; d=google.com; s=arc-20160816; b=vOtwR9GpZfA0XeVveAHJflMsOjRUjjRec/PP7OD9/VxyO6tkeb7c0MOBm+oVGunTJu HwOuCCKeOGiYHbvArHp/IpzSIV53HFKAn7n1d0bbBByqmuNA21BD1mQcWD4e9V1EjeOo scXgOfBF3drS7YgOhwYYx2w0Rcy7Cc/tV7FWVlJwWdTX0AyUIYWpHkpfbgnj+4EFHhcB jcvFHm4c7P/1CPZGWNjH/9NX2RIRPitoHD6rv2JxYAO2hen/Z7JBXCtltSw1imU6uVI0 knC1xh51XofVDmTMZhYaFU+2uIBXDGJEqbWheK2X1EvaY8BaXKa0ZiWJvAQ50URKD+gW 0GFw== 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=U/8Z1Sq5PyoIiEzjWXmaP5VKACf34Ou0+wWRl2FlC7o=; b=Ga8PJ60BQIIr1f4EjVBTyowt5XnIN1xR4Sp8gfr6oyXDMDqIXz7M6F6O+BRc1KzcpW jNN1lYOirnKUAUOl35hhdXlLBD6dfB8c1RMF52Rk+FQlte7uCYCJD8Dcrj8gPIOEwJT+ F3YVl6CxWBXwqUnjyqRcoujTXNjLRMNhUZM9fEdEVuxc/PhTN2TnKompcImuu4r5+OqR HHnaupRMPgk5PL+CoxFxAes6ShmjkMdFB/U6dV7Kprl2MJxLHRlu+jUhce6wQ8sSlcub k9gQqTtYnD/r9n9N8+1KN+T4UOMO9hWUlrrTCbDLia2DRljhVS/plZSssTN2AskVz3f+ 1N5Q== 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 t62si8153832iof.169.2017.10.10.03.03.23; Tue, 10 Oct 2017 03:03:23 -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 4B7B460BFE; Tue, 10 Oct 2017 10:03:23 +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 5C64260C42; Tue, 10 Oct 2017 10:01:16 +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 3D88360BFB; Tue, 10 Oct 2017 10:01:00 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 5AE9F60765 for ; Tue, 10 Oct 2017 10:00:50 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward106o.mail.yandex.net (Yandex) with ESMTP id BE7BE7819BA for ; Tue, 10 Oct 2017 13:00:48 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4aKuY7Dv6i-0gnuCh0a; Tue, 10 Oct 2017 13:00:42 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id hbf1r0CSIp-0gea6VAk; Tue, 10 Oct 2017 13:00:42 +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 13:00:06 +0300 Message-Id: <1507629614-17356-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507629614-17356-1-git-send-email-odpbot@yandex.ru> References: <1507629614-17356-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 196 Subject: [lng-odp] [PATCH CLOUD-DEV v2 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: 396a3d25a5aaadda96c34eb8a6801599f7afac84 **/ 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