From patchwork Wed Oct 15 18:14:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 38789 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ECE3420C4E for ; Wed, 15 Oct 2014 18:15:06 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id p9sf1039568lbv.4 for ; Wed, 15 Oct 2014 11:15:05 -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=FF2Ct4EIEN6ONgjVPm2I8ow9TgFv7ta+xh26ZNFfQ5s=; b=gwIE258PkUdjjJMLQzDPK7Ljw+J9W50IJEZJ9Tc9Wa/LC7aVNPiWKVphqsqzXJFQMs AoY8em8Ij43f3a8BkIrBgHHYa08dVo6wSm3NVwO1ZCIbJNUCk2Xha6Mxboij5oGQDVxM W42JbhEfTS6D49Q+M84XMqLahMPGQvQAFMuaJmo846AU87qVlCUVX7/DhD416jP86w4m SwPUfVvTWQu7ogLXH4evbId4tAd6QDfE5htdPOxZuF+0gYeD2+eLO4LC1Ky0M6eShO/6 6AzwxOyhsWzOf/ftKx7FkmH/y6nKoOi0tSZYL5j/0arPerDMASx5S6yRGtvutWyyKPDS x8pQ== X-Gm-Message-State: ALoCoQlGs1GYvp5DXazOn3RHoSjYKGn5PxAsJnTiv4PEHjCZgnGTLNb0/SCvpbnCpYlZ4HJ2I5XT X-Received: by 10.180.105.74 with SMTP id gk10mr2683442wib.0.1413396905277; Wed, 15 Oct 2014 11:15:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.4 with SMTP id r4ls88041lae.24.gmail; Wed, 15 Oct 2014 11:15:05 -0700 (PDT) X-Received: by 10.152.88.105 with SMTP id bf9mr14303490lab.30.1413396905047; Wed, 15 Oct 2014 11:15:05 -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 y8si31575370lag.85.2014.10.15.11.15.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 Oct 2014 11:15:05 -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 gi9so1577017lab.33 for ; Wed, 15 Oct 2014 11:15:04 -0700 (PDT) X-Received: by 10.112.12.35 with SMTP id v3mr8550839lbb.80.1413396904759; Wed, 15 Oct 2014 11:15:04 -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 c5csp655336lbz; Wed, 15 Oct 2014 11:15:04 -0700 (PDT) X-Received: by 10.140.101.120 with SMTP id t111mr495238qge.6.1413396903512; Wed, 15 Oct 2014 11:15:03 -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 r16si36131921qax.33.2014.10.15.11.15.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 15 Oct 2014 11:15:03 -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 1XeT6D-0005eN-SC; Wed, 15 Oct 2014 18:15:01 +0000 Received: from mail-qc0-f178.google.com ([209.85.216.178]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XeT67-0005bp-6U for lng-odp@lists.linaro.org; Wed, 15 Oct 2014 18:14:55 +0000 Received: by mail-qc0-f178.google.com with SMTP id c9so1413148qcz.23 for ; Wed, 15 Oct 2014 11:14:50 -0700 (PDT) X-Received: by 10.140.49.107 with SMTP id p98mr459164qga.20.1413396889945; Wed, 15 Oct 2014 11:14:49 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id f32sm1362195qge.44.2014.10.15.11.14.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Oct 2014 11:14:49 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 15 Oct 2014 14:14:29 -0400 Message-Id: <1413396869-34738-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH v2] 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 --- v2: Modify the name from terminate to term 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..cfb50f9 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_term_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_term_global(void); + +/** * Perform thread local ODP initialization. * * All threads must call this function before calling