From patchwork Mon Dec 15 17:09:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 42265 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BD70426C6C for ; Mon, 15 Dec 2014 17:10:29 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf3849040wiv.1 for ; Mon, 15 Dec 2014 09:10:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=0TH6uA/WoZsTc5fzBxt6bW0gbb3ERofbIHoJ+jBzpQk=; b=Razrj9/6N91ZzWedQp23ycHT2Jqr0tcpdgofqM7FDnKpqKMhAe+7xBo0YGvokt+y5/ AZHgq9IElXdwjdyTAk9nhirsxru5Jn33EsMdZCHZ2rDCeNJU2WI5UgK4mzDbC9/bKgjD OCQdDr+nrsA5C9n+WA3QuJdTSKyEaLYjO1A4K+esfhGDSPkJLPptK1Qi2V7j7rZd6WEO twC+UbbaRIKhDQuJV/0ZPTTyALZhPxCud2z8NKAfoKlO0AMCysuqM/Ic5Oj5xmKF8OU0 lQHvm3h/N7PXxa6yjNVpFaOFji2TJspkSJijev+JQQreAyMN2R/pLPEPvBrfsFVkPzzl Hm6A== X-Gm-Message-State: ALoCoQkvQH3IIrvUOfJQHdYb4yZtlpqzzVd8OtPnAafTufRF8TIMkqj2H3wO4bPITL8kHkwI2K3d X-Received: by 10.180.98.39 with SMTP id ef7mr3007363wib.6.1418663429067; Mon, 15 Dec 2014 09:10:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.131 with SMTP id t3ls164236lag.44.gmail; Mon, 15 Dec 2014 09:10:28 -0800 (PST) X-Received: by 10.112.132.67 with SMTP id os3mr30997720lbb.90.1418663428903; Mon, 15 Dec 2014 09:10:28 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id rr7si2609698lbb.43.2014.12.15.09.10.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 09:10:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id u10so9321316lbd.6 for ; Mon, 15 Dec 2014 09:10:28 -0800 (PST) X-Received: by 10.112.14.6 with SMTP id l6mr8579646lbc.91.1418663428808; Mon, 15 Dec 2014 09:10:28 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp781961lbb; Mon, 15 Dec 2014 09:10:27 -0800 (PST) X-Received: by 10.140.27.199 with SMTP id 65mr54202784qgx.24.1418663427221; Mon, 15 Dec 2014 09:10:27 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id i65si11332505qgd.0.2014.12.15.09.10.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 09:10:27 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y0ZA8-0000fR-ND; Mon, 15 Dec 2014 17:10:24 +0000 Received: from mail-la0-f47.google.com ([209.85.215.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y0Z9t-0000ag-Qt for lng-odp@lists.linaro.org; Mon, 15 Dec 2014 17:10:09 +0000 Received: by mail-la0-f47.google.com with SMTP id hz20so9518945lab.20 for ; Mon, 15 Dec 2014 09:10:04 -0800 (PST) X-Received: by 10.152.5.6 with SMTP id o6mr31574228lao.8.1418663403940; Mon, 15 Dec 2014 09:10:03 -0800 (PST) Received: from localhost.localdomain ([80.77.38.170]) by mx.google.com with ESMTPSA id l9sm1208585lae.0.2014.12.15.09.10.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Dec 2014 09:10:03 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Mon, 15 Dec 2014 19:09:47 +0200 Message-Id: <1418663392-28354-3-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418663392-28354-1-git-send-email-taras.kondratiuk@linaro.org> References: <1418663392-28354-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv6 2/7] api: config: add buffer/packet configuration X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Bill Fischofer Signed-off-by: Bill Fischofer Signed-off-by: Taras Kondratiuk --- platform/linux-generic/include/api/odp_config.h | 70 +++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/platform/linux-generic/include/api/odp_config.h b/platform/linux-generic/include/api/odp_config.h index 906897c..2f839b3 100644 --- a/platform/linux-generic/include/api/odp_config.h +++ b/platform/linux-generic/include/api/odp_config.h @@ -49,6 +49,76 @@ extern "C" { #define ODP_CONFIG_PKTIO_ENTRIES 64 /** + * Minimum supported buffer alignment + * This defines the minimum buffer alignment request. Requests for + * values below this will be rounded up to this value. + */ +#define ODP_CONFIG_BUFFER_ALIGN_MIN 8 + +/** + * Maximum supported buffer alignment + * This defines the maximum supported buffer alignment. Requests for + * values above this will fail. + */ + +#define ODP_CONFIG_BUFFER_ALIGN_MAX (4*1024) + +/** + * Default packet headroom + * This is default headroom that will be applied to any buffer pool created + * for packets. Note that while headroom serves to reserve space for packet + * header expansion via the odp_packet_push_head() routine, it also serves to + * align packets within the buffer. ODP packet buffers always have a minimum + * of 8 byte alignment, so the headroom can be used to offset packets so that, + * for example, a 14 byte standard Ethernet header ends on a 4 byte boundary + * so that the following IP header begins on a 4 byte alignment. Note also + * that this is the minimum headroom value that the application + * requires. Implementations are free to add to whatever value is specified + * here in multiples of 8 bytes to preserve the implied alignment + * specification. The specific default shown here allows a 1500-byte packet + * to be received into a single segment with Ethernet offset alignment and + * room for some header expansion. + */ +#define ODP_CONFIG_PACKET_HEADROOM 66 + +/** + * Default packet tailroom + * This is the default tailroom that will be applied to any buffer pool + * created for packets. This specifies the minimum tailroom value that the + * application requires. Implementations are free to add to this as desired + * without restriction. Note that most implementations will automatically + * consider any unused portion of the last segment of a packet as tailroom + */ +#define ODP_CONFIG_PACKET_TAILROOM 0 + +/** + * Minimum packet segment size + * This defines the minimum allowable size for packet segments. It exists to + * ensure that the application can have a reasonable expectation that all + * packet headers will reside in the first packet segment. Note that this + * value MUST be a multiple of 8. + * + * This is the granularity of segmented buffers/packets. Note that this is + * currently only applicable to buffers of type ODP_BUFFER_TYPE_PACKET. It is + * sized for now to be large enough to support 1536-byte packets with the + * default headroom shown above, since the raw socket interface does not + * at present support scatter/gather I/O. This is subject to the + * ODP_CONFIG_PACKET_BUF_MIN_LEN configuration shown above and MUST be a + * multiple of ODP_CACHE_LINE_SIZE. 1664 is used here as a default since it is + * a multiple of both 64 and 128, which are the most common cache line sizes. + * Adjust as needed for your platform. + */ +#define ODP_CONFIG_PACKET_BUF_LEN_MIN (1664) + +/** + * Maximum packet length supported + * MUST be an integral number of segments and SHOULD be large enough to + * accommodate jumbo packets (9K). Attempts to allocate or extend packets to + * sizes larger than this limit will fail. + */ +#define ODP_CONFIG_PACKET_BUF_LEN_MAX (ODP_CONFIG_PACKET_BUF_LEN_MIN*6) + +/** * @} */