From patchwork Wed Aug 19 13:19:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 52550 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id CED7A22DB1 for ; Wed, 19 Aug 2015 13:22:37 +0000 (UTC) Received: by lbck9 with SMTP id k9sf1499054lbc.0 for ; Wed, 19 Aug 2015 06:22:36 -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: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=uMkQKqXbi6xGT7wBiwkOKJwIC9Iw9toLztuh5Ge3f4g=; b=MBdmr1wJ7DW44Ztwmh4RFt98mckHVHxJkBHE/Z4FxzuhVDmR0G3U2dDFr9KeLodc/J oLx4ZdGHdEprb6Cjr3TsfVVMOGnGr/o8mpYMXfMKhQrpByD5UTHC8pifPi1mJnzir+p7 8euw0sYz8J9sUHj5w26SRKIjEyK8ixeWL4ESfNXL6lx/rLu3UjK1hGzZL8MUKuk6ZQQ8 yo/82KKophbIuUVM8/FmWw9OFZPzTT9YGCMDT4k+VIpY2K5Lw2TBx4rcLUuvjPdzNnfY 0ev8ce08QHIIu6erOSIGJ+quZc/Hr121+RL+O0dRd9oacoNalrY2T6fV3bMY6JcQwK0k ZVvA== X-Gm-Message-State: ALoCoQl4o4YtHupRdpjbelY/fm+cTzLMFhPtuQPfffnypxnbaWPRW1cVl6zHiBjuRScFMbXUEoMI X-Received: by 10.194.184.6 with SMTP id eq6mr3240222wjc.4.1439990556772; Wed, 19 Aug 2015 06:22:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.197 with SMTP id da5ls26660lac.61.gmail; Wed, 19 Aug 2015 06:22:36 -0700 (PDT) X-Received: by 10.152.87.20 with SMTP id t20mr11394613laz.80.1439990556470; Wed, 19 Aug 2015 06:22:36 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id n5si484790laf.168.2015.08.19.06.22.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Aug 2015 06:22:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbsx3 with SMTP id sx3so3082549lbb.0 for ; Wed, 19 Aug 2015 06:22:36 -0700 (PDT) X-Received: by 10.112.125.34 with SMTP id mn2mr10120921lbb.76.1439990555898; Wed, 19 Aug 2015 06:22:35 -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.162.200 with SMTP id yc8csp371825lbb; Wed, 19 Aug 2015 06:22:34 -0700 (PDT) X-Received: by 10.140.239.84 with SMTP id k81mr23974011qhc.66.1439990553891; Wed, 19 Aug 2015 06:22:33 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i82si968718qkh.117.2015.08.19.06.22.33; Wed, 19 Aug 2015 06:22:33 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 03C3961F1C; Wed, 19 Aug 2015 13:22:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 521C462000; Wed, 19 Aug 2015 13:19:59 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A2E7961F6C; Wed, 19 Aug 2015 13:19:47 +0000 (UTC) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by lists.linaro.org (Postfix) with ESMTPS id 5B68D61F58 for ; Wed, 19 Aug 2015 13:19:24 +0000 (UTC) Received: by wibhh20 with SMTP id hh20so8214538wib.0 for ; Wed, 19 Aug 2015 06:19:23 -0700 (PDT) X-Received: by 10.194.114.197 with SMTP id ji5mr23581183wjb.57.1439990363567; Wed, 19 Aug 2015 06:19:23 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by smtp.gmail.com with ESMTPSA id h9sm1039322wjx.20.2015.08.19.06.19.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Aug 2015 06:19:23 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 19 Aug 2015 16:19:01 +0300 Message-Id: <1439990341-12037-8-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439990341-12037-1-git-send-email-maxim.uvarov@linaro.org> References: <1439990341-12037-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 7/7] linux-generic: default state for pktio is STOP X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@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.173 as permitted sender) smtp.mailfrom=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 After open pktio remains stopped. Inside worker thread (after all configuration done it should be started.) In that patch I just start it everywhere to keep original logic and be easy for review. Putting it inside worker threads will require thread arguments change and understanding logic of current app. It's better to do further changes in separate patches per app. Signed-off-by: Maxim Uvarov --- example/classifier/odp_classifier.c | 1 + example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 1 + example/packet/odp_pktio.c | 1 + platform/linux-generic/pktio/loop.c | 2 +- platform/linux-generic/pktio/socket.c | 2 +- platform/linux-generic/pktio/socket_mmap.c | 2 +- test/performance/odp_l2fwd.c | 1 + test/performance/odp_pktio_perf.c | 2 +- test/validation/classification/odp_classification_tests.c | 1 + test/validation/pktio/pktio.c | 1 + 11 files changed, 11 insertions(+), 5 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index ac204af..ffa39f8 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -210,6 +210,7 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool) EXAMPLE_ERR("pktio create failed for %s\n", dev); exit(EXIT_FAILURE); } + odp_pktio_start(pktio); /* @todo: move to worker thread */ odp_queue_param_init(&qparam); qparam.sched.prio = ODP_SCHED_PRIO_DEFAULT; diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 35a6fa8..3cf99fa 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -333,10 +333,10 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool) /* Open a packet IO instance */ pktio = odp_pktio_open(dev, pool, &pktio_param); - if (pktio == ODP_PKTIO_INVALID) EXAMPLE_ABORT("Error: pktio create failed for %s\n", dev); + odp_pktio_start(pktio); /* @todo: move to worker thread */ /* * Create and set the default INPUT queue associated with the 'pktio' * resource diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index d392925..c1401d7 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -529,6 +529,7 @@ void initialize_intf(char *intf) EXAMPLE_ERR("Error: pktio create failed for %s\n", intf); exit(EXIT_FAILURE); } + odp_pktio_start(pktio); /* @todo: move to worker thread */ outq_def = odp_pktio_outq_getdef(pktio); /* diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index f4574a2..66dce07 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -138,6 +138,7 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool, int mode) pktio = odp_pktio_open(dev, pool, &pktio_param); if (pktio == ODP_PKTIO_INVALID) EXAMPLE_ABORT("Error: pktio create failed for %s\n", dev); + odp_pktio_start(pktio); /* @todo: move to worker thread */ snprintf(inq_name, sizeof(inq_name), "%" PRIu64 "-pktio_inq_def", odp_pktio_to_u64(pktio)); diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index f61ccd5..ef77e34 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -41,7 +41,7 @@ static int loopback_open(odp_pktio_t id, pktio_entry_t *pktio_entry, if (pktio_entry->s.pkt_loop.loopq == ODP_QUEUE_INVALID) return -1; - pktio_entry->s.state = STATE_START; + pktio_entry->s.state = STATE_STOP; return 0; } diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 7db9747..f1dd39c 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -248,7 +248,7 @@ static int sock_setup_pkt(pktio_entry_t *pktio_entry, const char *netdev, goto error; } - pktio_entry->s.state = STATE_START; + pktio_entry->s.state = STATE_STOP; return 0; error: diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index 2e55672..3fd2b0f 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -486,7 +486,7 @@ static int sock_mmap_open(odp_pktio_t id ODP_UNUSED, goto error; } - pktio_entry->s.state = STATE_START; + pktio_entry->s.state = STATE_STOP; return 0; error: diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 366bb15..2a8ed68 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -292,6 +292,7 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool, printf("created pktio %" PRIu64 " (%s)\n", odp_pktio_to_u64(pktio), dev); + odp_pktio_start(pktio); /* @todo: move to worker thread */ /* no further setup needed for burst mode */ if (mode == APPL_MODE_PKT_BURST) diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 1552579..5d739bc 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -709,7 +709,7 @@ static odp_pktio_t create_pktio(const char *iface, int schedule) pktio_param.in_mode = ODP_PKTIN_MODE_POLL; pktio = odp_pktio_open(iface, pool, &pktio_param); - + odp_pktio_start(pktio); /* @todo: move to worker thread */ return pktio; } diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index c44ceb9..0592066 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -306,6 +306,7 @@ int classification_suite_init(void) fprintf(stderr, "unable to destroy pool.\n"); return -1; } + odp_pktio_start(pktio_loop); /* @todo: move to worker thread */ qparam.sched.prio = ODP_SCHED_PRIO_DEFAULT; qparam.sched.sync = ODP_SCHED_SYNC_ATOMIC; qparam.sched.group = ODP_SCHED_GROUP_ALL; diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index d43c25e..9e5a2ab 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -242,6 +242,7 @@ static odp_pktio_t create_pktio(const char *iface, odp_queue_type_t q_type, CU_ASSERT(pktio != ODP_PKTIO_INVALID); CU_ASSERT(odp_pktio_to_u64(pktio) != odp_pktio_to_u64(ODP_PKTIO_INVALID)); + odp_pktio_start(pktio); return pktio; }