From patchwork Thu Mar 26 19:23:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 46388 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 239B321585 for ; Thu, 26 Mar 2015 19:25:18 +0000 (UTC) Received: by lbbro7 with SMTP id ro7sf6578360lbb.0 for ; Thu, 26 Mar 2015 12:25:17 -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=6dkTkC9HRKFGE0UYNh9Ocf3oQvWwfoDvdUkppwm0Jro=; b=Cx94Yzq22RISux8ZTUp0iHjyF1MzEXnhWW4qFznPW4OrCtrjAdK6A0+dld3d+Wkwgn GqvhlXCzGkh0ABQAKukLP21Zx0b0YwXMf218TL4Xv1wCOdfRXuUw0OrBYMPM8XAan8Dh atHrGi/SZlo+W28AQMTohTwnXFZWqFwmbfiZFHsRvyMqdG2CrlCqNhfAeAH7KucgxRMC Wwvw6a6uzUTcpekjyUOBA9yBlAjumvEuK+oNOnqzdf6jLvJoQzvw5Iuuf+1x8QaIn5cM fw3EqOGg6kuP6o+U81s3MR8zjpP6uMgi2lj2x6vabGDwuYld0QgsOZZC/3AATTq726yz 3wXA== X-Gm-Message-State: ALoCoQktPCkyJRuj8xy+5Xq3dBm1iYTLv0nULXgZlV0xmq1TXag2NS1jONWN5gbsQHgZFDWPK56b X-Received: by 10.180.218.2 with SMTP id pc2mr2007546wic.0.1427397917108; Thu, 26 Mar 2015 12:25:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.98 with SMTP id l2ls251541lam.28.gmail; Thu, 26 Mar 2015 12:25:16 -0700 (PDT) X-Received: by 10.112.157.100 with SMTP id wl4mr14865086lbb.108.1427397916943; Thu, 26 Mar 2015 12:25:16 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id ba5si5308474lbc.128.2015.03.26.12.25.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 12:25:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by labe2 with SMTP id e2so53764322lab.3 for ; Thu, 26 Mar 2015 12:25:16 -0700 (PDT) X-Received: by 10.152.8.161 with SMTP id s1mr6119341laa.41.1427397916845; Thu, 26 Mar 2015 12:25:16 -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.57.201 with SMTP id k9csp814006lbq; Thu, 26 Mar 2015 12:25:16 -0700 (PDT) X-Received: by 10.55.26.104 with SMTP id a101mr32327401qka.81.1427397915449; Thu, 26 Mar 2015 12:25:15 -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 n9si5918648qga.13.2015.03.26.12.25.10 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Mar 2015 12:25:15 -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 1YbDOu-0000JZ-JT; Thu, 26 Mar 2015 19:25:08 +0000 Received: from mail-wi0-f181.google.com ([209.85.212.181]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YbDO1-0000AS-CC for lng-odp@lists.linaro.org; Thu, 26 Mar 2015 19:24:13 +0000 Received: by wibgn9 with SMTP id gn9so1724945wib.1 for ; Thu, 26 Mar 2015 12:24:08 -0700 (PDT) X-Received: by 10.194.57.206 with SMTP id k14mr31578139wjq.1.1427397847902; Thu, 26 Mar 2015 12:24:07 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id kr5sm9708209wjc.1.2015.03.26.12.24.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 12:24:07 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Thu, 26 Mar 2015 19:23:54 +0000 Message-Id: <1427397836-27442-4-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427397836-27442-1-git-send-email-zoltan.kiss@linaro.org> References: <1427397836-27442-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 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.47 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 bdea022..2ab632e 100644 --- a/lib/netdev-odp.c +++ b/lib/netdev-odp.c @@ -132,10 +132,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); @@ -146,8 +146,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); @@ -166,7 +166,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); @@ -174,8 +174,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); @@ -237,7 +238,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);