From patchwork Fri Dec 19 15:28:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 42493 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D60D126C68 for ; Fri, 19 Dec 2014 15:29:14 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf896736wib.10 for ; Fri, 19 Dec 2014 07:29:14 -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=cAK9aPTOKUlLcTPNictO8BlpZeVJ5IvEgUtnxA3jSt4=; b=bsfKnr031wLNQHjTzjBYBLXKLsHYV745TLUX07scv5ndvKnzgegt4uwtzQLo7murgY 0V3vhnfl5gDDYaVFxoIqJneyLvbWdFKJGN2Nk9ObnjCF23Vncp6rBYLNSUJreAto2sBO 5azv8w8xAfZKi+BTbEgSE1dczw4gHkBMUQlRzNi9PuJ1Fk4epaujw0lAWpNZyeLfQ18v WObo9Se1KpRVD1SA8zXX4RsFVJh/3yAklVirOOvPlezX7lNmDqNhfOh/gTq4HsSbeUbW vBOOc4d5/aZxHbSHmyQ89qk0dRMxridXxAQ8bYWH0M01lAZHZyA1KO59mzNKianfSbjj ddSw== X-Gm-Message-State: ALoCoQksLPva8G0Kvs11JYBdUvCIQ3hQhdl3bJ18MFBg9zfoaQC/Yoz6lkM5Tb+9G9G/eST3kMRO X-Received: by 10.152.44.225 with SMTP id h1mr1197501lam.2.1419002954081; Fri, 19 Dec 2014 07:29:14 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.67 with SMTP id z3ls1111288lag.2.gmail; Fri, 19 Dec 2014 07:29:13 -0800 (PST) X-Received: by 10.112.219.98 with SMTP id pn2mr6445524lbc.74.1419002953795; Fri, 19 Dec 2014 07:29:13 -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 c9si10215110lae.124.2014.12.19.07.29.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Dec 2014 07:29:13 -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 u10so975130lbd.20 for ; Fri, 19 Dec 2014 07:29:13 -0800 (PST) X-Received: by 10.152.5.226 with SMTP id v2mr8441600lav.34.1419002953664; Fri, 19 Dec 2014 07:29:13 -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 ru5csp309748lbb; Fri, 19 Dec 2014 07:29:12 -0800 (PST) X-Received: by 10.140.106.35 with SMTP id d32mr13759758qgf.48.1419002951856; Fri, 19 Dec 2014 07:29:11 -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 q5si12014539qal.127.2014.12.19.07.29.10 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 19 Dec 2014 07:29:11 -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 1Y1zUK-0000lu-N2; Fri, 19 Dec 2014 15:29:08 +0000 Received: from mail-qc0-f173.google.com ([209.85.216.173]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1zU8-0000lN-4y for lng-odp@lists.linaro.org; Fri, 19 Dec 2014 15:28:56 +0000 Received: by mail-qc0-f173.google.com with SMTP id i17so798059qcy.4 for ; Fri, 19 Dec 2014 07:28:51 -0800 (PST) X-Received: by 10.224.121.142 with SMTP id h14mr14771498qar.80.1419002930827; Fri, 19 Dec 2014 07:28:50 -0800 (PST) Received: from localhost.localdomain (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id p4sm9692288qar.48.2014.12.19.07.28.48 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Dec 2014 07:28:49 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Fri, 19 Dec 2014 17:28:19 +0200 Message-Id: <1419002899-17314-3-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.1 In-Reply-To: <1419002899-17314-1-git-send-email-petri.savolainen@linaro.org> References: <1419002899-17314-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 3/3] api: buffer_pool: Rename buf_size pool_param 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: petri.savolainen@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 Renamed pool parameter buf_size to buf_len, so that buf_len is used consistently in buffer/pool/packet APIs. Signed-off-by: Petri Savolainen --- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 6 +++--- example/l2fwd/odp_l2fwd.c | 2 +- example/odp_example/odp_example.c | 2 +- example/packet/odp_pktio.c | 2 +- example/timer/odp_timer_test.c | 2 +- platform/linux-generic/include/api/odp_buffer_pool.h | 2 +- platform/linux-generic/odp_buffer_pool.c | 12 ++++++------ platform/linux-generic/odp_packet.c | 6 +++--- platform/linux-generic/odp_schedule.c | 2 +- test/api_test/odp_timer_ping.c | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index d4bea92..d15f645 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -593,7 +593,7 @@ int main(int argc, char *argv[]) printf("First core: %i\n\n", first_core); /* Create packet pool */ - params.buf_size = SHM_PKT_POOL_BUF_SIZE; + params.buf_len = SHM_PKT_POOL_BUF_SIZE; params.buf_align = 0; params.num_bufs = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE; params.buf_type = ODP_BUFFER_TYPE_PACKET; diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 223ca61..174b1c1 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -399,7 +399,7 @@ void ipsec_init_pre(void) } /* Create output buffer pool */ - params.buf_size = SHM_OUT_POOL_BUF_SIZE; + params.buf_len = SHM_OUT_POOL_BUF_SIZE; params.buf_align = 0; params.num_bufs = SHM_PKT_POOL_BUF_COUNT; params.buf_type = ODP_BUFFER_TYPE_PACKET; @@ -1236,7 +1236,7 @@ main(int argc, char *argv[]) printf("First core: %i\n\n", first_core); /* Create packet buffer pool */ - params.buf_size = SHM_PKT_POOL_BUF_SIZE; + params.buf_len = SHM_PKT_POOL_BUF_SIZE; params.buf_align = 0; params.num_bufs = SHM_PKT_POOL_BUF_COUNT; params.buf_type = ODP_BUFFER_TYPE_PACKET; @@ -1250,7 +1250,7 @@ main(int argc, char *argv[]) } /* Create context buffer pool */ - params.buf_size = SHM_CTX_POOL_BUF_SIZE; + params.buf_len = SHM_CTX_POOL_BUF_SIZE; params.buf_align = 0; params.num_bufs = SHM_CTX_POOL_BUF_COUNT; params.buf_type = ODP_BUFFER_TYPE_RAW; diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c index 3e11b60..900f8ea 100644 --- a/example/l2fwd/odp_l2fwd.c +++ b/example/l2fwd/odp_l2fwd.c @@ -382,7 +382,7 @@ int main(int argc, char *argv[]) printf("First core: %i\n\n", first_core); /* Create packet pool */ - params.buf_size = SHM_PKT_POOL_BUF_SIZE; + params.buf_len = SHM_PKT_POOL_BUF_SIZE; params.buf_align = 0; params.num_bufs = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE; params.buf_type = ODP_BUFFER_TYPE_PACKET; diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c index 8373f12..cc1cc4c 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -1043,7 +1043,7 @@ int main(int argc, char *argv[]) * Create message pool */ - params.buf_size = sizeof(test_message_t); + params.buf_len = sizeof(test_message_t); params.buf_align = 0; params.num_bufs = MSG_POOL_SIZE/sizeof(test_message_t); params.buf_type = ODP_BUFFER_TYPE_RAW; diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index a323ec2..78a70b0 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -382,7 +382,7 @@ int main(int argc, char *argv[]) printf("First core: %i\n\n", first_core); /* Create packet pool */ - params.buf_size = SHM_PKT_POOL_BUF_SIZE; + params.buf_len = SHM_PKT_POOL_BUF_SIZE; params.buf_align = 0; params.num_bufs = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE; params.buf_type = ODP_BUFFER_TYPE_PACKET; diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 0d6e31a..b8c701f 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -314,7 +314,7 @@ int main(int argc, char *argv[]) shm = odp_shm_reserve("msg_pool", MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0); - params.buf_size = 0; + params.buf_len = 0; params.buf_align = 0; params.num_bufs = MSG_POOL_SIZE; params.buf_type = ODP_BUFFER_TYPE_TIMEOUT; diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h b/platform/linux-generic/include/api/odp_buffer_pool.h index 27e816d..ac3cec5 100644 --- a/platform/linux-generic/include/api/odp_buffer_pool.h +++ b/platform/linux-generic/include/api/odp_buffer_pool.h @@ -40,7 +40,7 @@ extern "C" { * ODP_CONFIG_BUFFER_ALIGN_MAX */ typedef struct odp_buffer_pool_param_t { - uint32_t buf_size; /**< Minimum buffer length in bytes. For packets, + uint32_t buf_len; /**< Minimum buffer length in bytes. For packets, this is the minimum segment buffer length. The length includes head-/tailroom bytes. Use 0 for default length. */ diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index 021571a..2d2932b 100644 --- a/platform/linux-generic/odp_buffer_pool.c +++ b/platform/linux-generic/odp_buffer_pool.c @@ -148,7 +148,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, switch (params->buf_type) { case ODP_BUFFER_TYPE_RAW: case ODP_BUFFER_TYPE_TIMEOUT: - blk_size = params->buf_size; + blk_size = params->buf_len; /* Optimize small raw buffers */ if (blk_size > ODP_MAX_INLINE_BUF || params->buf_align != 0) @@ -165,11 +165,11 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, tailroom = ODP_CONFIG_PACKET_TAILROOM; if (unsegmented) blk_size = ODP_ALIGN_ROUNDUP( - headroom + params->buf_size + tailroom, + headroom + params->buf_len + tailroom, buf_align); else blk_size = ODP_ALIGN_ROUNDUP( - headroom + params->buf_size + tailroom, + headroom + params->buf_len + tailroom, ODP_CONFIG_PACKET_BUF_LEN_MIN); buf_stride = params->buf_type == ODP_BUFFER_TYPE_PACKET ? sizeof(odp_packet_hdr_stride) : @@ -405,7 +405,7 @@ int odp_buffer_pool_info(odp_buffer_pool_t pool_hdl, info->name = pool->s.name; info->shm = pool->s.flags.user_supplied_shm ? pool->s.pool_shm : ODP_SHM_NULL; - info->params.buf_size = pool->s.params.buf_size; + info->params.buf_len = pool->s.params.buf_len; info->params.buf_align = pool->s.params.buf_align; info->params.num_bufs = pool->s.params.num_bufs; info->params.buf_type = pool->s.params.buf_type; @@ -506,7 +506,7 @@ odp_buffer_t buffer_alloc(odp_buffer_pool_t pool_hdl, size_t size) odp_buffer_t odp_buffer_alloc(odp_buffer_pool_t pool_hdl) { return buffer_alloc(pool_hdl, - odp_pool_to_entry(pool_hdl)->s.params.buf_size); + odp_pool_to_entry(pool_hdl)->s.params.buf_len); } void odp_buffer_free(odp_buffer_t buf) @@ -575,7 +575,7 @@ void odp_buffer_pool_print(odp_buffer_pool_t pool_hdl) ODP_DBG(" pool mdata base %p\n", pool->s.pool_mdata_addr); ODP_DBG(" udata size %zu\n", pool->s.init_params.udata_size); ODP_DBG(" headroom %u\n", pool->s.headroom); - ODP_DBG(" buf size %zu\n", pool->s.params.buf_size); + ODP_DBG(" buf size %zu\n", pool->s.params.buf_len); ODP_DBG(" tailroom %u\n", pool->s.tailroom); ODP_DBG(" buf align %u requested, %u used\n", pool->s.params.buf_align, pool->s.buf_align); diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 5bf7b60..c4c448b 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -36,10 +36,10 @@ odp_packet_t odp_packet_alloc(odp_buffer_pool_t pool_hdl, uint32_t len) if (len == 0) { odp_packet_t pkt = (odp_packet_t)buffer_alloc(pool_hdl, - pool->s.params.buf_size); + pool->s.params.buf_len); if (pkt != ODP_PACKET_INVALID) pull_tail(odp_packet_hdr(pkt), - pool->s.params.buf_size); + pool->s.params.buf_len); return pkt; } @@ -619,7 +619,7 @@ odp_packet_t _odp_packet_alloc(odp_buffer_pool_t pool_hdl) return ODP_PACKET_INVALID; return (odp_packet_t)buffer_alloc(pool_hdl, - pool->s.params.buf_size); + pool->s.params.buf_len); } /** diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index a14de4f..0564130 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -100,7 +100,7 @@ int odp_schedule_init_global(void) return -1; } - params.buf_size = sizeof(queue_desc_t); + params.buf_len = sizeof(queue_desc_t); params.buf_align = 0; params.num_bufs = SCHED_POOL_SIZE/sizeof(queue_desc_t); params.buf_type = ODP_BUFFER_TYPE_RAW; diff --git a/test/api_test/odp_timer_ping.c b/test/api_test/odp_timer_ping.c index fb640d8..c9e3086 100644 --- a/test/api_test/odp_timer_ping.c +++ b/test/api_test/odp_timer_ping.c @@ -337,7 +337,7 @@ int main(int argc __attribute__((__unused__)), * Create message pool */ - params.buf_size = BUF_SIZE; + params.buf_len = BUF_SIZE; params.buf_align = 0; params.num_bufs = MSG_POOL_SIZE/BUF_SIZE; params.buf_type = ODP_BUFFER_TYPE_RAW;