From patchwork Thu Mar 19 19:14:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 46082 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8AD9F2153C for ; Thu, 19 Mar 2015 19:15:15 +0000 (UTC) Received: by labgq15 with SMTP id gq15sf14190112lab.0 for ; Thu, 19 Mar 2015 12:15:14 -0700 (PDT) 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=NWxn2gYeczJQUoYGGd3wH85/iU5sDIGbvbAOobacfB8=; b=jDPsP5e7q74XJuXXitJ8kmJnTT71+1RFmN28FaZopcG8tZDLVJM/U1VJXzEUNU9mO2 zVBUePjI3zZMIIURTN6b7kjoTsk70lZrxxHxgRzimOBsAddh+UCw+FlqOLOA8nIimOCo J2NA3V2Bv1J4q2gXZMe5wATiuNpfkILX5pWBszpn9GBcY1vQ4JHfGgg8PCTSc3Pm+jU1 pLmXHrHHi+NEZ22m0vPRnO3EWWT4fyNA/TX8gyJH1Osr3QnK2uKuZPJPUfLW9BNlqjF+ mDrtgsl/o1eYGHhyuNAw0dzGg7Pqzamaox2lA3EVStyHbPfIuezQi91pBY2ydPCGoUKy HxDw== X-Gm-Message-State: ALoCoQnygshQlxTJxR4CMT3298/Qw6CAvCUZayj8PB8IgTvX7yTIgY1/E+S69ucvv3iUyMtqqPyy X-Received: by 10.112.73.33 with SMTP id i1mr3795072lbv.0.1426792514143; Thu, 19 Mar 2015 12:15:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.38 with SMTP id cb6ls285011lad.97.gmail; Thu, 19 Mar 2015 12:15:14 -0700 (PDT) X-Received: by 10.152.22.1 with SMTP id z1mr58261694lae.114.1426792513995; Thu, 19 Mar 2015 12:15:13 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id zk8si1642050lbb.62.2015.03.19.12.15.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 12:15:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lamx15 with SMTP id x15so70410407lam.3 for ; Thu, 19 Mar 2015 12:15:13 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr68801597laf.117.1426792513892; Thu, 19 Mar 2015 12:15:13 -0700 (PDT) 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.35.133 with SMTP id h5csp589419lbj; Thu, 19 Mar 2015 12:15:13 -0700 (PDT) X-Received: by 10.140.233.3 with SMTP id e3mr63457172qhc.94.1426792512699; Thu, 19 Mar 2015 12:15:12 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id w18si2138282qge.62.2015.03.19.12.15.11 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Mar 2015 12:15:12 -0700 (PDT) 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 1YYfuQ-0001MA-0s; Thu, 19 Mar 2015 19:15:10 +0000 Received: from mail-wg0-f43.google.com ([74.125.82.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YYfu0-0001EK-Mz for lng-odp@lists.linaro.org; Thu, 19 Mar 2015 19:14:44 +0000 Received: by wgbcc7 with SMTP id cc7so70894290wgb.0 for ; Thu, 19 Mar 2015 12:14:39 -0700 (PDT) X-Received: by 10.180.24.65 with SMTP id s1mr18921000wif.30.1426792479188; Thu, 19 Mar 2015 12:14:39 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id xy2sm3176956wjc.14.2015.03.19.12.14.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 12:14:38 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Thu, 19 Mar 2015 19:14:26 +0000 Message-Id: <1426792468-12598-4-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426792468-12598-1-git-send-email-zoltan.kiss@linaro.org> References: <1426792468-12598-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 3/5] netdev-odp: rename odp_pool_param_t members 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: zoltan.kiss@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.215.50 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 Signed-off-by: Zoltan Kiss --- lib/netdev-odp.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c index 7a0780e..2a04d24 100644 --- a/lib/netdev-odp.c +++ b/lib/netdev-odp.c @@ -133,10 +133,10 @@ odp_class_init(void) /* create packet & ofpbuf pool */ - params.buf_size = SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE; - params.buf_align = ODP_CACHE_LINE_SIZE; - params.num_bufs = SHM_PKT_POOL_NUM_BUFS; - params.buf_type = ODP_BUFFER_TYPE_PACKET; + params.pkt.len= SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE; + params.pkt.seg_len = 0; + params.pkt.num = SHM_PKT_POOL_NUM_BUFS; + params.type = ODP_POOL_PACKET; pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms); @@ -147,8 +147,8 @@ odp_class_init(void) odp_pool_print(pool); /* Allocate all the packets from the pool and initialize ofpbuf part */ - pkts = malloc(sizeof(odp_packet_t) * params.num_bufs); - for (i=0; i < params.num_bufs; ++i) { + pkts = malloc(sizeof(odp_packet_t) * params.pkt.num); + for (i=0; i < params.pkt.num; ++i) { struct dpif_packet *packet; char *start; pkts[i] = odp_packet_alloc(pool, 0); @@ -169,7 +169,7 @@ odp_class_init(void) } /* Free our packets up */ - for (i=0; i < params.num_bufs; i++) + for (i=0; i < params.pkt.num; i++) odp_packet_free(pkts[i]); free(pkts); @@ -177,8 +177,9 @@ odp_class_init(void) /* create pool for structures */ - params.buf_size = SHM_STRUCT_POOL_BUF_SIZE; - params.num_bufs = SHM_STRUCT_POOL_NUM_BUFS; + params.type = ODP_POOL_BUFFER; + params.buf.size = SHM_STRUCT_POOL_BUF_SIZE; + params.buf.num = SHM_STRUCT_POOL_NUM_BUFS; struct_pool = odp_pool_create("struct_pool", ODP_SHM_NULL, ¶ms); @@ -240,7 +241,7 @@ netdev_odp_construct(struct netdev *netdev_) goto out_err; } - netdev->max_frame_len = info.params.buf_size; + netdev->max_frame_len = info.params.pkt.len; ovs_mutex_init(&netdev->mutex);