From patchwork Mon Oct 13 18:56:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 38681 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8DF7B2039B for ; Mon, 13 Oct 2014 18:56:47 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf4450540wgh.0 for ; Mon, 13 Oct 2014 11:56:46 -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: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=juklhTDtEBh4xjKT0ZuTOAvjNh7pOyWJwugiebs74rM=; b=Ke1By1OpVqRoYUazZiRbIFA44hsdRgmQErVNwtoyNBY1FhoGrPQQWwO34PxDKK5Dlt q+7IL3nagFwld6SuixMlyQTa1ylWF0rx9WPGo1jJ/wZSlItCv18x3xGa+R4fIxkwONXU D+nwdu9f0aqjPhyeVrLBqa5KMhv7wp33EtmM5tah21mZaNWTDKVktSEMr2R2mFnJaIVK TN9jlpbG47AecJLzr73RxMw6DC7oNUp3abUDn6qn4lRE3Stv3cGVLUSWBkRK5loMgcnI OWsRpH6aoX8hguMgmkbWcCwWdduK9YhnDkcABDz5t3hYOyAgQC5Ea+1QG0vJLpgUjyQt JWuQ== X-Gm-Message-State: ALoCoQnjtNdTWWKieFoKcdgSMWrfUISHwuxFYiTRd2nZqUBN0rjDkW5akjhXDFpH2HVmYeNFk+2i X-Received: by 10.112.141.230 with SMTP id rr6mr70212lbb.4.1413226606736; Mon, 13 Oct 2014 11:56:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.74 with SMTP id w10ls517925laj.99.gmail; Mon, 13 Oct 2014 11:56:46 -0700 (PDT) X-Received: by 10.152.1.42 with SMTP id 10mr579373laj.4.1413226606477; Mon, 13 Oct 2014 11:56:46 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by mx.google.com with ESMTPS id s6si23399964las.121.2014.10.13.11.56.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 11:56:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id gi9so7131489lab.5 for ; Mon, 13 Oct 2014 11:56:46 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr381877lbc.23.1413226606349; Mon, 13 Oct 2014 11:56:46 -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 c5csp271312lbz; Mon, 13 Oct 2014 11:56:45 -0700 (PDT) X-Received: by 10.140.23.198 with SMTP id 64mr766461qgp.62.1413226604989; Mon, 13 Oct 2014 11:56:44 -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 f63si26205557qgf.83.2014.10.13.11.56.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 Oct 2014 11:56:44 -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 1XdknS-00021K-1h; Mon, 13 Oct 2014 18:56:42 +0000 Received: from mail-qg0-f43.google.com ([209.85.192.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XdknL-000217-2C for lng-odp@lists.linaro.org; Mon, 13 Oct 2014 18:56:35 +0000 Received: by mail-qg0-f43.google.com with SMTP id j107so7194009qga.2 for ; Mon, 13 Oct 2014 11:56:29 -0700 (PDT) X-Received: by 10.224.45.65 with SMTP id d1mr607649qaf.43.1413226589786; Mon, 13 Oct 2014 11:56:29 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id l5sm13500269qai.20.2014.10.13.11.56.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Oct 2014 11:56:29 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 13 Oct 2014 14:56:17 -0400 Message-Id: <1413226577-60331-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [RFC PATCH] odp_init.h: Add odp_terminate_global 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: mike.holmes@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.46 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 Unit testing replicates a situation similar to an NFV case where the workload is varied without rebooting the HW. In this use case there have to be hooks for the application to inform the implementation that HW needs to be released. Signed-off-by: Mike Holmes --- This patch is intended to specify the API, the implementation for it will require a number of other APIs to be created before it is complete. If accepted the follow on work would require APIs and implementations for odp_shm_terminate_global odp_thread_terminate_global odp_buffer_pool_terminate_global odp_queue_terminate_global odp_schedule_terminate_global odp_pktio_terminate_global odp_timer_terminate_global odp_crypto_terminate_global I propose that initially the odp_terminate_global just return success and the implementation of the supporting functionality be built up over time. platform/linux-generic/include/api/odp_init.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h index fab4f6e..f24ff5a 100644 --- a/platform/linux-generic/include/api/odp_init.h +++ b/platform/linux-generic/include/api/odp_init.h @@ -48,6 +48,8 @@ typedef struct odp_platform_init_t { * * This function must be called once before calling any other ODP API * functions. + * @sa odp_terminate_global() + * * @param[in] params Those parameters that are interpreted by the ODP API * @param[in] platform_params Those parameters that are passed without * interpretation by the ODP API to the implementation. @@ -56,6 +58,24 @@ typedef struct odp_platform_init_t { int odp_init_global(odp_init_t *params, odp_platform_init_t *platform_params); /** + * Terminate ODP session. + * + * This function is the final ODP call made when terminating + * an ODP application in a controlled way. It cannot handle exceptional + * circumstances. + * In general it calls the API modules terminate functions in the reverse order + * to that which the module init functions were called during odp_init_global() + * + * @warning The unwinding of HW resources to allow them to be re used without reseting + * the device is a complex task that the application is expected to coordinate. + * This api may have platform dependant implications. + * @sa odp_init_global() + * + * @return 0 if successful + */ +int odp_terminate_global(void); + +/** * Perform thread local ODP initialization. * * All threads must call this function before calling