From patchwork Wed Oct 29 13:24:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 39776 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 1227D24046 for ; Wed, 29 Oct 2014 13:25:14 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf1702042lam.0 for ; Wed, 29 Oct 2014 06:25:13 -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:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=6cPIO6WfQfB9y4HxOYQ8Fj+fanHQ+WqNHi8v65ypa64=; b=PbSrVZCKFUGYfYp05w+9IjY8OmNgxIz3fkpZlddyJPQbTvc9MI7bqsW2rN/FHK/33V mHDkxv9yPAxV8TTjNuYui7hgV70hZEWjnBgfBQ60MeEq/3YGsl+msgkG2ArBqjb17HeW x7yvGDfNfyfX9JcaU+uKkUdo77lOUTO9ek0WSTzDC88bXzVuQ0D3Jd1ii+s7uYiuijIW 5uhOAyIpYcBJzOHnjbeBGTM7/g2Yv4pshEmdUuzFkU/IzbnndpLpk1Gpfxd0+J/oYeF2 oygwY9LPazPpQijMi3mo7JmiNsjbLglwf0S/QVJ9XuzKagZLniiU/gu8uZGUV64NoJbI NvAA== X-Gm-Message-State: ALoCoQmmbmgCdA2V+OQlIzNEPMZXC6CdSvMb4TgGoOjqyxxuHkJEK1y4s8yWFr9oPsSh80MqNS/1 X-Received: by 10.181.27.135 with SMTP id jg7mr1868770wid.5.1414589113768; Wed, 29 Oct 2014 06:25:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.9 with SMTP id o9ls165439lao.97.gmail; Wed, 29 Oct 2014 06:25:13 -0700 (PDT) X-Received: by 10.152.37.104 with SMTP id x8mr11517792laj.74.1414589113609; Wed, 29 Oct 2014 06:25:13 -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 3si7161384lau.119.2014.10.29.06.25.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Oct 2014 06:25:13 -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 mail-la0-f47.google.com with SMTP id gd6so1309531lab.6 for ; Wed, 29 Oct 2014 06:25:13 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr11189698lbb.74.1414589113341; Wed, 29 Oct 2014 06:25: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.84.229 with SMTP id c5csp656173lbz; Wed, 29 Oct 2014 06:25:12 -0700 (PDT) X-Received: by 10.224.129.195 with SMTP id p3mr15466635qas.66.1414589111839; Wed, 29 Oct 2014 06:25:11 -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 t7si7355125qar.94.2014.10.29.06.25.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Oct 2014 06:25:11 -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 1XjTFO-0004Cd-2B; Wed, 29 Oct 2014 13:25:10 +0000 Received: from mail-wi0-f178.google.com ([209.85.212.178]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XjTF1-000459-Jw for lng-odp@lists.linaro.org; Wed, 29 Oct 2014 13:24:47 +0000 Received: by mail-wi0-f178.google.com with SMTP id q5so4564521wiv.5 for ; Wed, 29 Oct 2014 06:24:42 -0700 (PDT) X-Received: by 10.180.36.229 with SMTP id t5mr16341427wij.56.1414589082019; Wed, 29 Oct 2014 06:24:42 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id ce1sm5211461wjc.2.2014.10.29.06.24.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Oct 2014 06:24:41 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org, ciprian.barbu@linaro.org Date: Wed, 29 Oct 2014 13:24:06 +0000 Message-Id: <1414589046-16214-5-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414589046-16214-1-git-send-email-zoltan.kiss@linaro.org> References: <1414589046-16214-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH OVS v2 4/4] netdev, ofpbuf: Adjust OVS implementation to the latest ODP 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 --- lib/netdev-odp.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c index 74fbac9..59de46d 100644 --- a/lib/netdev-odp.c +++ b/lib/netdev-odp.c @@ -102,7 +102,6 @@ int odp_init(int argc, char *argv[]) { int result; - int thr_id; if (strcmp(argv[1], "--odp")) return 0; @@ -110,14 +109,17 @@ odp_init(int argc, char *argv[]) argc--; argv++; - result = odp_init_global(); + result = odp_init_global(NULL, NULL); if (result) { ODP_ERR("Error: ODP global init failed\n"); return result; } - thr_id = odp_thread_create(0); - odp_init_local(thr_id); + /* Init this thread */ + if (odp_init_local()) { + ODP_ERR("Error: ODP local init failed.\n"); + exit(EXIT_FAILURE); + } odp_initialized = 1; @@ -128,11 +130,13 @@ static int odp_class_init(void) { void *pool_base; + odp_shm_t shm; int result = 0; /* create packet pool */ - pool_base = odp_shm_reserve("shm_packet_pool", SHM_PKT_POOL_SIZE, - ODP_CACHE_LINE_SIZE); + shm = odp_shm_reserve("shm_packet_pool", SHM_PKT_POOL_SIZE, + ODP_CACHE_LINE_SIZE, 0); + pool_base = odp_shm_addr(shm); if (odp_unlikely(pool_base == NULL)) { ODP_ERR("Error: ODP packet pool mem alloc failed\n"); @@ -153,8 +157,9 @@ odp_class_init(void) odp_buffer_pool_print(pool); /* create ofpbuf pool */ - pool_base = odp_shm_reserve("shm_ofpbuf_pool", SHM_OFPBUF_POOL_SIZE, - ODP_CACHE_LINE_SIZE); + shm = odp_shm_reserve("shm_ofpbuf_pool", SHM_OFPBUF_POOL_SIZE, + ODP_CACHE_LINE_SIZE, 0); + pool_base = odp_shm_addr(shm); if (odp_unlikely(pool_base == NULL)) { ODP_ERR("Error: ODP packet pool mem alloc failed\n"); @@ -175,8 +180,9 @@ odp_class_init(void) odp_buffer_pool_print(ofpbuf_pool); /* create pool for structures */ - pool_base = odp_shm_reserve("shm_struct_pool", SHM_STRUCT_POOL_SIZE, - ODP_CACHE_LINE_SIZE); + shm = odp_shm_reserve("shm_struct_pool", SHM_STRUCT_POOL_SIZE, + ODP_CACHE_LINE_SIZE, 0); + pool_base = odp_shm_addr(shm); if (odp_unlikely(pool_base == NULL)) { ODP_ERR("Error: ODP packet pool mem alloc failed\n"); @@ -222,8 +228,6 @@ netdev_odp_construct(struct netdev *netdev_) { int err = 0; char *odp_if; - odp_pktio_params_t params; - socket_params_t *sock_params = ¶ms.sock_params; struct netdev_odp *netdev = netdev_odp_cast(netdev_); odp_packet_t pkt; @@ -234,9 +238,7 @@ netdev_odp_construct(struct netdev *netdev_) goto out_err; } - sock_params->type = ODP_PKTIO_TYPE_SOCKET_BASIC; - - netdev->pktio = odp_pktio_open(odp_if, pool, ¶ms); + netdev->pktio = odp_pktio_open(odp_if, pool); if (netdev->pktio == ODP_PKTIO_INVALID) { ODP_ERR("Error: odp pktio failed\n");