From patchwork Thu Aug 13 11:45:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 52387 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 010BD2031F for ; Thu, 13 Aug 2015 11:49:32 +0000 (UTC) Received: by labd1 with SMTP id d1sf15966932lab.0 for ; Thu, 13 Aug 2015 04:49:30 -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=6+3Q+ZmMkHi0rs8t9CPuDq5RavZ+oOv/CV426FK/cpU=; b=Xng1LM/P43fayuhCw4h0Rg+qdm2UysOpZWqRQlnu+AzLvRRbxQvDsVKVPu5krqD8on uO0C0jQqQrNqz+OoNaapsgUrJFjt4ufh0DkQfaxOKE9/JHnr9tvxo712DRIpUOzmm7ZB Qgxa8+0ZaFlgXtf13wFNQMrzqkF6vxiYsV2NtQGIt0N5g1kVT8fCJvvKY9NIzg5hkOdj abmdndNQ+G1zASv4s+Ur6xcc28hGg5IrZLY870o9TgWZwjdGJqKTtoqIDVBg9gEefv7+ mTPmbbTRChzR6n8Oi00EIUo7HFANX39c8tmofsmXeslg1cpTow991EfVO+DJqB21oBB/ eT3g== X-Gm-Message-State: ALoCoQnzxTgwDHLo4xGh0ZnTRRCvHPLr1KblnyyE7IcHbiXYKFPxBQY5dl+xxsu6gN9tAn1lFvWK X-Received: by 10.180.186.36 with SMTP id fh4mr873933wic.7.1439466570947; Thu, 13 Aug 2015 04:49:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.139 with SMTP id o11ls166568lal.80.gmail; Thu, 13 Aug 2015 04:49:30 -0700 (PDT) X-Received: by 10.152.37.196 with SMTP id a4mr36097300lak.59.1439466570595; Thu, 13 Aug 2015 04:49:30 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id be2si2011484lab.80.2015.08.13.04.49.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Aug 2015 04:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbtg9 with SMTP id tg9so25683797lbb.1 for ; Thu, 13 Aug 2015 04:49:30 -0700 (PDT) X-Received: by 10.112.125.34 with SMTP id mn2mr32773240lbb.76.1439466570475; Thu, 13 Aug 2015 04:49:30 -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.7.198 with SMTP id l6csp888686lba; Thu, 13 Aug 2015 04:49:29 -0700 (PDT) X-Received: by 10.107.159.199 with SMTP id i190mr5848130ioe.68.1439466569213; Thu, 13 Aug 2015 04:49:29 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d10si1278577igl.52.2015.08.13.04.49.28; Thu, 13 Aug 2015 04:49:29 -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 2F3A561D59; Thu, 13 Aug 2015 11:49:28 +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 361A862011; Thu, 13 Aug 2015 11:46:24 +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 07E4561CE0; Thu, 13 Aug 2015 11:46:16 +0000 (UTC) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by lists.linaro.org (Postfix) with ESMTPS id EB3AB61D76 for ; Thu, 13 Aug 2015 11:45:49 +0000 (UTC) Received: by wijp15 with SMTP id p15so255080949wij.0 for ; Thu, 13 Aug 2015 04:45:49 -0700 (PDT) X-Received: by 10.194.78.164 with SMTP id c4mr74714944wjx.65.1439466349180; Thu, 13 Aug 2015 04:45:49 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by smtp.gmail.com with ESMTPSA id ma4sm2972054wjb.38.2015.08.13.04.45.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Aug 2015 04:45:48 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 13 Aug 2015 14:45:34 +0300 Message-Id: <1439466334-16497-7-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439466334-16497-1-git-send-email-maxim.uvarov@linaro.org> References: <1439466334-16497-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 6/6] 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.181 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 8c45e47..7623dfa 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -39,7 +39,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 0c56d70..06a8f06 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 f9ba74e..56005df 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 f8a8981..3086698 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -239,6 +239,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; }